commit 554fc9879d440de1a371c33f6daf6e2ef10fb170 Author: Sebastian Serfling Date: Tue Sep 23 14:52:55 2025 +0200 First Upload diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b60f7ac --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +PREFIX ?= $(HOME)/.config/systemd/user +BIN ?= $(HOME)/eww-icons/bin/update-eww.sh +ICONDIR = $(HOME)/eww-icons/icons + +.PHONY: all install enable update uninstall icons dev + +all: install + +install: icons + @echo ">>> Installiere systemd Units..." + mkdir -p $(PREFIX) + systemctl --user link $(HOME)/eww-icons/systemd/*.service + systemctl --user link $(HOME)/eww-icons/systemd/*.timer + systemctl --user link $(HOME)/eww-icons/systemd/*.path + systemctl --user daemon-reload + $(MAKE) enable + +enable: + @echo ">>> Aktiviere Timer & Watcher..." + systemctl --user enable --now eww-update.timer remmina-watch.path + +update: + @echo ">>> Update eww-Konfig..." + $(BIN) + +uninstall: + @echo ">>> Deaktiviere Dienste..." + systemctl --user disable --now eww-update.timer remmina-watch.path || true + @echo ">>> Entferne Links..." + for unit in $(HOME)/eww-icons/systemd/*; do \ + systemctl --user disable --now $$unit || true; \ + rm -f $(PREFIX)/$$(basename $$unit); \ + done + systemctl --user daemon-reload + +icons: + @echo ">>> Erstelle Dummy-Icons (falls nicht vorhanden)..." + mkdir -p $(ICONDIR) + if [ ! -f $(ICONDIR)/remmina.png ]; then \ + convert -size 64x64 xc:lightblue -gravity center -pointsize 20 -annotate 0 "R" $(ICONDIR)/remmina.png; \ + fi + if [ ! -f $(ICONDIR)/help.png ]; then \ + convert -size 64x64 xc:lightgreen -gravity center -pointsize 20 -annotate 0 "S" $(ICONDIR)/help.png; \ + fi + if [ ! -f $(ICONDIR)/reboot.png ]; then \ + convert -size 64x64 xc:tomato -gravity center -pointsize 20 -annotate 0 "⟳" $(ICONDIR)/reboot.png; \ + fi + +dev: + @echo ">>> Starte eww-Dock für Tests..." + eww close desktop-icons || true + eww open desktop-icons diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bin/update-eww.sh b/bin/update-eww.sh new file mode 100755 index 0000000..b9bdb07 --- /dev/null +++ b/bin/update-eww.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +cd ~/eww-icons || exit 1 + +# Config aktualisieren +git pull --rebase --autostash + +# Link setzen, damit eww sie nutzt +rm -rf ~/.config/eww +ln -s ~/eww-icons ~/.config/eww diff --git a/desktop-icons.yuck b/desktop-icons.yuck new file mode 100644 index 0000000..9ed08cf --- /dev/null +++ b/desktop-icons.yuck @@ -0,0 +1,32 @@ +(defwindow desktop-icons + :geometry (geometry + :x "50%" + :y "50%" + :anchor "top left" + :width "400px" + :height "120px") + :stacking "fg" ;; oder "bg", je nach Geschmack + (box + :orientation "h" + :halign "center" + :spacing 40 + + (button + :class "icon-btn" + :tooltip "Remmina" + :onclick "remmina" + (image :path "~/.config/eww/icons/remmina.png" :width 64 :height 64)) + + (button + :class "icon-btn" + :tooltip "Support (coming soon)" + :onclick "notify-send 'Support kommt später...'" + (image :path "~/.config/eww/icons/help.png" :width 64 :height 64)) + + (button + :class "icon-btn" + :tooltip "Reboot" + :onclick "systemctl reboot" + (image :path "~/.config/eww/icons/reboot.png" :width 64 :height 64)) + ) +) diff --git a/eww.scss b/eww.scss new file mode 100644 index 0000000..bcb6f5c --- /dev/null +++ b/eww.scss @@ -0,0 +1,11 @@ +.icon-btn { + background: transparent; + border: none; + padding: 10px; + transition: all 0.2s ease; +} + +.icon-btn:hover { + background: rgba(255, 255, 255, 0.15); + border-radius: 20px; +} diff --git a/eww.yuck b/eww.yuck new file mode 100644 index 0000000..f23c08c --- /dev/null +++ b/eww.yuck @@ -0,0 +1,4 @@ +;; Hauptkonfig für Eww +;; Lädt die Desktop-Icons + +(include "desktop-icons.yuck") diff --git a/icons/help.png b/icons/help.png new file mode 100644 index 0000000..a0ac38c Binary files /dev/null and b/icons/help.png differ diff --git a/icons/reboot.png b/icons/reboot.png new file mode 100644 index 0000000..bd79d04 Binary files /dev/null and b/icons/reboot.png differ diff --git a/icons/remmina.png b/icons/remmina.png new file mode 100644 index 0000000..93df788 Binary files /dev/null and b/icons/remmina.png differ diff --git a/systemd/eww-icons.service b/systemd/eww-icons.service new file mode 100644 index 0000000..dbaa592 --- /dev/null +++ b/systemd/eww-icons.service @@ -0,0 +1,9 @@ +[Unit] +Description=Eww Dock mit Icons +After=graphical.target + +[Service] +Type=simple +ExecStart=/usr/bin/eww open desktop-icons +ExecStop=/usr/bin/eww close desktop-icons +Restart=on-failure diff --git a/systemd/eww-update.service b/systemd/eww-update.service new file mode 100644 index 0000000..ecdd9a0 --- /dev/null +++ b/systemd/eww-update.service @@ -0,0 +1,8 @@ +[Unit] +Description=Update eww config from git +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +ExecStart=%h/eww-icons/bin/update-eww.sh diff --git a/systemd/eww-update.timer b/systemd/eww-update.timer new file mode 100644 index 0000000..eb62d93 --- /dev/null +++ b/systemd/eww-update.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run eww-update at boot and daily + +[Timer] +OnBootSec=30s +OnUnitActiveSec=1d + +[Install] +WantedBy=timers.target diff --git a/systemd/remmina-watch.path b/systemd/remmina-watch.path new file mode 100644 index 0000000..9060a79 --- /dev/null +++ b/systemd/remmina-watch.path @@ -0,0 +1,9 @@ +[Unit] +Description=Watch for remmina process changes + +[Path] +PathChanged=/proc +Unit=remmina-watch.service + +[Install] +WantedBy=default.target diff --git a/systemd/remmina-watch.service b/systemd/remmina-watch.service new file mode 100644 index 0000000..c84912c --- /dev/null +++ b/systemd/remmina-watch.service @@ -0,0 +1,12 @@ +[Unit] +Description=Check if remmina is running + +[Service] +Type=oneshot +ExecStart=/bin/bash -c ' +if pgrep -x remmina >/dev/null; then + systemctl --user stop eww-icons.service +else + systemctl --user start eww-icons.service +fi +'