Skip to content

Commit

Permalink
several improvements:
Browse files Browse the repository at this point in the history
- handle opening urls with a desktop notification, allowing the user to copy it to the clipboard
- move autostart/menu.xml/rc.xml to system folder, allowing updates to these files without clearing the user config folder
- since we dont use gpu accel, remove unused video driver packages
  • Loading branch information
remcoros committed Feb 11, 2024
1 parent 360ead9 commit 6fcff83
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 29 deletions.
27 changes: 20 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ RUN \
# from 'recommended packages', solves a few warnings
thunar-archive-plugin \
librsvg2-common \
notification-daemon \
python3-xdg \
# dark theme
hsetroot \
gnome-themes-extra \
# desktop notifications
xfce4-notifyd \
libnotify-bin \
notification-daemon \
xclip \
# other
wget \
socat \
Expand All @@ -42,6 +47,14 @@ RUN \
docker-compose-plugin \
fonts-noto-color-emoji \
fonts-noto-core \
intel-media-va-driver \
mesa-va-drivers \
xserver-xorg-video-amdgpu \
xserver-xorg-video-ati \
xserver-xorg-video-intel \
xserver-xorg-video-nouveau \
xserver-xorg-video-qxl \
xserver-xorg-video-radeon \
perl \
locales-all && \
# remove left-over locales and generate default
Expand Down Expand Up @@ -75,9 +88,9 @@ RUN \
mkdir -p /usr/share/desktop-directories/ && \
# Download and install Sparrow (todo: gpg sig verification)
wget --quiet https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow_${SPARROW_DEBVERSION}_${PLATFORM}.deb \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt.asc \
https://keybase.io/craigraw/pgp_keys.asc && \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt.asc \
https://keybase.io/craigraw/pgp_keys.asc && \
# verify pgp and sha signatures
gpg --import pgp_keys.asc && \
gpg --status-fd 1 --verify sparrow-${SPARROW_VERSION}-manifest.txt.asc | grep -q "GOODSIG ${SPARROW_PGP_SIG} Craig Raw <[email protected]>" || exit 1 && \
Expand Down Expand Up @@ -116,7 +129,9 @@ ENV \
NVIDIA_DRIVER_CAPABILITIES=all \
# set dark theme
GTK_THEME=Adwaita:dark \
GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc
GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc \
# prevent kasm from touching our rc.xml
NO_FULL=1

# add local files
COPY /root /
Expand All @@ -127,5 +142,3 @@ COPY --chmod=664 icon.png /kclient/public/favicon.ico
# ports and volumes
EXPOSE 3000
VOLUME /config

ENTRYPOINT ["/init"]
27 changes: 20 additions & 7 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ RUN \
# from 'recommended packages', solves a few warnings
thunar-archive-plugin \
librsvg2-common \
notification-daemon \
python3-xdg \
# dark theme
hsetroot \
gnome-themes-extra \
# desktop notifications
xfce4-notifyd \
libnotify-bin \
notification-daemon \
xclip \
# other
wget \
socat \
Expand All @@ -42,6 +47,14 @@ RUN \
docker-compose-plugin \
fonts-noto-color-emoji \
fonts-noto-core \
intel-media-va-driver \
mesa-va-drivers \
xserver-xorg-video-amdgpu \
xserver-xorg-video-ati \
xserver-xorg-video-intel \
xserver-xorg-video-nouveau \
xserver-xorg-video-qxl \
xserver-xorg-video-radeon \
perl \
locales-all && \
# remove left-over locales and generate default
Expand Down Expand Up @@ -75,9 +88,9 @@ RUN \
mkdir -p /usr/share/desktop-directories/ && \
# Download and install Sparrow (todo: gpg sig verification)
wget --quiet https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow_${SPARROW_DEBVERSION}_${PLATFORM}.deb \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt.asc \
https://keybase.io/craigraw/pgp_keys.asc && \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt \
https://github.com/sparrowwallet/sparrow/releases/download/${SPARROW_VERSION}/sparrow-${SPARROW_VERSION}-manifest.txt.asc \
https://keybase.io/craigraw/pgp_keys.asc && \
# verify pgp and sha signatures
gpg --import pgp_keys.asc && \
gpg --status-fd 1 --verify sparrow-${SPARROW_VERSION}-manifest.txt.asc | grep -q "GOODSIG ${SPARROW_PGP_SIG} Craig Raw <[email protected]>" || exit 1 && \
Expand Down Expand Up @@ -116,7 +129,9 @@ ENV \
NVIDIA_DRIVER_CAPABILITIES=all \
# set dark theme
GTK_THEME=Adwaita:dark \
GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc
GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc \
# prevent kasm from touching our rc.xml
NO_FULL=1

