git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit51edba767891b55979c8c27e56e50a5e0626f43f
parentd3d2687b31
authorLucas Galante <[email protected]>
date2026-08-26 20:58
desktop menu: resolve the Terminal entry like the launcher

The context menu's Terminal button hardcoded foot, so it ignored the
default-terminal setting (config.kdl `default_terminal`, the settings
app's Default Apps pick, honored by cce-cloud since 5877564). Resolve
the same chain: $TERMINAL (session env, exported by startcce) →
config.kdl → foot fallback, each validated on PATH.

Co-Authored-By: Claude Fable 5 <[email protected]>

 scripts/cce-desktop-menu | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/cce-desktop-menu b/scripts/cce-desktop-menu
index bd25887..468f70c 100644
--- a/scripts/cce-desktop-menu
+++ b/scripts/cce-desktop-menu
@@ -54,8 +54,17 @@ btn=$(echo "$selected" | python3 -c "import sys, json; print(json.load(sys.stdin
 
 case "$btn" in
     "terminal")
-        # Run terminal
-        foot &
+        # The DE's default terminal, resolved like the launcher: $TERMINAL
+        # (session env, exported by startcce) → config.kdl `default_terminal`
+        # (the settings app's Default Apps pick) → foot.
+        term="$TERMINAL"
+        if [[ -z "$term" ]] || ! command -v "$term" >/dev/null 2>&1; then
+            term=$(sed -n 's/^[[:space:]]*default_terminal[[:space:]]*"\([^"]*\)".*/\1/p' "$HOME/.config/cce/config.kdl" 2>/dev/null | head -n 1)
+        fi
+        if [[ -z "$term" ]] || ! command -v "$term" >/dev/null 2>&1; then
+            term=foot
+        fi
+        "$term" &
         ;;
     "files")
         # Run files