From 50f1c4e1024c31c77aa196f7ff4aa4a79d53075d Mon Sep 17 00:00:00 2001 From: Galen Abell Date: Mon, 5 Jul 2021 13:48:19 +0200 Subject: [PATCH] Add context menu for cmus Requires the `set_term_title` in cmus to be set to false, otherwise cmus will set the WM_TITLE to the currently playing song / album, which makes it hard to determine that the current app is cmus. Signed-off-by: Stacy Harper --- scripts/core/sxmo_appmenu.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index eebaaf8..f4bca4c 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -359,6 +359,20 @@ programchoicesinit() { $icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number " WINNAME=sms + elif echo "$WMNAME" | grep -i -w "cmus"; then + # cmus + # requires `:set set_term_title=false` in cmus to match the application + CHOICES=" + $icon_itm Play ^ 0 ^ cmus-remote -p + $icon_pau Pause ^ 0 ^ cmus-remote -u + $icon_stp Stop ^ 0 ^ cmus-remote -s + $icon_nxt Next track ^ 0 ^ cmus-remote -n + $icon_prv Previous track ^ 0 ^ cmus-remote -r + $icon_rld Toggle repeat ^ 0 ^ cmus-remote -R + $icon_sfl Toggle random ^ 0 ^ cmus-remote -S + $icon_mnu St menu ^ 0 ^ sxmo_appmenu.sh st-256color + " + WINNAME=cmus else STSELMODEON="$( echo "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '