Compare commits
12 Commits
bbc76c929b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a2bb1499 | |||
|
b83bbe0b68
|
|||
|
86c9a4f694
|
|||
|
4319fdcdc0
|
|||
|
e0ffbee649
|
|||
|
f3fef33fb6
|
|||
|
f11e51b067
|
|||
|
822cd31b60
|
|||
|
950ddab4fd
|
|||
|
e542a91b9d
|
|||
|
536bda25fb
|
|||
|
bb253a2b2c
|
@@ -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
|
||||
|
||||
71
README.md
71
README.md
@@ -1,31 +1,80 @@
|
||||
## I hate the future
|
||||
|
||||
Stories in every app, rounded corners, I hate them, this is a container of 64gram-desktop from aur before those annoying things were added. :)
|
||||
|
||||
### Please dont use docker, use podman instead
|
||||
reason is that if you saved a file from telegram to your host, it will be saved as root user and your user cannot delete it
|
||||
and podman runs as your user, so thats not an issue.
|
||||
|
||||
Now, Look this isnt best solution or even a good solution.
|
||||
but you need to run this command first, before starting the container!
|
||||
|
||||
save this as `docker-compose.yml`
|
||||
```bash
|
||||
socat UNIX-LISTEN:/tmp/xdg-open.socket,fork EXEC:"xargs -n 1 xdg-open"
|
||||
```
|
||||
There is a script called `socat-server.sh` with this command as well.
|
||||
|
||||
OK but what is this, why do i need this??
|
||||
Because, my dear, Telegram cannot open links when you click on them because telegram dont have access to browser to execute the command.
|
||||
AND that command starts a unix socket which then telegram can send `xdg-open` commands to, the container has a modified `xdg-open` command to accept from the socket.
|
||||
the modified xdg-open is also in this repo, its called `xdg-open-listener.sh`, i just renam it to `xdg-open` when building the container, see `Dockerfile`
|
||||
|
||||
hehe, simple :) ok anyway
|
||||
|
||||
save this as `podman-compose.yml` or if you like pain save as `docker-compose.yml`
|
||||
```yml
|
||||
version: '3.5'
|
||||
|
||||
services:
|
||||
64gram:
|
||||
hostname: 64gram
|
||||
image: git.shihaam.dev/dockerfiles/64gram
|
||||
environment:
|
||||
- DISPLAY
|
||||
- DISPLAY # For GUI access
|
||||
devices:
|
||||
- /dev/snd:/dev/snd
|
||||
- /dev/video0:/dev/video0
|
||||
- /dev/snd:/dev/snd # Mic and Speaker support
|
||||
- /dev/video0:/dev/video0 # Webcam support
|
||||
volumes:
|
||||
- $HOME/.local/share/64Gram:/root/.local/share/64Gram
|
||||
- $HOME/Downloads:/root/Downloads
|
||||
- $HOME/Pictures:/root/Pictures
|
||||
- $HOME/Documents:/root/Documents
|
||||
- /usr/share/icons:/usr/share/icons
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix
|
||||
- $HOME/.local/share/64Gram:/root/.local/share/64Gram # Telegram data
|
||||
- $HOME/Downloads:/root/Downloads # Downloads folder
|
||||
- $HOME/Pictures:/root/Pictures # Pictures folder
|
||||
- $HOME/Documents:/root/Documents # Documents folder
|
||||
- /usr/share/icons:/usr/share/icons # Icons for UI, like Mouse cursor
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix # X11 socket for GUI
|
||||
- /tmp/xdg-open.socket:/tmp/xdg-open.socket # Add support for xdg-open
|
||||
```
|
||||
and run `podman-compose up -d` or if you wanna live dangerously then you may..: `docker compose up -d`
|
||||
|
||||
k, thanks, bye
|
||||
here is a script that uses podman run command that does exactly the thing above lol
|
||||
```bash
|
||||
#!/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 \
|
||||
-e DISPLAY \
|
||||
--device /dev/snd:/dev/snd \
|
||||
--device /dev/video0:/dev/video0 \
|
||||
-v $HOME/.local/share/64Gram:/root/.local/share/64Gram \
|
||||
-v $HOME/Downloads:/root/Downloads \
|
||||
-v $HOME/Pictures:/root/Pictures \
|
||||
-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
|
||||
```
|
||||
LOOK it even sets a random socket value so it wont mess up when you attempt to run it more than once, dont do it though \
|
||||
im just gonna have this symlinked to `/sbin/telegram-desktop` when the future is today.
|
||||
|
||||
|
||||
k, thanks, bye.
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
version: '3.5'
|
||||
|
||||
services:
|
||||
64gram:
|
||||
build: .
|
||||
hostname: 64gram
|
||||
image: git.shihaam.dev/dockerfiles/64gram
|
||||
environment:
|
||||
- DISPLAY
|
||||
- DISPLAY # For GUI access
|
||||
devices:
|
||||
- /dev/snd:/dev/snd
|
||||
- /dev/video0:/dev/video0
|
||||
- /dev/snd:/dev/snd # Mic and Speaker support
|
||||
- /dev/video0:/dev/video0 # Webcam support
|
||||
volumes:
|
||||
- $HOME/.local/share/64Gram:/root/.local/share/64Gram
|
||||
- $HOME/Downloads:/root/Downloads
|
||||
- $HOME/Pictures:/root/Pictures
|
||||
- $HOME/Documents:/root/Documents
|
||||
- /usr/share/icons:/usr/share/icons
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix
|
||||
- $HOME/.local/share/64Gram:/root/.local/share/64Gram # Telegram data
|
||||
- $HOME/Downloads:/root/Downloads # Downloads folder
|
||||
- $HOME/Pictures:/root/Pictures # Pictures folder
|
||||
- $HOME/Documents:/root/Documents # Documents folder
|
||||
- /usr/share/icons:/usr/share/icons # Icons for UI, like Mouse cursor
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix # X11 socket for GUI
|
||||
- /tmp/xdg-open.socket:/tmp/xdg-open.socket # Add support for xdg-open
|
||||
|
||||
2
socat-server.sh
Executable file
2
socat-server.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
socat UNIX-LISTEN:/tmp/xdg-open.socket,fork EXEC:"xargs -n 1 xdg-open"
|
||||
3
xdg-open-listener.sh
Normal file
3
xdg-open-listener.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo $1 | socat - UNIX-CONNECT:/tmp/xdg-open.socket
|
||||
Reference in New Issue
Block a user