added support to open links

This commit is contained in:
Shihaam Abdul Rahman 2023-10-04 00:51:04 +05:00
parent bb253a2b2c
commit 536bda25fb
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636
4 changed files with 14 additions and 1 deletions

View File

@ -4,8 +4,11 @@ WORKDIR /root
COPY 64gram-desktop-bin-1_1.0.85-1-x86_64.pkg.tar.zst .
RUN pacman -Sy alsa-utils --noconfirm \
RUN pacman -Sy alsa-utils xdg-utils socat --noconfirm \
&& pacman -U 64gram-desktop-bin-1_1.0.85-1-x86_64.pkg.tar.zst --noconfirm \
&& rm -rfv 64gram-desktop-bin-1_1.0.85-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/*
COPY xdg-open-listener.sh /usr/sbin/xdg-open
RUN chmod +x /usr/sbin/xdg-open
CMD telegram-desktop

View File

@ -17,6 +17,8 @@ services:
image: git.shihaam.dev/dockerfiles/64gram
environment:
- DISPLAY # For GUI access
- XDG_OPEN_LISTENER_PORT=6969 # Set this to port number of socat server
- XDG_OPEN_LISTENER_HOST=192.168.x.x # set this to your host machine IP
devices:
- /dev/snd:/dev/snd # Mic and Speaker support
- /dev/video0:/dev/video0 # Webcam support
@ -30,4 +32,7 @@ services:
```
and run `podman-compose up -d` or if you wanna live dangerously then you may..: `docker compose up -d`
Telegram cannot open links from the container to host machine, and to work around that is this command
`socat TCP-LISTEN:$XDG_OPEN_LISTENER_PORT,fork EXEC:"xargs -n 1 xdg-open"`
k, thanks, bye

View File

@ -7,6 +7,8 @@ services:
image: git.shihaam.dev/dockerfiles/64gram
environment:
- DISPLAY # For GUI access
- XDG_OPEN_LISTENER_PORT=6969 # Set this to port number of socat server
- XDG_OPEN_LISTENER_HOST=192.168.x.x # set this to your host machine IP
devices:
- /dev/snd:/dev/snd # Mic and Speaker support
- /dev/video0:/dev/video0 # Webcam support

3
xdg-open-listener.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo $1 | socat - TCP:$XDG_OPEN_LISTENER_HOST:$XDG_OPEN_LISTENER_PORT