From 0b54e2680d76db03bd82fcf65f7f77e04ddd7204 Mon Sep 17 00:00:00 2001 From: chacha Date: Sun, 22 Mar 2026 16:13:01 +0100 Subject: [PATCH] fix menu --- .../fluxbox/retrodebian-menu.section | 4 +-- .../opt/retrodebian/fluxbox/update-menu.sh | 25 +++++++++---------- zzz-config-live.sh | 8 +++--- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/internal/rootfs/opt/retrodebian/fluxbox/retrodebian-menu.section b/internal/rootfs/opt/retrodebian/fluxbox/retrodebian-menu.section index 5e3975b..6c07433 100644 --- a/internal/rootfs/opt/retrodebian/fluxbox/retrodebian-menu.section +++ b/internal/rootfs/opt/retrodebian/fluxbox/retrodebian-menu.section @@ -1,8 +1,8 @@ -[separator] [submenu] (RetroDebian) [submenu] (Resolution) [exec] (640x480) {/opt/retrodebian/bin/set-resolution 640x480} [exec] (800x600) {/opt/retrodebian/bin/set-resolution 800x600} [exec] (1024x768) {/opt/retrodebian/bin/set-resolution 1024x768} [end] -[end] \ No newline at end of file +[end] +[separator] diff --git a/internal/rootfs/opt/retrodebian/fluxbox/update-menu.sh b/internal/rootfs/opt/retrodebian/fluxbox/update-menu.sh index 9ad09ab..09363d3 100644 --- a/internal/rootfs/opt/retrodebian/fluxbox/update-menu.sh +++ b/internal/rootfs/opt/retrodebian/fluxbox/update-menu.sh @@ -11,31 +11,30 @@ mkdir -p "$DST_DIR" TMP="$DST.tmp" sed \ - -e '/(Eterm/d' \ - -e '/(Rxvt-Unicode (Black/d' \ - -e '/(XTerm/d' \ + -e '/(Eterm)/d' \ + -e '/(Rxvt-Unicode (Black))/d' \ + -e '/(XTerm)/d' \ "$SRC" > "$TMP.base" if [ -f "$TEMPLATE" ]; then awk -v template="$TEMPLATE" ' - BEGIN { - inserted = 0 - } - /^\[end\][[:space:]]*$/ && !inserted { - while ((getline line < template) > 0) { - print line + BEGIN { inserted = 0 } + { + print + if (!inserted && $0 ~ /^\[begin\] /) { + while ((getline line < template) > 0) { + print line + } + close(template) + inserted = 1 } - close(template) - inserted = 1 } - { print } ' "$TMP.base" > "$TMP" else mv "$TMP.base" "$TMP" fi rm -f "$TMP.base" - mv "$TMP" "$DST" fluxbox-remote reconfigure >/dev/null 2>&1 || true \ No newline at end of file diff --git a/zzz-config-live.sh b/zzz-config-live.sh index 2ebe068..60efc07 100644 --- a/zzz-config-live.sh +++ b/zzz-config-live.sh @@ -34,10 +34,10 @@ find /etc/skel \( \ # todo: automatic -chmod +xr,o-w /opt/retrodebian/fluxbox/set-resolution.sh -chmod +r,o-w /opt/retrodebian/fluxbox/watch-menu.sh -chmod +r,o-w /opt/retrodebian/fluxbox/update-menu.sh -chmod +r,o-w /etc/init.d/retrodebian-fluxbox-watch-menu +chmod +xr,ug+xrw,o-w /opt/retrodebian/fluxbox/set-resolution.sh +chmod +r,ug+xw,o-w /opt/retrodebian/fluxbox/watch-menu.sh +chmod +r,ug+xw,o-w /opt/retrodebian/fluxbox/update-menu.sh +chmod +r,ug+xw,o-w /etc/init.d/retrodebian-fluxbox-watch-menu update-rc.d retrodebian-fluxbox-watch-menu defaults