socketttts

This commit is contained in:
Shihaam Abdul Rahman 2023-10-04 02:18:48 +05:00
parent b0a4bb2270
commit e7c2673576
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636
2 changed files with 12 additions and 0 deletions

3
scripts/open-url.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
xdg-open "$1"

View File

@ -1,5 +1,11 @@
#!/bin/bash
SOCKET_ID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 8)
# Start socat in the background
socat UNIX-LISTEN:/tmp/xdg-open$SOCKET_ID.socket,fork EXEC:"xargs -n 1 xdg-open" &
# Run the Podman container
podman run --rm \
--name 64gram \
--hostname 64gram \
@ -12,5 +18,8 @@ podman run --rm \
-v $HOME/Documents:/root/Documents \
-v /usr/share/icons:/usr/share/icons \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /tmp/xdg-open$SOCKET_ID.socket:/tmp/xdg-open.socket \
git.shihaam.dev/dockerfiles/64gram
# Wait for all background processes to finish
wait