# add local files
COPY /root /
Expand All @@ -127,5 +142,3 @@ COPY --chmod=664 icon.png /kclient/public/favicon.ico
# ports and volumes
EXPOSE 3000
VOLUME /config

ENTRYPOINT ["/init"]
8 changes: 4 additions & 4 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ data:
EOF

# Copy default files
if [ ! -f /config/.config/openbox/rc.xml ]; then
mkdir -p /config/.config/openbox
cp /defaults/rc.xml /config/.config/openbox/rc.xml
chown -R $PUID:$PGID /config/.config/openbox
if [ ! -f /config/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml ]; then
mkdir -p /config/.config/xfce4/xfconf/xfce-perchannel-xml
cp /defaults/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml /config/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
chown -R $PUID:$PGID /config/.config/xfce4
fi

if [ ! -f /config/.sparrow/config ]; then
Expand Down
11 changes: 1 addition & 10 deletions root/defaults/autostart
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
# default file copies first run
if [ ! -f $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml ]; then
mkdir -p $HOME/.config/xfce4/xfconf/xfce-perchannel-xml
cp /defaults/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
fi

# open files and directories with thunar (file manager)
xdg-mime default thunar.desktop inode/directory

/opt/sparrow/bin/Sparrow &
/opt/sparrow/bin/Sparrow
9 changes: 9 additions & 0 deletions root/etc/xdg/openbox/autostart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# open files and directories with thunar (file manager)
xdg-mime default thunar.desktop inode/directory

# open URL's with our custom handler
xdg-settings set default-web-browser showurl.desktop
xdg-mime default showurl.desktop x-scheme-handler/http x-scheme-handler/https

# set desktop background color
hsetroot -solid "#181818" 2> /dev/null
File renamed without changes.
3 changes: 2 additions & 1 deletion root/defaults/rc.xml → root/etc/xdg/openbox/rc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,9 @@
<!-- You can specify more than one menu file in here and they are all loaded,
just don't make menu ids clash or, well, it'll be kind of pointless -->
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<!-- system menu files on Debian systems -->
<file>menu.xml</file>
<!-- system menu files on Debian systems -->
<file>/etc/xdg/openbox/menu.xml</file>
<hideDelay>200</hideDelay>
<!-- if a press-release lasts longer than this setting (in milliseconds), the
menu is hidden again -->
Expand Down
8 changes: 8 additions & 0 deletions root/usr/bin/showurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/bash

URL="$1"
RESULT=$(notify-send -i /usr/share/icons/Adwaita/scalable/legacy/web-browser-symbolic.svg "Open URL requested:" "$URL" -A "copy=Copy to clipboard" -A "close=Close" -w)

if [ "$RESULT" == "copy" ]; then
echo $URL | xclip -selection clipboard
fi
5 changes: 5 additions & 0 deletions root/usr/share/applications/showurl.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Desktop Entry]
Type=Application
Name=Show URL
Exec=/usr/bin/showurl %u
StartupNotify=false

0 comments on commit 6fcff83

Please sign in to comment.