From 554fc9879d440de1a371c33f6daf6e2ef10fb170 Mon Sep 17 00:00:00 2001 From: Sebastian Serfling Date: Tue, 23 Sep 2025 14:52:55 +0200 Subject: [PATCH] First Upload --- Makefile | 52 ++++++++++++++++++++++++++++++++++ README.md | 0 bin/update-eww.sh | 11 +++++++ desktop-icons.yuck | 32 +++++++++++++++++++++ eww.scss | 11 +++++++ eww.yuck | 4 +++ icons/help.png | Bin 0 -> 973 bytes icons/reboot.png | Bin 0 -> 166 bytes icons/remmina.png | Bin 0 -> 1063 bytes systemd/eww-icons.service | 9 ++++++ systemd/eww-update.service | 8 ++++++ systemd/eww-update.timer | 9 ++++++ systemd/remmina-watch.path | 9 ++++++ systemd/remmina-watch.service | 12 ++++++++ 14 files changed, 157 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100755 bin/update-eww.sh create mode 100644 desktop-icons.yuck create mode 100644 eww.scss create mode 100644 eww.yuck create mode 100644 icons/help.png create mode 100644 icons/reboot.png create mode 100644 icons/remmina.png create mode 100644 systemd/eww-icons.service create mode 100644 systemd/eww-update.service create mode 100644 systemd/eww-update.timer create mode 100644 systemd/remmina-watch.path create mode 100644 systemd/remmina-watch.service 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 0000000000000000000000000000000000000000..a0ac38c1d58ae61f96af2ea5703a055e1d1427fb GIT binary patch literal 973 zcmeAS@N?(olHy`uVBq!ia0vp^4j?SR1SCsmTb%+@3dtTpz6=aiY77hwEes65fIEaktaqI2vSdZXBiQ^xO&xL98Wc$iI(Ta6;eKtd1V^N#FM$=R8!<|AN3c@q< zTiz@Z7f?JMQJCUVA~@+$uQ+e4>P;5$F7YU>n=(0lMf=36kIuPqY?p<3W8!7Kd49I@ zS0CQiegB;Jx%sg@OERZ-FXLosX_EV}|1iS=0|o;g1|DVxGMSH^_$_+gO7>S&AG_gO zF0otOD84rSM9HmbJN=|pm)QkATH*F__6oPk{F~mD`F$JydG#4A`t>Ek#q`Uo_~b~2 z_aA<7zc+}D6k4Et*Rap5yr;lyVVK42YwIc|U3)kG`_Dh0v(NR1U!SvBoBx=5_@<^( z(MZP^SAQo)HVFQ{yF+mI?wcE*=AH8oo&72J^pm+eQ;UL}sysLi9c0wmIGT1i2>2a; zF0@>EQ$$9uPFvhw`Dt?*yBV!y{dM_k6JC@5*^MwsQLGd|7umIkKVYs@Sds z)AA_M>DGJqeBD=7x!Qa7$1UF3uWD*8U6I_>p5$EiqL=;fCWbS@@rIS}=O%4hd1S-g zkVDt!_C9$1W!-Fi2hicDt2l-^SPQwz#lyT39@ESx4_f5mA_ zo1fs?5W(^}T1{~xdSWa$LL%PhXf=5@o=UiMuYBh9ukWN~_Rh9!dCV-n{1Nko)rXHZ z#UDB*JIn0djMT-=X){;Y{oJ}@o`0uHP1g2P|8usVnr2gZZrU5|`#aufi$^3aXPp-G zcJ1?}QBGba!a*)oT+)w$L*$6UR*J|=XFbCLb6 ziMczW5e7W<0yu_uCj75*ZRC7$n#jNN3tJ$eXZp UoYmCZ3Cv*(p00i_>zopr02kPtNdN!< literal 0 HcmV?d00001 diff --git a/icons/reboot.png b/icons/reboot.png new file mode 100644 index 0000000000000000000000000000000000000000..bd79d0411aa51dec63f45dbb65368fe206b01140 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0P3?wHke>@jRDI|LY`7$t6sWC7#v@kII0tz*} zU|=XUU|@Kaz`$TNgMmT3V9u^U8=wSRfKQ0)|77?7|NqbQiR1u^FeZ7syDEaloaXvXgf^~624Fdy{0|R5v(beTZDF#nhKbLh* G2~7Zez$u&n literal 0 HcmV?d00001 diff --git a/icons/remmina.png b/icons/remmina.png new file mode 100644 index 0000000000000000000000000000000000000000..93df788d7e54f469d65a4f28843791f6d1cd07a3 GIT binary patch literal 1063 zcmeAS@N?(olHy`uVBq!ia0vp^4j?SR1SCsmTb%+@3dtTpz6=aiY77hwEes65fIS(H_BtG6z2XU)J|w((LlHN3vJ0H14guc_c*R{j?OJSk{F)!bf`o z*1YlT)e{r_G3kZ#jVmTBC#wRCp5HamS6{w%&(l*nS7utywv}1ZY5Mi$^Mm)FC(4wa zJN$l*{`39ZGGUdLuD$)jEG@jY2g2GJ8xk23Bp4*v7~05VE(02KtR&p)PJH|sP0xU1 z)7M+{vdxY3+vB-6b!F&>eOn%!Vb*_SH0e^X^VeqH#XBcn2+lsV!8$=F*SW_-o!l{l$NVFO2#h>T5%~f5vncWL#|Ubi{g^L zlzB_n%|E@?)Zp31-ZdwMmDD@GJUu5i@5vFlg)+A`N1ghmzg5-z?3+pzg@48uHvgAC z{ElH|{C3ahe5-ett>bIwk^6kZ?V7fqTYqhL?Bl>Uzr9tK-TzrwVw8J{w<^n5LfFBt zcLwiopKO2E8skFAPtQ0W{VRVGv1(2Jib?m(%I|4z&up6)D}0P)!n1O2>pd@W)AvoE ztx);ZFqg4(dHhG|;4C|v?VGROvVC85{9)5<{rfysWxf)hB|prI`|Eo$HRx*fzMplA z4_dg38EO2zxi};AMt#r1AA2jWZ0+m1R{m`5wV2udnQhx+<&JI8iZETn`QoN&q7TE% zv-|JYzY<$j@hEYV0|%$dHka-Rxj}p1R^Su{aAx) z#>eiWm`H{0chA2++b#ZEuj9yvD{ADEeXXz6l8 zg@!dN?AI-?2wZX{UZZr&mj{*q!tQJHaK-mbyl}hpl-Ifnma2Qbi4F~nTaO;Uc_ z0+zXoatkXbv(Ddq{8v@h>}=_|3zo;}vw?z=(|XU2<35vo;-#c#mPg6O*Y+4_)EHJ( zDt1*p`y9e)`?V_f6@xM7{m|gWMOjyJZXCaOXzuo+kAcU-IZrbizubRMB|K~L>Xkp| z?c8Qr{lYjxntQ%*+t!uu8`d%~GaP0(V8CF&!@xr_^B==~WsPLE8`6!yyvyL}>gTe~ HDWM4fZfnzc literal 0 HcmV?d00001 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 +'