As per ticket: #573, I have started doing some of the ground work before
we migrate over. This adds a new directory called menus.
This replaces sxmo_hook_contextmenu.sh with sxmo_menu_*.sh and all folders
underneath are added to the $PATH via sxmo_init.sh.
Then to add a new menu you add the check in sxmo_menu_main.sh and the following
menu in {name}/sxmo_menu_{name}.sh
Signed-off-by: hazardchem <pthom44@live.com.au>
---
v2 - Followed advice from Eolien and simplified the directory structure and made
main menu not hard coded and will dynamically work for future sxmo_menu_{}.sh scripts
v3 - Fixed Makefile, docs, and removed sxmo_hook_contextmenu.sh + fallback.
Installs correctly with make install with this patches modifications.
v4 - Fixed sxmo_migrate.sh to handle menus as well as hooks. Fixed mistake in
docs file, and made room for configversion on main, fallback, and apps.
Makefile | 3 +
.../default_hooks/sxmo_hook_contextmenu.sh | 682 ------------------
.../menus/graphical/sxmo_menu_alacritty.sh | 25 +
configs/menus/graphical/sxmo_menu_falkon.sh | 28 +
configs/menus/graphical/sxmo_menu_feh.sh | 28 +
configs/menus/graphical/sxmo_menu_firefox.sh | 28 +
configs/menus/graphical/sxmo_menu_foxtrot.sh | 21 +
configs/menus/graphical/sxmo_menu_geopard.sh | 28 +
configs/menus/graphical/sxmo_menu_imv.sh | 24 +
configs/menus/graphical/sxmo_menu_kasts.sh | 19 +
configs/menus/graphical/sxmo_menu_lagrange.sh | 26 +
configs/menus/graphical/sxmo_menu_mepo.sh | 22 +
configs/menus/graphical/sxmo_menu_netsurf.sh | 22 +
configs/menus/graphical/sxmo_menu_okular.sh | 26 +
configs/menus/graphical/sxmo_menu_surf.sh | 30 +
configs/menus/graphical/sxmo_menu_sxiv.sh | 26 +
configs/menus/graphical/sxmo_menu_vimb.sh | 23 +
configs/menus/graphical/sxmo_menu_xournal.sh | 30 +
configs/menus/graphical/sxmo_menu_zathura.sh | 26 +
.../sxmo_menu_fallback.sh} | 1 +
configs/menus/sxmo_menu_main.sh | 86 +++
configs/menus/terminal/sxmo_menu_aerc.sh | 23 +
.../terminal/sxmo_menu_apps.sh} | 1 +
configs/menus/terminal/sxmo_menu_cmus.sh | 25 +
configs/menus/terminal/sxmo_menu_config.sh | 59 ++
configs/menus/terminal/sxmo_menu_foot.sh | 29 +
configs/menus/terminal/sxmo_menu_git.sh | 20 +
configs/menus/terminal/sxmo_menu_less.sh | 25 +
configs/menus/terminal/sxmo_menu_micro.sh | 30 +
configs/menus/terminal/sxmo_menu_modem.sh | 28 +
configs/menus/terminal/sxmo_menu_mpv.sh | 28 +
configs/menus/terminal/sxmo_menu_nano.sh | 27 +
configs/menus/terminal/sxmo_menu_ncmpcpp.sh | 28 +
configs/menus/terminal/sxmo_menu_phone.sh | 32 +
configs/menus/terminal/sxmo_menu_power.sh | 25 +
configs/menus/terminal/sxmo_menu_scripts.sh | 45 ++
configs/menus/terminal/sxmo_menu_senpai.sh | 23 +
configs/menus/terminal/sxmo_menu_st.sh | 33 +
configs/menus/terminal/sxmo_menu_sthotkeys.sh | 26 +
configs/menus/terminal/sxmo_menu_sys.sh | 41 ++
configs/menus/terminal/sxmo_menu_terminal.sh | 1 +
configs/menus/terminal/sxmo_menu_tuir.sh | 30 +
configs/menus/terminal/sxmo_menu_vim.sh | 31 +
configs/menus/terminal/sxmo_menu_w3m.sh | 28 +
configs/menus/terminal/sxmo_menu_weechat.sh | 24 +
configs/profile.d/sxmo_init.sh | 6 +
docs/sxmo.7.scd | 4 +
scripts/core/sxmo_appmenu.sh | 4 +-
scripts/core/sxmo_migrate.sh | 24 +-
49 files changed, 1215 insertions(+), 689 deletions(-)
delete mode 100755 configs/default_hooks/sxmo_hook_contextmenu.sh
create mode 100755 configs/menus/graphical/sxmo_menu_alacritty.sh
create mode 100755 configs/menus/graphical/sxmo_menu_falkon.sh
create mode 100755 configs/menus/graphical/sxmo_menu_feh.sh
create mode 100755 configs/menus/graphical/sxmo_menu_firefox.sh
create mode 100755 configs/menus/graphical/sxmo_menu_foxtrot.sh
create mode 100755 configs/menus/graphical/sxmo_menu_geopard.sh
create mode 100755 configs/menus/graphical/sxmo_menu_imv.sh
create mode 100755 configs/menus/graphical/sxmo_menu_kasts.sh
create mode 100755 configs/menus/graphical/sxmo_menu_lagrange.sh
create mode 100755 configs/menus/graphical/sxmo_menu_mepo.sh
create mode 100755 configs/menus/graphical/sxmo_menu_netsurf.sh
create mode 100755 configs/menus/graphical/sxmo_menu_okular.sh
create mode 100755 configs/menus/graphical/sxmo_menu_surf.sh
create mode 100755 configs/menus/graphical/sxmo_menu_sxiv.sh
create mode 100755 configs/menus/graphical/sxmo_menu_vimb.sh
create mode 100755 configs/menus/graphical/sxmo_menu_xournal.sh
create mode 100755 configs/menus/graphical/sxmo_menu_zathura.sh
rename configs/{default_hooks/sxmo_hook_contextmenu_fallback.sh => menus/sxmo_menu_fallback.sh} (99%)
create mode 100755 configs/menus/sxmo_menu_main.sh
create mode 100755 configs/menus/terminal/sxmo_menu_aerc.sh
rename configs/{default_hooks/sxmo_hook_apps.sh => menus/terminal/sxmo_menu_apps.sh} (99%)
create mode 100755 configs/menus/terminal/sxmo_menu_cmus.sh
create mode 100755 configs/menus/terminal/sxmo_menu_config.sh
create mode 100755 configs/menus/terminal/sxmo_menu_foot.sh
create mode 100755 configs/menus/terminal/sxmo_menu_git.sh
create mode 100755 configs/menus/terminal/sxmo_menu_less.sh
create mode 100755 configs/menus/terminal/sxmo_menu_micro.sh
create mode 100755 configs/menus/terminal/sxmo_menu_modem.sh
create mode 100755 configs/menus/terminal/sxmo_menu_mpv.sh
create mode 100755 configs/menus/terminal/sxmo_menu_nano.sh
create mode 100755 configs/menus/terminal/sxmo_menu_ncmpcpp.sh
create mode 100755 configs/menus/terminal/sxmo_menu_phone.sh
create mode 100755 configs/menus/terminal/sxmo_menu_power.sh
create mode 100755 configs/menus/terminal/sxmo_menu_scripts.sh
create mode 100755 configs/menus/terminal/sxmo_menu_senpai.sh
create mode 100755 configs/menus/terminal/sxmo_menu_st.sh
create mode 100755 configs/menus/terminal/sxmo_menu_sthotkeys.sh
create mode 100755 configs/menus/terminal/sxmo_menu_sys.sh
create mode 100755 configs/menus/terminal/sxmo_menu_terminal.sh
create mode 100755 configs/menus/terminal/sxmo_menu_tuir.sh
create mode 100755 configs/menus/terminal/sxmo_menu_vim.sh
create mode 100755 configs/menus/terminal/sxmo_menu_w3m.sh
create mode 100755 configs/menus/terminal/sxmo_menu_weechat.sh
diff --git a/Makefile b/Makefile
index 0eba191..9c17bdb 100644
--- a/Makefile
+++ b/Makefile
@@ -51,8 +51,11 @@ install-scripts: $(PROGRAMS)
cd configs && find . -type f -not -name sxmo-setpermissions -exec install -D -m 0644 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
rm -rf "$(DESTDIR)$(PREFIX)/share/sxmo/default_hooks/"
+ rm -rf "$(DESTDIR)$(PREFIX)/share/sxmo/menus/"
cd configs && find default_hooks -type f -exec install -D -m 0755 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
cd configs && find default_hooks -type l -exec cp -R "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
+ cd configs && find menus -type f -exec install -D -m 0755 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
+ cd configs && find menus -type l -exec cp -R "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
[ -n "$(GITVERSION)" ] && echo "$(GITVERSION)" > "$(DESTDIR)$(PREFIX)/share/sxmo/version" || echo "$(VERSION)" > "$(DESTDIR)$(PREFIX)/share/sxmo/version"
diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh
deleted file mode 100755
index 2ee8ab5..0000000
--- a/configs/default_hooks/sxmo_hook_contextmenu.sh
@@ -1,682 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: AGPL-3.0-only
-# Copyright 2022 Sxmo Contributors
-
-# This script will output the content of the contextual menu
-# It should stdout the title as the first line followed by the entries
-
-# include common definitions
-# shellcheck source=scripts/core/sxmo_common.sh
-. sxmo_common.sh
-# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
-. sxmo_hook_icons.sh
-
-XPROPOUT="$(sxmo_wm.sh focusedwindow)"
-WMCLASS="${1:-$(printf %s "$XPROPOUT" | grep app: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
-
-superd_service_isrunning() {
- superctl status "$1" | grep -q started
-}
-
-sxmo_service_isrunning() {
- sxmo_daemons.sh running "$1" > /dev/null
-}
-
-if [ -z "$XPROPOUT" ]; then
- sxmo_log "detected no active window, no problem, opening system menu"
-else
- sxmo_log "opening menu for wmclass $WMCLASS"
-fi
-
-case "$WMCLASS" in
- scripts)
- # Scripts menu
- CHOICES="$(sxmo_hook_scripts.sh)"
- WINNAME=Scripts
- ;;
- applications)
- # Apps menu
- CHOICES="$(sxmo_hook_apps.sh)"
- WINNAME=Apps
- ;;
- modem)
- # modem related
- CHOICES="
- $icon_plk Modem PIN ^ 0 ^ sxmo_unlocksim.sh
- $icon_phn Modem Monitor $(
- superd_service_isrunning sxmo_modemmonitor &&
- printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
- printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
- ) && sxmo_hook_statusbar.sh modem_monitor
- $icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem
- $icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh
- $icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh
- $icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh
- $icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh
- "
- WINNAME=Modem
- ;;
- config)
- # System Control menu
- CHOICES="
- $icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up
- $icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down
- $icon_cfg Touch $(
- sxmo_wm.sh inputevent touchscreen | grep -q on && \
- printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
- printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
- )
- $icon_cfg Stylus $(
- sxmo_wm.sh inputevent stylus | grep -q on && \
- printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
- printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
- )
- $icon_cfg Gestures $(
- superd_service_isrunning "sxmo_hook_lisgd" &&
- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd'
- $icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
- $icon_bth Bluetooth $(
- rfkill list bluetooth | grep -q "yes" &&
- printf %b "$icon_tof" || printf %b "$icon_ton";
- printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
- )
- $(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
- $icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh
- $icon_zzz Auto-suspend $(
- [ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
- ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.nosuspend || touch $XDG_CACHE_HOME/sxmo/sxmo.nosuspend)
- $icon_zzz Auto-screen-off $(
- [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
- ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_hook_unlock.sh
- $icon_ror Autorotate $(
- sxmo_daemons.sh running autorotate -q &&
- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh
- $icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate
- $icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh
- $icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh
- $icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh
- $icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/$(test "$SXMO_WM" = sway && printf sway || printf xinit)
- $(command -v pmos-tweaks >/dev/null && echo "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
- $icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_wakelock.sh debug watch
- $icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block
- "
- WINNAME=Config
- ;;
- power)
- # Power menu
- CHOICES="
- $icon_lck Lock ^ 0 ^ sxmo_hook_lock.sh
- $icon_lck Lock (Screen off) ^ 0 ^ sxmo_hook_screenoff.sh
- $icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout
- $([ -f "$(xdg_data_path xsessions/sxmo.desktop)" ] &&
- [ -f "$(xdg_data_path wayland-sessions/swmo.desktop)" ] &&
- echo "$icon_rol Toggle WM ^ 0 ^ confirm Toggle && sxmo_power.sh togglewm"
- )
- $icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
- $icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
- "
- WINNAME=Power
- ;;
- *mpv*)
- # MPV
- CHOICES="
- $icon_pau Pause ^ 0 ^ sxmo_type -k Space
- $icon_fbw Seek ^ 1 ^ sxmo_type -k Left
- $icon_ffw Seek ^ 1 ^ sxmo_type -k Right
- $icon_aru App Volume Up ^ 1 ^ sxmo_type 0
- $icon_ard App Volume Down ^ 1 ^ sxmo_type 9
- $icon_aru Speed up ^ 1 ^ sxmo_type -k bracketRight
- $icon_ard Speed down ^ 1 ^ sxmo_type -k bracketLeft
- $icon_cam Screenshot ^ 1 ^ sxmo_type s
- $icon_itm Loopmark ^ 1 ^ sxmo_type l
- $icon_inf Info ^ 1 ^ sxmo_type i
- $icon_inf Seek Info ^ 1 ^ sxmo_type o
- "
- WINNAME=Mpv
- ;;
- *feh*)
- # Feh
- CHOICES="
- $icon_arr Next ^ 1 ^ sxmo_type -k Space
- $icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k up
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k down
- $icon_exp Zoom to fit ^ 1 ^ sxmo_type -k slash
- $icon_shr Zoom to fill ^ 1 ^ sxmo_type '!'
- $icon_rol Rotate ^ 1 ^ sxmo_type -k less
- $icon_ror Rotate ^ 1 ^ sxmo_type -k greater
- $icon_a2y Flip ^ 1 ^ sxmo_type -k underscore
- $icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
- $icon_inf Toggle filename ^ 1 ^ sxmo_type d
- "
- WINNAME=Feh
- ;;
- *sxiv*)
- # Sxiv
- CHOICES="
- $icon_arr Next ^ 1 ^ sxmo_type -k Space
- $icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k equal
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
- $icon_rol Rotate ^ 1 ^ sxmo_type -k less
- $icon_ror Rotate ^ 1 ^ sxmo_type -k greater
- $icon_a2y Flip ^ 1 ^ sxmo_type -k question
- $icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
- $icon_grd Thumbnail ^ 0 ^ sxmo_type -k Return
- "
- WINNAME=Sxiv
- ;;
- *imv*)
- # imv
- CHOICES="
- $icon_arr Next ^ 1 ^ sxmo_type -k Right
- $icon_arl Previous ^ 1 ^ sxmo_type -k Left
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k i
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
- $icon_exp Zoom to fit ^ 1 ^ sxmo_type -k r
- $icon_ror Rotate ^ 1 ^ sxmo_type -M ctrl r
- $icon_inf Toggle filename ^ 1 ^ sxmo_type -k d
- "
- WINNAME=Imv
- ;;
- *kasts*)
- CHOICES="
- $icon_mus Audio ^ 0 ^ sxmo_audio.sh
- $icon_bth Bluetooth ^ 0 ^ sxmo_bluetoothmenu.sh
- "
- WINNAME="Kasts"
- ;;
- *sthotkeys*)
- # St hotkeys
- CHOICES="
- Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c
- Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z
- Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l
- Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d
- Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a
- Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b
- Send ESC:w ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k Return
- Send ESC:wq ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k q -k Return
- Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k q -k exclam -k Return
- "
- WINNAME=St
- ;;
- *foot*|*st*|*terminal*|org.gnome.vte.application|*alacritty*)
- # First we try to handle the app running inside the terminal:
- WMNAME="${1:-$(printf %s "$XPROPOUT" | grep title: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
- if printf %s "$WMNAME" | grep -qi -E -w "(vi|vim|vis|nvim|neovim|kakoune)"; then
- #Vim in foot
- CHOICES="
- $icon_cls Save and Quit ^ 0 ^ sxmo_type -k Escape -s 300 ':wq' -k Return
- $icon_sav Save ^ 0 ^ sxmo_type -k Escape -s 300 ':w' -k Return
- $icon_cls Quit without saving ^ 0 ^ sxmo_type -k Escape -s 300 ':q!' -k Return
- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl u
- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl d
- $icon_trm Command prompt ^ 0 ^ sxmo_type -k Escape -s 300 ':'
- $icon_pst Paste Selection ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k asterisk -k p
- $icon_pst Paste Clipboard ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k plus -k p
- $icon_fnd Search ^ 0 ^ sxmo_type -k Escape -s 300 /
- $icon_arr Next buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bn' -k Return
- $icon_arl Previous buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bp' -k Return
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=Vim
- elif printf %s "$WMNAME" | grep -qi -w "nano"; then
- #Nano in foot
- CHOICES="
- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
- $icon_sav Save ^ 0 ^ sxmo_type -M Ctrl o
- $icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl x
- $icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl u
- $icon_itm Type complete ^ 0 ^ sxmo_type -M Shift -M Ctrl u
- $icon_cpy Copy complete ^ 0 ^ sxmo_type -M Shift -M Ctrl i
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=Nano
- elif printf %s "$WMNAME" | grep -qi -w "micro"; then
- #Micro
- CHOICES="
- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
- $icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt
- $icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt
- $icon_sav Save ^ 1 ^ sxmo_type -M Ctrl s -m Ctrl
- $icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl q -m Ctrl
- $icon_fnd Find ^ 0 ^ sxmo_type -M Ctrl f -m Ctrl
- $icon_fnd Find Previous ^ 1 ^ sxmo_type -M Ctrl p -m Ctrl
- $icon_fnd Find Next ^ 1 ^ sxmo_type -M Ctrl n -m Ctrl
- $icon_trm Command Bar ^ 0 ^ sxmo_type -M Ctrl e -m Ctrl
- $icon_cpy Copy ^ 0 ^ sxmo_type -M Ctrl c -m Ctrl
- $icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v -m Ctrl
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=Micro
- elif printf %s "$WMNAME" | grep -qi -w "tuir"; then
- #tuir (reddit client) in foot
- CHOICES="
- $icon_aru Previous ^ 1 ^ sxmo_type k
- $icon_ard Next ^ 1 ^ sxmo_type j
- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
- $icon_ret Open ^ 0 ^ sxmo_type o
- $icon_arl Back ^ 0 ^ sxmo_type h
- $icon_arr Comments ^ 0 ^ sxmo_type l
- $icon_edt Post ^ 0 ^ sxmo_type c
- $icon_rld Refresh ^ 0 ^ sxmo_type r
- $icon_cls Quit ^ 0 ^ sxmo_type q
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=tuir
- elif printf %s "$WMNAME" | grep -qi -w "w3m"; then
- #w3m
- CHOICES="
- $icon_arl Back ^ 1 ^ sxmo_type b
- $icon_glb Goto URL ^ 1 ^ sxmo_type u
- $icon_arr Next Link ^ 1 ^ sxmo_type -k Tab
- $icon_arl Previous Link ^ 1 ^ sxmo_type -M Shift -k Tab
- $icon_tab Open tab ^ 0 ^ sxmo_type t
- $icon_cls Close tab ^ 0 ^ sxmo_type -M Ctrl q
- $icon_itm Next tab ^ 1 ^ sxmo_type -k braceRight
- $icon_itm Previous tab ^ 1 ^ sxmo_type -k braceLeft
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=w3m
- elif printf %s "$WMNAME" | grep -qi -w "ncmpcpp"; then
- #ncmpcpp
- CHOICES="
- $icon_lst Playlist ^ 0 ^ sxmo_type 1
- $icon_fnd Browser ^ 0 ^ sxmo_type 2
- $icon_fnd Search ^ 0 ^ sxmo_type 3
- $icon_nxt Next track ^ 0 ^ sxmo_type -k greater
- $icon_prv Previous track ^ 0 ^ sxmo_type -k less
- $icon_pau Pause ^ 0 ^ sxmo_type p
- $icon_stp Stop ^ 0 ^ sxmo_type s
- $icon_rld Toggle repeat ^ 0 ^ sxmo_type r
- $icon_sfl Toggle random ^ 0 ^ sxmo_type z
- $icon_itm Toggle consume ^ 0 ^ sxmo_type R
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=ncmpcpp
- elif printf %s "$WMNAME" | grep -qi -w "aerc"; then
- #aerc
- CHOICES="
- $icon_pau Archive ^ 1 ^ sxmo_type ':archive flat' -k Return
- $icon_nxt Next Tab ^ 0 ^ sxmo_type ':next-tab' -k Return
- $icon_prv Previous Tab ^ 0 ^ sxmo_type ':prev-tab' -k Return
- $icon_cls Close Tab ^ 0 ^ sxmo_type ':close' -k Return
- $icon_itm Next Part ^ 1 ^ sxmo_type ':next-part' -k Return
- $icon_trm xdg-open Part ^ 0 ^ sxmo_type ':open' -k Return
- "
- WINNAME=aerc
- elif printf %s "$WMNAME" | grep -qi -E -w "(less|mless)"; then
- #less
- CHOICES="
- $icon_arr Page next ^ 1 ^ sxmo_type ':n' -k Return
- $icon_arl Page previous ^ 1 ^ sxmo_type ':p' -k Return
- $icon_cls Quit ^ 0 ^ sxmo_type q
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=less
- elif printf %s "$WMNAME" | grep -qi -w "git \(blame\|diff\|grep\|help\|log\|stash\|tag\|var\)"; then
- # These git commands only launch the pager.
- exec "$0" "$WMCLASS ${PAGER:-less}"
- elif printf %s "$WMNAME" | grep -qi -w "git \(add\|bugreport\|commit\|merge\|notes\|rebase\|replace\|send-email\|svn\)"; then
- # These git commands only launch the editor.
- exec "$0" "$WMCLASS $EDITOR"
- elif printf %s "$WMNAME" | grep -qi -w "git"; then
- # git am, branch, config, tag (and other commands which launch both).
- CHOICES="
- $icon_fil ${PAGER:-less} menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS ${PAGER:-less}'
- $icon_edt $EDITOR menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS $EDITOR'
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=git
- elif printf %s "$WMNAME" | grep -qi -w "senpai"; then
- CHOICES="
- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
- $icon_ac1 Previous Buffer ^ 1 ^ sxmo_type -M Alt -k Left
- $icon_ac4 Next Buffer ^ 1 ^ sxmo_type -M Alt -k Right
- $icon_lst Toggle Channels ^ 0 ^ sxmo_type -k F7
- $icon_usr Toggle Members ^ 0 ^ sxmo_type -k F8
- "
- WINNAME=senpai
- elif printf %s "$WMNAME" | grep -qi -w "weechat"; then
- #weechat
- CHOICES="
- $icon_msg Hotlist Next ^ 1 ^ sxmo_type -M Alt a
- $icon_arl History Previous ^ 1 ^ sxmo_type -M Alt -k Less
- $icon_arr History Next ^ 1 ^ sxmo_type -M Alt -k Greater
- $icon_trm Buffer ^ 0 ^ sxmo_type '/buffer '
- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=weechat
- elif printf %s "$WMNAME" | grep -qi -w "sms\|missed call"; then
- number="$(printf "%s\n" "$WMNAME" | xargs -0 pnc find | tr -d '\n')"
- #sms
- CHOICES="
- $icon_msg Conversation ^ 0 ^ sxmo_terminal.sh sxmo_modemtext.sh conversationloop $number
- $icon_msg Reply ^ 0 ^ sxmo_modemtext.sh sendtextmenu $number
- $icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number
- $([ -d "$SXMO_LOGDIR/$number/attachments" ] && echo "$icon_att View Attachments ^ 1 ^ sxmo_files.sh $SXMO_LOGDIR/$number/attachments --date-sort")
- $(
-
- found_numbers="$(printf %s "$number" | xargs -I{} pnc find "{}")"
- printf "%s\n" "$found_numbers" | while read -r line; do
- sxmo_contacts.sh --name "$line" | grep -q '???' && echo "$icon_usr Add $line ^ 1 ^ sxmo_contactmenu.sh newcontact $line"
- done
- # if this is a group chain, then allow to add entire chain as a contact too
- if [ "$(printf "%s\n" "$found_numbers" | wc -l)" -gt 1 ]; then
- sxmo_contacts.sh --name "$number" | grep -q '???' && echo "$icon_usr Add $number ^ 1 ^ sxmo_contactmenu.sh newcontact $number"
- fi
-
- )
- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -M Ctrl b
- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -M Ctrl f
- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=phone
- elif printf %s "$WMNAME" | grep -qi -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 Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
- "
- WINNAME=cmus
- else
- # Now we fallback to the default terminal menu
- case "$WMCLASS" in
- *st*)
- STSELMODEON="$(
- printf %s "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '
- )"
- CHOICES="
- $icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u
- $icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i
- $icon_itm Selmode $(
- [ "$STSELMODEON" = 1 ] &&
- printf %b "$icon_ton" ||
- printf %b "$icon_tof"
- printf %b '^ 0 ^ sxmo_type -M Ctrl -M Shift -k s'
- )
- $([ "$STSELMODEON" = 1 ] && echo 'Copy selection ^ 0 ^ sxmo_type -M Ctrl -M Shift -k c')
- $icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl -M Shift -k v
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Prior
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Next
- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b
- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f
- $icon_a2x Invert ^ 1 ^ sxmo_type -M Ctrl -M Shift -k x
- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
- "
- WINNAME=St
- ;;
- *foot*)
- CHOICES="
- $icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
- $icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next
- $icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u
- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
- $icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r
- $icon_aru Search Back ^ 0 ^ sxmo_type -M Ctrl -k r
- $icon_ard Search Forward ^ 0 ^ sxmo_type -M Ctrl -k s
- $icon_itm Search Extend ^ 0 ^ sxmo_type -M Ctrl -k w
- "
- WINNAME=Foot
- ;;
- *terminal*|org.gnome.vte.application)
- CHOICES="$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
- WINNAME=Terminal
- ;;
- *alacritty*)
- CHOICES="
- $icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
- $icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
- $icon_vim VI Mode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k Space
- $icon_fnd Search Forward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k f
- $icon_fnd Search Backward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k b
- $icon_aru Search Previous ^ 0 ^ sxmo_type -k Enter
- $icon_ard Search Next ^ 0 ^ sxmo_type -M Shift -k Enter
- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
- "
- WINNAME=Alacritty
- ;;
- esac
- fi
- ;;
- *okular*)
- # Okular
- CHOICES="
- $icon_cfg Touch $(
- sxmo_wm.sh inputevent touchscreen | grep -q on && \
- printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
- printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
- )
- $icon_cfg Fullscreen ^ 0 ^ sxmo_type -k Ctrl -k Shift -k F
- $icon_cfg Menubar ^ 0 ^ sxmo_type -k Ctrl -k M
- $icon_cfg Toolbars ^ 0 ^ sxmo_type -k F7
- $icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
- "
- WINNAME=Xournal
- ;;
- *xournal*)
- # Xournalpp
- CHOICES="
- $icon_cfg Touch $(
- sxmo_wm.sh inputevent touchscreen | grep -q on && \
- printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
- printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
- )
- $icon_flt Open ^ 0 ^ sxmo_type -k Ctrl -k o
- $icon_zmi Zoom ^ 1 ^ sxmo_type -k Ctrl -k plus
- $icon_zmo Zoom ^ 1 ^ sxmo_type -k Ctrl -k minus
- $icon_zmi Next Page ^ 1 ^ sxmo_type -k Next
- $icon_zmo Prev Page ^ 1 ^ sxmo_type -k Prior
- $icon_cfg Menubar ^ 0 ^ sxmo_type -k F10
- $icon_cfg Toolbars ^ 0 ^ sxmo_type -k F9
- $icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
- "
- WINNAME=Xournal
- ;;
- *zathura*)
- # Zathura
- CHOICES="
- $icon_flt Open ^ 0 ^ sxmo_type -k o
- $icon_zmi Zoom ^ 1 ^ sxmo_type -k plus
- $icon_zmo Zoom ^ 1 ^ sxmo_type -k minus
- $icon_arl History ^ 1 ^ sxmo_type -M Ctrl -k o
- $icon_arr History ^ 1 ^ sxmo_type -M Ctrl -k i
- $icon_cfg Invert ^ 0 ^ sxmo_type -M Ctrl -k r
- $icon_flt Index ^ 0 ^ sxmo_type -k Tab
- $icon_cfg Fit ^ 0 ^ sxmo_type -k a
- $icon_cfg Width mode ^ 0 ^ sxmo_type -k s
- "
- WINNAME=Zathura
- ;;
- *netsurf*)
- # Netsurf
- CHOICES="
- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
- "
- WINNAME=Netsurf
- ;;
- *surf*)
- # Surf
- CHOICES="
- $icon_glb Navigate ^ 0 ^ sxmo_type -M Ctrl g
- $icon_lnk Link Menu ^ 0 ^ sxmo_type -M Ctrl d
- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
- $icon_fnd Search Page ^ 0 ^ sxmo_type -M Ctrl f
- $icon_fnd Find Next ^ 0 ^ sxmo_type -M Ctrl n
- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl k
- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl j
- $icon_aru Scroll ^ 1 ^ sxmo_type -M Shift -k Space
- $icon_ard Scroll ^ 1 ^ sxmo_type -k Space
- $icon_itm JS Toggle ^ 1 ^ sxmo_type -M Shift -M Ctrl s
- $icon_arl History ^ 1 ^ sxmo_type -M Ctrl h
- $icon_arr History ^ 1 ^ sxmo_type -M Ctrl l
- $icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
- "
- WINNAME=Surf
- ;;
- *falkon*)
- # Falkon
- CHOICES="
- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
- $icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
- $icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
- $icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
- $icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
- $icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
- $icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
- "
- WINNAME=Falkon
- ;;
- *firefox*|*navigator*)
- # Firefox
- CHOICES="
- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
- $icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
- $icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
- $icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
- $icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
- $icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
- $icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
- "
- WINNAME=Firefox
- ;;
- *vimb*)
- CHOICES="
- $icon_glb Navigate ^ 0 ^ sxmo_type -k Escape o && sxmo_keyboard.sh open
- $icon_zmi Zoom ^ 1 ^ sxmo_type -k Escape zi
- $icon_zmo Zoom ^ 1 ^ sxmo_type -k Escape zo
- $icon_arl History ^ 1 ^ sxmo_type -M Ctrl o
- $icon_arr History ^ 1 ^ sxmo_type -M Ctrl i
- $icon_rld Refresh ^ 0 ^ sxmo_type -k Escape r
- "
- WINNAME=Vimb
- ;;
- *geopard*)
- # Geopard
- CHOICES="
- $icon_pls New Tab ^ 0 ^ sxmo_type -M Ctrl t
- $icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
- $icon_bok Open Bookmarks ^ 0 ^ sxmo_type -M Ctrl b
- $icon_pls Add Bookmark ^ 0 ^ sxmo_type -M Ctrl d
- $icon_edt Edit Bookmarks ^ 0 ^ sxmo_keyboard.sh open && sxmo_terminal.sh $EDITOR ~/.local/share/geopard/bookmarks.gemini
- $icon_zmi Increase Font Size ^ 1 ^ sxmo_type -M Ctrl -k plus
- $icon_zmo Decrease Font Size ^ 1 ^ sxmo_type -M Ctrl -k minus
- $icon_arl History Back ^ 1 ^ sxmo_type -M Alt -k Left
- $icon_arr History Forward ^ 1 ^ sxmo_type -M Alt -k Right
- $icon_fnd URL Bar ^ 0 ^ sxmo_keyboard.sh open && sxmo_type -k F6
- $icon_rld Refresh ^ 0 ^ sxmo_type -k F6 -k Return
- "
- WINNAME=Geopard
- ;;
- *lagrange*)
- # Lagrange
- CHOICES="
- $icon_mnu Toggle sidebar ^ 0 ^ sxmo_type -M Shift -M Ctrl p
- $icon_bok Open bookmarks ^ 0 ^ sxmo_type -M Ctrl l && sxmo_type 'about:bookmarks' -k Return
- $icon_pls Add bookmark ^ 0 ^ sxmo_type -M Ctrl d
- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k equal
- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
- $icon_aru Parent dir ^ 1 ^ sxmo_type -M Alt -k Up
- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
- $icon_rld Refresh ^ 0 ^ sxmo_type -M Ctrl r
- "
- WINNAME=Lagrange
- ;;
- *mepo*)
- # Mepo
- # The choices / hotkeys for the contextmenu are generated through mepo's
- # own scripting to be in congruence since the same menu can be launched
- # via mepo's UI as well, this compatibility is available as of mepo 0.4
- CHOICES="$(mepo_ui_central_menu.sh menuoptions | awk -F^ '{ print $1 "^ 0 ^ sxmo_type" $3 }')"
- WINNAME=Mepo
- ;;
- *foxtrot*)
- # Foxtrot GPS
- CHOICES="
- $icon_zmi Zoom ^ 1 ^ sxmo_type i
- $icon_zmo Zoom ^ 1 ^ sxmo_type o
- $icon_itm Panel Toggle ^ 1 ^ sxmo_type m
- $icon_itm GPSD Toggle ^ 1 ^ sxmo_type a
- "
- WINNAME=Maps
- ;;
- *)
- # Default system menu (no matches)
- CHOICES="
- $icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
- $icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications
- $icon_grd Binaries ^ 0 ^ sxmo_brun.sh
- $icon_dir Files ^ 0 ^ sxmo_files.sh
- $icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh
- $icon_msg Texts ^ 0 ^ sxmo_modemtext.sh
- $icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh
- $(
- rfkill list bluetooth | grep -q "yes" ||
- printf %b "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
- )
- $(command -v megapixels >/dev/null && echo "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels")
- $(
- if [ -z "$SXMO_DISABLE_LEDS" ]; then
- printf "%s Flashlight " "$icon_fll"
- sxmo_led.sh get white | grep -vq ^100$ &&
- printf %b "$icon_tof" || printf %b "$icon_ton";
- printf %b "^ 1 ^ sxmo_flashtoggle.sh"
- fi
- )
- $icon_net Networks ^ 0 ^ sxmo_networks.sh
- $icon_mus Audio ^ 0 ^ sxmo_audio.sh
- $icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem
- $icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config
- $icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power
- "
- WINNAME=Sys
- ;;
-esac
-
-printf "%b\n" "$WINNAME"
-printf "%b\n" "$CHOICES"
diff --git a/configs/menus/graphical/sxmo_menu_alacritty.sh b/configs/menus/graphical/sxmo_menu_alacritty.sh
new file mode 100755
index 0000000..75c3d38
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c"
+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v"
+write_line "$icon_vim VI Mode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k Space"
+write_line "$icon_fnd Search Forward ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f"
+write_line "$icon_fnd Search Backward ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b"
+write_line "$icon_aru Search Previous ^ 1 ^ sxmo_type -k Enter"
+write_line "$icon_ard Search Next ^ 1 ^ sxmo_type -M Shift -k Enter"
+write_line "$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_falkon.sh b/configs/menus/graphical/sxmo_menu_falkon.sh
new file mode 100755
index 0000000..f023c7a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
+write_line "$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t"
+write_line "$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n"
+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
+write_line "$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home"
+write_line "$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_feh.sh b/configs/menus/graphical/sxmo_menu_feh.sh
new file mode 100755
index 0000000..e1b38f7
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_arr Next ^ 1 ^ sxmo_type -k Space"
+write_line "$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k up"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k down"
+write_line "$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k slash"
+write_line "$icon_shr Zoom to fill ^ 1 ^ sxmo_type '!'"
+write_line "$icon_rol Rotate ^ 1 ^ sxmo_type -k less"
+write_line "$icon_ror Rotate ^ 1 ^ sxmo_type -k greater"
+write_line "$icon_a2y Flip ^ 1 ^ sxmo_type -k underscore"
+write_line "$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar"
+write_line "$icon_inf Toggle filename ^ 1 ^ sxmo_type d"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_firefox.sh b/configs/menus/graphical/sxmo_menu_firefox.sh
new file mode 100755
index 0000000..f023c7a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
+write_line "$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t"
+write_line "$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n"
+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
+write_line "$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home"
+write_line "$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_foxtrot.sh b/configs/menus/graphical/sxmo_menu_foxtrot.sh
new file mode 100755
index 0000000..7465308
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type i"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type o"
+write_line "$icon_itm Panel Toggle ^ 1 ^ sxmo_type m"
+write_line "$icon_itm GPSD Toggle ^ 1 ^ sxmo_type a"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_geopard.sh b/configs/menus/graphical/sxmo_menu_geopard.sh
new file mode 100755
index 0000000..57aee4c
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_pls New Tab ^ 0 ^ sxmo_type -M Ctrl t"
+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w"
+write_line "$icon_bok Open Bookmarks ^ 0 ^ sxmo_type -M Ctrl b"
+write_line "$icon_pls Add Bookmark ^ 0 ^ sxmo_type -M Ctrl d"
+write_line "$icon_edt Edit Bookmarks ^ 0 ^ sxmo_keyboard.sh open && sxmo_terminal.sh $EDITOR ~/.local/share/geopard/bookmarks.gemini"
+write_line "$icon_zmi Increase Font Size ^ 1 ^ sxmo_type -M Ctrl -k plus"
+write_line "$icon_zmo Decrease Font Size ^ 1 ^ sxmo_type -M Ctrl -k minus"
+write_line "$icon_arl History Back ^ 1 ^ sxmo_type -M Alt -k Left"
+write_line "$icon_arr History Forward ^ 1 ^ sxmo_type -M Alt -k Right"
+write_line "$icon_fnd URL Bar ^ 0 ^ sxmo_keyboard.sh open && sxmo_type -k F6"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -k F6 -k Return"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_imv.sh b/configs/menus/graphical/sxmo_menu_imv.sh
new file mode 100755
index 0000000..00ec1cd
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_arr Next ^ 1 ^ sxmo_type -k Right"
+write_line "$icon_arl Previous ^ 1 ^ sxmo_type -k Left"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k i"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus"
+write_line "$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k r"
+write_line "$icon_ror Rotate ^ 1 ^ sxmo_type -M ctrl r"
+write_line "$icon_inf Toggle filename ^ 1 ^ sxmo_type -k d"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_kasts.sh b/configs/menus/graphical/sxmo_menu_kasts.sh
new file mode 100755
index 0000000..beb27f1
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_mus Audio ^ 0 ^ sxmo_audio.sh"
+write_line "$icon_bth Bluetooth ^ 0 ^ sxmo_bluetoothmenu.sh"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_lagrange.sh b/configs/menus/graphical/sxmo_menu_lagrange.sh
new file mode 100755
index 0000000..3ca4154
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_mnu Toggle sidebar ^ 0 ^ sxmo_type -M Shift -M Ctrl p"
+write_line "$icon_bok Open bookmarks ^ 0 ^ sxmo_type -M Ctrl l && sxmo_type 'about:bookmarks' -k Return"
+write_line "$icon_pls Add bookmark ^ 0 ^ sxmo_type -M Ctrl d"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k equal"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
+write_line "$icon_aru Parent dir ^ 1 ^ sxmo_type -M Alt -k Up"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Ctrl r"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_mepo.sh b/configs/menus/graphical/sxmo_menu_mepo.sh
new file mode 100755
index 0000000..bca0760
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+# The choices / hotkeys for the contextmenu are generated through mepo's
+# own scripting to be in congruence since the same menu can be launched
+# via mepo's UI as well, this compatibility is available as of mepo 0.4
+
+write_line "mepo_ui_central_menu.sh menuoptions | awk -F^ '{ print $1 "^ 0 ^ sxmo_type" $3 }')"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_netsurf.sh b/configs/menus/graphical/sxmo_menu_netsurf.sh
new file mode 100755
index 0000000..2eed643
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_okular.sh b/configs/menus/graphical/sxmo_menu_okular.sh
new file mode 100755
index 0000000..785f8a0
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_cfg Touch $(
+ sxmo_wm.sh inputevent touchscreen | grep -q on && \
+ printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
+ printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
+)"
+write_line "$icon_cfg Fullscreen ^ 0 ^ sxmo_type -k Ctrl -k Shift -k F"
+write_line "$icon_cfg Menubar ^ 0 ^ sxmo_type -k Ctrl -k M"
+write_line "$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F7"
+write_line "$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_surf.sh b/configs/menus/graphical/sxmo_menu_surf.sh
new file mode 100755
index 0000000..fd3780c
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_glb Navigate ^ 0 ^ sxmo_type -M Ctrl g"
+write_line "$icon_lnk Link Menu ^ 0 ^ sxmo_type -M Ctrl d"
+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
+write_line "$icon_fnd Search Page ^ 0 ^ sxmo_type -M Ctrl f"
+write_line "$icon_fnd Find Next ^ 0 ^ sxmo_type -M Ctrl n"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl k"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl j"
+write_line "$icon_aru Scroll ^ 1 ^ sxmo_type -M Shift -k Space"
+write_line "$icon_ard Scroll ^ 1 ^ sxmo_type -k Space"
+write_line "$icon_itm JS Toggle ^ 1 ^ sxmo_type -M Shift -M Ctrl s"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Ctrl h"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Ctrl l"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_sxiv.sh b/configs/menus/graphical/sxmo_menu_sxiv.sh
new file mode 100755
index 0000000..174f561
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_arr Next ^ 1 ^ sxmo_type -k Space"
+write_line "$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k equal"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus"
+write_line "$icon_rol Rotate ^ 1 ^ sxmo_type -k less"
+write_line "$icon_ror Rotate ^ 1 ^ sxmo_type -k greater"
+write_line "$icon_a2y Flip ^ 1 ^ sxmo_type -k question"
+write_line "$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar"
+write_line "$icon_grd Thumbnail ^ 0 ^ sxmo_type -k Return"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_vimb.sh b/configs/menus/graphical/sxmo_menu_vimb.sh
new file mode 100755
index 0000000..55ac960
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_glb Navigate ^ 0 ^ sxmo_type -k Escape o && sxmo_keyboard.sh open"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -k Escape zi"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -k Escape zo"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Ctrl o"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Ctrl i"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -k Escape r"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_xournal.sh b/configs/menus/graphical/sxmo_menu_xournal.sh
new file mode 100755
index 0000000..272a265
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_cfg Touch $(
+ sxmo_wm.sh inputevent touchscreen | grep -q on && \
+ printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
+ printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
+)"
+write_line "$icon_flt Open ^ 0 ^ sxmo_type -k Ctrl -k o"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -k Ctrl -k plus"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -k Ctrl -k minus"
+write_line "$icon_zmi Next Page ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_zmo Prev Page ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_cfg Menubar ^ 0 ^ sxmo_type -k F10"
+write_line "$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F9"
+write_line "$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar"
\ No newline at end of file
diff --git a/configs/menus/graphical/sxmo_menu_zathura.sh b/configs/menus/graphical/sxmo_menu_zathura.sh
new file mode 100755
index 0000000..f307777
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_flt Open ^ 0 ^ sxmo_type -k o"
+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -k plus"
+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -k minus"
+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Ctrl -k o"
+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Ctrl -k i"
+write_line "$icon_cfg Invert ^ 0 ^ sxmo_type -M Ctrl -k r"
+write_line "$icon_flt Index ^ 0 ^ sxmo_type -k Tab"
+write_line "$icon_cfg Fit ^ 0 ^ sxmo_type -k a"
+write_line "$icon_cfg Width mode ^ 0 ^ sxmo_type -k s"
\ No newline at end of file
diff --git a/configs/default_hooks/sxmo_hook_contextmenu_fallback.sh b/configs/menus/sxmo_menu_fallback.sh
similarity index 99%
rename from configs/default_hooks/sxmo_hook_contextmenu_fallback.sh
rename to configs/menus/sxmo_menu_fallback.sh
index 0e27649..8742108 100755
--- a/configs/default_hooks/sxmo_hook_contextmenu_fallback.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
diff --git a/configs/menus/sxmo_menu_main.sh b/configs/menus/sxmo_menu_main.sh
new file mode 100755
index 0000000..6a8183d
--- /dev/null
+++ b/configs/menus/sxmo_menu_main.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output the content of the contextual menu
+# It should stdout the title as the first line followed by the entries
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+XPROPOUT="$(sxmo_wm.sh focusedwindow)"
+WMCLASS="${1:-$(printf %s "$XPROPOUT" | grep app: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
+
+superd_service_isrunning() {
+ superctl status "$1" | grep -q started
+}
+
+sxmo_service_isrunning() {
+ sxmo_daemons.sh running "$1" > /dev/null
+}
+
+if [ -z "$XPROPOUT" ]; then
+ sxmo_log "detected no active window, no problem, opening system menu"
+else
+ sxmo_log "opening menu for wmclass $WMCLASS"
+fi
+
+case "$WMCLASS" in
+ *foot*|*st*|*terminal*|org.gnome.vte.application|*alacritty*)
+ # First we try to handle the app running inside the terminal:
+ WMNAME="${1:-$(printf %s "$XPROPOUT" | grep title: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
+ case "$WMNAME" in
+ vi|vim|vis|nvim|neovim|kakoune)
+ printf "%b\n" "Vim"
+ printf "%b\n" "$(sxmo_menu_vim.sh)"
+ ;;
+ 'git blame'|'git diff'|'git grep'|'git help'|'git log'|'git stash'|'git tag'|'git var')
+ # These git commands only launch the pager.
+ exec "$0" "$WMCLASS ${PAGER:-less}"
+ ;;
+ 'git add'|'git bugreport'|'git commit'|'git merge'|'git notes'|'git rebase'|'git replace'|'git send-email'|'git svn')
+ # These git commands only launch the editor.
+ exec "$0" "$WMCLASS $EDITOR"
+ ;;
+ sms|'missed call')
+ number="$(printf "%s\n" "$WMNAME" | xargs -0 pnc find | tr -d '\n')"
+ printf "%b\n" "phone"
+ printf "%b\n" "$(sxmo_menu_phone.sh)"
+ ;;
+ *st*)
+ STSELMODEON="$(
+ printf %s "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '
+ )"
+ printf "%b\n" "St"
+ printf "%b\n" "$(sxmo_menu_st.sh)"
+ ;;
+ *)
+ if [ -z $(command -v sxmo_menu_$(echo $WMNAME | tr '[:upper:]' '[:lower:]').sh) ]; then
+ printf "%b\n" "$(echo $WMCLASS | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')"
+ printf "%b\n" "$(sxmo_menu_$(echo $WMCLASS | tr '[:upper:]' '[:lower:]').sh)"
+ else
+ printf "%b\n" "$(echo $WMNAME | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')"
+ printf "%b\n" "$(sxmo_menu_$WMNAME.sh)"
+ fi
+ ;;
+ esac
+ ;;
+ applications)
+ # Apps Menu
+ printf "%b\n" "Apps"
+ printf "%b\n" "$(sxmo_menu_apps.sh)"
+ ;;
+ *)
+ if [ -z $(command -v sxmo_menu_$(echo $WMCLASS | tr '[:upper:]' '[:lower:]').sh) ]; then
+ printf "%b\n" "Sys"
+ printf "%b\n" "$(sxmo_menu_sys.sh)"
+ else
+ printf "%b\n" "$(echo $WMCLASS | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')"
+ printf "%b\n" "$(sxmo_menu_"$(echo $WMCLASS | tr '[:upper:]' '[:lower:]')".sh)"
+ fi
+ ;;
+esac
diff --git a/configs/menus/terminal/sxmo_menu_aerc.sh b/configs/menus/terminal/sxmo_menu_aerc.sh
new file mode 100755
index 0000000..68fa015
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_pau Archive ^ 1 ^ sxmo_type ':archive flat' -k Return"
+write_line "$icon_nxt Next Tab ^ 0 ^ sxmo_type ':next-tab' -k Return"
+write_line "$icon_prv Previous Tab ^ 0 ^ sxmo_type ':prev-tab' -k Return"
+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type ':close' -k Return"
+write_line "$icon_itm Next Part ^ 1 ^ sxmo_type ':next-part' -k Return"
+write_line "$icon_trm xdg-open Part ^ 0 ^ sxmo_type ':open' -k Return"
\ No newline at end of file
diff --git a/configs/default_hooks/sxmo_hook_apps.sh b/configs/menus/terminal/sxmo_menu_apps.sh
similarity index 99%
rename from configs/default_hooks/sxmo_hook_apps.sh
rename to configs/menus/terminal/sxmo_menu_apps.sh
index ba70a31..950d8b7 100755
--- a/configs/default_hooks/sxmo_hook_apps.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck disable=SC2154
diff --git a/configs/menus/terminal/sxmo_menu_cmus.sh b/configs/menus/terminal/sxmo_menu_cmus.sh
new file mode 100755
index 0000000..db06813
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_itm Play ^ 0 ^ cmus-remote -p"
+write_line "$icon_pau Pause ^ 0 ^ cmus-remote -u"
+write_line "$icon_stp Stop ^ 0 ^ cmus-remote -s"
+write_line "$icon_nxt Next track ^ 0 ^ cmus-remote -n"
+write_line "$icon_prv Previous track ^ 0 ^ cmus-remote -r"
+write_line "$icon_rld Toggle repeat ^ 0 ^ cmus-remote -R"
+write_line "$icon_sfl Toggle random ^ 0 ^ cmus-remote -S"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_config.sh b/configs/menus/terminal/sxmo_menu_config.sh
new file mode 100755
index 0000000..e786484
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up"
+write_line "$icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down"
+write_line "$icon_cfg Touch $(
+ sxmo_wm.sh inputevent touchscreen | grep -q on && \
+ printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
+ printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
+ )"
+write_line "$icon_cfg Stylus $(
+ sxmo_wm.sh inputevent stylus | grep -q on && \
+ printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
+ printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
+ )"
+write_line "$icon_cfg Gestures $(
+ superd_service_isrunning "sxmo_hook_lisgd" &&
+ printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
+ ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd'"
+write_line "$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar"
+write_line "$icon_bth Bluetooth $(
+ rfkill list bluetooth | grep -q "yes" &&
+ printf %b "$icon_tof" || printf %b "$icon_ton";
+ printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
+ )"
+$(test "$SXMO_WM" = dwm && write_line "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
+write_line "$icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh"
+write_line "$icon_zzz Auto-suspend $(
+ [ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
+ ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.nosuspend || touch $XDG_CACHE_HOME/sxmo/sxmo.nosuspend)"
+write_line "$icon_zzz Auto-screen-off $(
+ [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
+ ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_hook_unlock.sh"
+write_line "$icon_ror Autorotate $(
+ sxmo_daemons.sh running autorotate -q &&
+ printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
+ ) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh"
+write_line "$icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate"
+write_line "$icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh"
+write_line "$icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh"
+write_line "$icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh"
+write_line "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/$(test "$SXMO_WM" = sway && printf sway || printf xinit)"
+$(command -v pmos-tweaks >/dev/null && write_line "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
+write_line "$icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_wakelock.sh debug watch"
+write_line "$icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_foot.sh b/configs/menus/terminal/sxmo_menu_foot.sh
new file mode 100755
index 0000000..da95592
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c"
+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus"
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next"
+write_line "$icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u"
+write_line "$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
+write_line "$icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r"
+write_line "$icon_aru Search Back ^ 1 ^ sxmo_type -M Ctrl -k r"
+write_line "$icon_ard Search Forward ^ 1 ^ sxmo_type -M Ctrl -k s"
+write_line "$icon_itm Search Extend ^ 1 ^ sxmo_type -M Ctrl -k w"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_git.sh b/configs/menus/terminal/sxmo_menu_git.sh
new file mode 100755
index 0000000..7de37a5
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_fil ${PAGER:-less} menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS ${PAGER:-less}'"
+write_line "$icon_edt $EDITOR menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS $EDITOR'"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_less.sh b/configs/menus/terminal/sxmo_menu_less.sh
new file mode 100755
index 0000000..554c0f0
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_arr Page next ^ 1 ^ sxmo_type ':n' -k Return"
+write_line "$icon_arl Page previous ^ 1 ^ sxmo_type ':p' -k Return"
+write_line "$icon_cls Quit ^ 0 ^ sxmo_type q"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus"
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_micro.sh b/configs/menus/terminal/sxmo_menu_micro.sh
new file mode 100755
index 0000000..4bce367
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt"
+write_line "$icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt"
+write_line "$icon_sav Save ^ 1 ^ sxmo_type -M Ctrl s -m Ctrl"
+write_line "$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl q -m Ctrl"
+write_line "$icon_fnd Find ^ 0 ^ sxmo_type -M Ctrl f -m Ctrl"
+write_line "$icon_fnd Find Previous ^ 1 ^ sxmo_type -M Ctrl p -m Ctrl"
+write_line "$icon_fnd Find Next ^ 1 ^ sxmo_type -M Ctrl n -m Ctrl"
+write_line "$icon_trm Command Bar ^ 0 ^ sxmo_type -M Ctrl e -m Ctrl"
+write_line "$icon_cpy Copy ^ 0 ^ sxmo_type -M Ctrl c -m Ctrl"
+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v -m Ctrl"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_modem.sh b/configs/menus/terminal/sxmo_menu_modem.sh
new file mode 100755
index 0000000..45cc421
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_plk Modem PIN ^ 0 ^ sxmo_unlocksim.sh"
+write_line "$icon_phn Modem Monitor $(
+ superd_service_isrunning sxmo_modemmonitor &&
+ printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
+ printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
+ ) && sxmo_hook_statusbar.sh modem_monitor"
+write_line "$icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem"
+write_line "$icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh"
+write_line "$icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh"
+write_line "$icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh"
+write_line "$icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_mpv.sh b/configs/menus/terminal/sxmo_menu_mpv.sh
new file mode 100755
index 0000000..0f0e616
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_pau Pause ^ 0 ^ sxmo_type -k Space"
+write_line "$icon_fbw Seek ^ 1 ^ sxmo_type -k Left"
+write_line "$icon_ffw Seek ^ 1 ^ sxmo_type -k Right"
+write_line "$icon_aru App Volume ↑ ^ 1 ^ sxmo_type 0"
+write_line "$icon_ard App Volume ↓ ^ 1 ^ sxmo_type 9"
+write_line "$icon_aru Speed up ^ 1 ^ sxmo_type -k bracketRight"
+write_line "$icon_ard Speed down ^ 1 ^ sxmo_type -k bracketLeft"
+write_line "$icon_cam Screenshot ^ 1 ^ sxmo_type s"
+write_line "$icon_itm Loopmark ^ 1 ^ sxmo_type l"
+write_line "$icon_inf Info ^ 1 ^ sxmo_type i"
+write_line "$icon_inf Seek Info ^ 1 ^ sxmo_type o"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_nano.sh b/configs/menus/terminal/sxmo_menu_nano.sh
new file mode 100755
index 0000000..4c2c111
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_sav Save ^ 0 ^ sxmo_type -M Ctrl o"
+write_line "$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl x"
+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl u"
+write_line "$icon_itm Type complete ^ 0 ^ sxmo_type -M Shift -M Ctrl u"
+write_line "$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Shift -M Ctrl i"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_ncmpcpp.sh b/configs/menus/terminal/sxmo_menu_ncmpcpp.sh
new file mode 100755
index 0000000..f2aaf4c
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_lst Playlist ^ 0 ^ sxmo_type 1"
+write_line "$icon_fnd Browser ^ 0 ^ sxmo_type 2"
+write_line "$icon_fnd Search ^ 0 ^ sxmo_type 3"
+write_line "$icon_nxt Next track ^ 0 ^ sxmo_type -k greater"
+write_line "$icon_prv Previous track ^ 0 ^ sxmo_type -k less"
+write_line "$icon_pau Pause ^ 0 ^ sxmo_type p"
+write_line "$icon_stp Stop ^ 0 ^ sxmo_type s"
+write_line "$icon_rld Toggle repeat ^ 0 ^ sxmo_type r"
+write_line "$icon_sfl Toggle random ^ 0 ^ sxmo_type z"
+write_line "$icon_itm Toggle consume ^ 0 ^ sxmo_type R"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_phone.sh b/configs/menus/terminal/sxmo_menu_phone.sh
new file mode 100755
index 0000000..96411d6
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_msg Conversation ^ 0 ^ sxmo_terminal.sh sxmo_modemtext.sh conversationloop $number"
+write_line "$icon_msg Reply ^ 0 ^ sxmo_modemtext.sh sendtextmenu $number"
+write_line "$icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number"
+ [ -d "$SXMO_LOGDIR/$number/attachments" ] && write_line "$icon_att View Attachments ^ 1 ^ sxmo_files.sh $SXMO_LOGDIR/$number/attachments --date-sort"
+ found_numbers="$(printf %s "$number" | xargs -I{} pnc find "{}")"
+ printf "%s\n" "$found_numbers" | while read -r line; do
+ sxmo_contacts.sh --name "$line" | grep -q '???' && write_line "$icon_usr Add $line ^ 1 ^ sxmo_contactmenu.sh newcontact $line"
+ done
+ # if this is a group chain, then allow to add entire chain as a contact too
+ if [ "$(printf "%s\n" "$found_numbers" | wc -l)" -gt 1 ]; then
+ sxmo_contacts.sh --name "$number" | grep -q '???' && write_line "$icon_usr Add $number ^ 1 ^ sxmo_contactmenu.sh newcontact $number"
+ fi
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -M Ctrl b"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -M Ctrl f"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_power.sh b/configs/menus/terminal/sxmo_menu_power.sh
new file mode 100755
index 0000000..fc87f36
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_lck Lock ^ 0 ^ sxmo_hook_lock.sh"
+write_line "$icon_lck Lock (Screen off) ^ 0 ^ sxmo_hook_screenoff.sh"
+write_line "$icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout"
+ [ -f "$(xdg_data_path xsessions/sxmo.desktop)" ] &&
+ [ -f "$(xdg_data_path wayland-sessions/swmo.desktop)" ] &&
+ write_line "$icon_rol Toggle WM ^ 0 ^ confirm Toggle && sxmo_power.sh togglewm"
+write_line "$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot"
+write_line "$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_scripts.sh b/configs/menus/terminal/sxmo_menu_scripts.sh
new file mode 100755
index 0000000..0ef36f7
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+# configversion: 8fb4376641c86ac5e66d712f0cc0d087
+# configversion: 79862f7af2e87209475e387e7abd17c0
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output the content of the scripts menu
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s ^ 0 ^ %s\n" "$1" "$2"
+}
+
+get_title() {
+ title=""
+ eval "$(head "$1" | grep '# title="[^\\"]*"' | sed 's/^# //g')"
+ if [ -n "$title" ]; then
+ echo "$title"
+ else
+ basename="$(basename "$1")"
+ echo "$icon_itm $basename"
+ fi
+}
+
+if [ -f "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
+ cat "$XDG_CONFIG_HOME/sxmo/userscripts"
+elif [ -d "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
+ find -L "$XDG_CONFIG_HOME/sxmo/userscripts" -type f -o -type l | sort -f | while read -r script; do
+ title="$(get_title "$script")"
+ write_line "$title" "$script"
+ done
+fi
+
+write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
+
+# System Scripts
+find "$(xdg_data_path sxmo/appscripts)" -type f -o -type l | sort -f | while read -r script; do
+ title="$(get_title "$script")"
+ write_line "$title" "$script"
+done
diff --git a/configs/menus/terminal/sxmo_menu_senpai.sh b/configs/menus/terminal/sxmo_menu_senpai.sh
new file mode 100755
index 0000000..e59b1cb
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_ac1 Previous Buffer ^ 1 ^ sxmo_type -M Alt -k Left"
+write_line "$icon_ac4 Next Buffer ^ 1 ^ sxmo_type -M Alt -k Right"
+write_line "$icon_lst Toggle Channels ^ 0 ^ sxmo_type -k F7"
+write_line "$icon_usr Toggle Members ^ 0 ^ sxmo_type -k F8"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_st.sh b/configs/menus/terminal/sxmo_menu_st.sh
new file mode 100755
index 0000000..0ce8876
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u"
+write_line "$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i"
+write_line "$icon_itm Selmode $(
+ [ "$STSELMODEON" = 1 ] &&
+ printf %b "$icon_ton" ||
+ printf %b "$icon_tof"
+ printf %b '^ 0 ^ sxmo_type -M Ctrl -M Shift -k s'
+)"
+$([ "$STSELMODEON" = 1 ] && write_line "Copy selection ^ 0 ^ sxmo_type -M Ctrl -M Shift -k c")
+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl -M Shift -k v"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Prior"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Next"
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f"
+write_line "$icon_a2x Invert ^ 1 ^ sxmo_type -M Ctrl -M Shift -k x"
+write_line "$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_sthotkeys.sh b/configs/menus/terminal/sxmo_menu_sthotkeys.sh
new file mode 100755
index 0000000..f0d0a26
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c"
+write_line "Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z"
+write_line "Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l"
+write_line "Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d"
+write_line "Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a"
+write_line "Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b"
+write_line "Send ESC:w ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k Return"
+write_line "Send ESC:wq ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k q -k Return"
+write_line "Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k q -k exclam -k Return"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_sys.sh b/configs/menus/terminal/sxmo_menu_sys.sh
new file mode 100755
index 0000000..51fac10
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts"
+write_line "$icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications"
+write_line "$icon_grd Binaries ^ 0 ^ sxmo_brun.sh"
+write_line "$icon_dir Files ^ 0 ^ sxmo_files.sh"
+write_line "$icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh"
+write_line "$icon_msg Texts ^ 0 ^ sxmo_modemtext.sh"
+write_line "$icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh"
+rfkill list bluetooth | grep -q "yes" || write_line "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
+command -v megapixels >/dev/null && write_line "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels"
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
+ if [ -d "$(locale | grep LANG | grep 'US|CA')" ]; then
+ printf "%s Flashlight " "$icon_fll"
+ else
+ printf "%s Torch " "$icon_fll"
+ fi
+ sxmo_led.sh get white | grep -vq ^100$ &&
+ printf %b "$icon_tof" || printf %b "$icon_ton";
+ printf %b "^ 1 ^ sxmo_flashtoggle.sh\n"
+fi
+write_line "$icon_net Networks ^ 0 ^ sxmo_networks.sh"
+write_line "$icon_mus Audio ^ 0 ^ sxmo_audio.sh"
+write_line "$icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem"
+write_line "$icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config"
+write_line "$icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_terminal.sh b/configs/menus/terminal/sxmo_menu_terminal.sh
new file mode 100755
index 0000000..a582a55
--- /dev/null
@@ -0,0 +1 @@
+$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_tuir.sh b/configs/menus/terminal/sxmo_menu_tuir.sh
new file mode 100755
index 0000000..4642684
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_aru Previous ^ 1 ^ sxmo_type k"
+write_line "$icon_ard Next ^ 1 ^ sxmo_type j"
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_ret Open ^ 0 ^ sxmo_type o"
+write_line "$icon_arl Back ^ 0 ^ sxmo_type h"
+write_line "$icon_arr Comments ^ 0 ^ sxmo_type l"
+write_line "$icon_edt Post ^ 0 ^ sxmo_type c"
+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type r"
+write_line "$icon_cls Quit ^ 0 ^ sxmo_type q"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_vim.sh b/configs/menus/terminal/sxmo_menu_vim.sh
new file mode 100755
index 0000000..21c72d3
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_cls Save and Quit ^ 0 ^ sxmo_type -k Escape -s 300 ':wq' -k Return"
+write_line "$icon_sav Save ^ 0 ^ sxmo_type -k Escape -s 300 ':w' -k Return"
+write_line "$icon_cls Quit without saving ^ 0 ^ sxmo_type -k Escape -s 300 ':q!' -k Return"
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl u"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl d"
+write_line "$icon_trm Command prompt ^ 0 ^ sxmo_type -k Escape -s 300 ':'"
+write_line "$icon_pst Paste Selection ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k asterisk -k p"
+write_line "$icon_pst Paste Clipboard ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k plus -k p"
+write_line "$icon_fnd Search ^ 0 ^ sxmo_type -k Escape -s 300 /"
+write_line "$icon_arr Next buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bn' -k Return"
+write_line "$icon_arl Previous buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bp' -k Return"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_w3m.sh b/configs/menus/terminal/sxmo_menu_w3m.sh
new file mode 100755
index 0000000..d12a8a8
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_arl Back ^ 1 ^ sxmo_type b"
+write_line "$icon_glb Goto URL ^ 1 ^ sxmo_type u"
+write_line "$icon_arr Next Link ^ 1 ^ sxmo_type -k Tab"
+write_line "$icon_arl Previous Link ^ 1 ^ sxmo_type -M Shift -k Tab"
+write_line "$icon_tab Open tab ^ 0 ^ sxmo_type t"
+write_line "$icon_cls Close tab ^ 0 ^ sxmo_type -M Ctrl q"
+write_line "$icon_itm Next tab ^ 1 ^ sxmo_type -k braceRight"
+write_line "$icon_itm Previous tab ^ 1 ^ sxmo_type -k braceLeft"
+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/menus/terminal/sxmo_menu_weechat.sh b/configs/menus/terminal/sxmo_menu_weechat.sh
new file mode 100755
index 0000000..b554139
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script will output config options.
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+write_line() {
+ printf "%s\n" "$1"
+}
+
+write_line "$icon_msg Hotlist Next ^ 1 ^ sxmo_type -M Alt a"
+write_line "$icon_arl History Previous ^ 1 ^ sxmo_type -M Alt -k Less"
+write_line "$icon_arr History Next ^ 1 ^ sxmo_type -M Alt -k Greater"
+write_line "$icon_trm Buffer ^ 0 ^ sxmo_type '/buffer '"
+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
\ No newline at end of file
diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
index 55baab3..2c7eaea 100644
--- a/configs/profile.d/sxmo_init.sh
+++ b/configs/profile.d/sxmo_init.sh
@@ -113,8 +113,14 @@ _sxmo_load_environments() {
PATH="\
$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME:\
$XDG_CONFIG_HOME/sxmo/hooks:\
+$XDG_CONFIG_HOME/sxmo/menus/:\
+$XDG_CONFIG_HOME/sxmo/menus/terminal/:\
+$XDG_CONFIG_HOME/sxmo/menus/graphical/:\
$_device_hooks_path:\
$(xdg_data_path "sxmo/default_hooks" 0 ':'):\
+$(xdg_data_path "sxmo/menus" 0 ':'):\
+$(xdg_data_path "sxmo/menus/terminal" 0 ':'):\
+$(xdg_data_path "sxmo/menus/graphical" 0 ':'):\
$PATH"
export PATH
else
diff --git a/docs/sxmo.7.scd b/docs/sxmo.7.scd
index 66856b5..5aaa0fd 100644
--- a/docs/sxmo.7.scd
+++ b/docs/sxmo.7.scd
@@ -98,6 +98,9 @@ PATH to determine which hook executes. It will look first for hooks in
For example, if you pickup
a call and *~/.config/sxmo/hooks/sxmo_hook_pickup.sh* does not exist,
*/usr/share/sxmo/default_hooks/sxmo_hook_pickup.sh* will be run.
+Menu system was removed from hooks and placed into it's own catagory called menus
+(*sxmo_menu\*.sh). PATH will first check *~/.config/sxmo/menus/* then
+in */usr/share/sxmo/menus/**.
Note that some hooks are in a subdirectory under the *hooks/* main
directory which will allow you to have hooks associated with a certain
@@ -108,6 +111,7 @@ It should be a symlink to another subdirectory, e.g., *one_button_ereader* or
While you can manually copy and edit hooks to your liking,
_sxmo_hookmenu.sh_ (MENU > config > hooks) simplifies this process.
+The same with menus, they can be edited to your liking.
Note also that hooks do not have their own man pages. We have documented each
hook in the comments of that hook.
diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh
index e45a54c..2a24e85 100755
--- a/scripts/core/sxmo_appmenu.sh
@@ -70,7 +70,7 @@ call_entries() {
}
getprogchoices() {
- RES="$(sxmo_hook_contextmenu.sh "$1")"
+ RES="$(sxmo_menu_main.sh "$1")"
if [ -n "$RES" ]; then
WINNAME="$(printf %s "$RES" | head -n1)"
CHOICES="$(printf %s "$RES" | tail -n+2)"
@@ -128,7 +128,7 @@ mainloop() {
if [ -z "$CMD" ]; then
printf "%s\n" "sxmo_appmenu: Fallback: unknown choice <$PICKED> to contextmenu_fallback hook">&2
- sxmo_hook_contextmenu_fallback.sh "$WINNAME" "$PICKED"
+ sxmo_menu_fallback.sh "$WINNAME" "$PICKED"
quit
fi
diff --git a/scripts/core/sxmo_migrate.sh b/scripts/core/sxmo_migrate.sh
index 309987f..9d59ad0 100755
--- a/scripts/core/sxmo_migrate.sh
+++ b/scripts/core/sxmo_migrate.sh
@@ -175,12 +175,26 @@ defaultconfig() {
}
checkhooks() {
- if ! [ -e "$XDG_CONFIG_HOME/sxmo/hooks/" ]; then
+ if [ -e "$XDG_CONFIG_HOME/sxmo/hooks/" ]; then
+ HOME_HOOKS=1
+ fi
+ if [ -e "$XDG_CONFIG_HOME/sxmo/menus/" ]; then
+ MENU_HOOKS=1
+ fi
+
+ if [ -z "$HOME_HOOKS" ] && [ -z "$MENU_HOOKS" ]; then
return
fi
+
for hook in \
- "$XDG_CONFIG_HOME/sxmo/hooks/"* \
- ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME/"*}; do
+ "$xdg_config_home/sxmo/hooks/"* \
+ "$xdg_config_home/sxmo/menus/"* \
+ "$xdg_config_home/sxmo/menus/terminal/"* \
+ "$xdg_config_home/sxmo/menus/graphical/"* \
+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME/"*} \
+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/menus/"*} \
+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/menus/terminal/"*} \
+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/menus/graphical/"*}; do
{ [ -e "$hook" ] && [ -f "$hook" ];} || continue #sanity check because shell enters loop even when there are no files in dir (null glob)
[ -h "$hook" ] && continue # shallow symlink
@@ -188,11 +202,11 @@ checkhooks() {
if printf %s "$hook" | grep -q "/$SXMO_DEVICE_NAME/"; then
# We also compare the device user hook to the system
# default version
- DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/"$SXMO_DEVICE_NAME"/):$(xdg_data_path sxmo/default_hooks/)"
+ DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/"$SXMO_DEVICE_NAME"/):$(xdg_data_path sxmo/default_hooks/):$(xdg_data_path sxmo/menus/terminal/):$(xdg_data_path sxmo/menus/graphical/):$(xdg_data_path sxmo/menus/)"
else
# We dont want to compare a default user hook to the device
# system version
- DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/)"
+ DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/):$(xdg_data_path sxmo/menus/terminal/):$(xdg_data_path sxmo/menus/graphical/):$(xdg_data_path sxmo/menus/)"
fi
if [ "$MODE" = "reset" ]; then
--
2.40.1
Hi Hazard Chem,
Thanks for the work on this. I've been busy but I'm tracking this.
Since there's a lot of changes, i wondered if this patch only addresses
the issue that all of our menus are in one massive file, or if it
addresses any of the other issues? For instance, inconsistency in menu
'decorations' like close, etc. (e.g., Network Menu vs. other menus)?
Some method to navigate "up" or "back" in the menu tree (if any)?
On Thu, Jun 01, 2023 at 12:28:15PM +1000, hazardchem wrote:
>As per ticket: #573, I have started doing some of the ground work before
>we migrate over. This adds a new directory called menus.
>
>This replaces sxmo_hook_contextmenu.sh with sxmo_menu_*.sh and all folders
>underneath are added to the $PATH via sxmo_init.sh.
>
>Then to add a new menu you add the check in sxmo_menu_main.sh and the following
>menu in {name}/sxmo_menu_{name}.sh
>
>Signed-off-by: hazardchem <pthom44@live.com.au>
>---
>
>v2 - Followed advice from Eolien and simplified the directory structure and made
>main menu not hard coded and will dynamically work for future sxmo_menu_{}.sh scripts
>
>v3 - Fixed Makefile, docs, and removed sxmo_hook_contextmenu.sh + fallback.
>Installs correctly with make install with this patches modifications.
>
>v4 - Fixed sxmo_migrate.sh to handle menus as well as hooks. Fixed mistake in
>docs file, and made room for configversion on main, fallback, and apps.
>
> Makefile | 3 +
> .../default_hooks/sxmo_hook_contextmenu.sh | 682 ------------------
> .../menus/graphical/sxmo_menu_alacritty.sh | 25 +
> configs/menus/graphical/sxmo_menu_falkon.sh | 28 +
> configs/menus/graphical/sxmo_menu_feh.sh | 28 +
> configs/menus/graphical/sxmo_menu_firefox.sh | 28 +
> configs/menus/graphical/sxmo_menu_foxtrot.sh | 21 +
> configs/menus/graphical/sxmo_menu_geopard.sh | 28 +
> configs/menus/graphical/sxmo_menu_imv.sh | 24 +
> configs/menus/graphical/sxmo_menu_kasts.sh | 19 +
> configs/menus/graphical/sxmo_menu_lagrange.sh | 26 +
> configs/menus/graphical/sxmo_menu_mepo.sh | 22 +
> configs/menus/graphical/sxmo_menu_netsurf.sh | 22 +
> configs/menus/graphical/sxmo_menu_okular.sh | 26 +
> configs/menus/graphical/sxmo_menu_surf.sh | 30 +
> configs/menus/graphical/sxmo_menu_sxiv.sh | 26 +
> configs/menus/graphical/sxmo_menu_vimb.sh | 23 +
> configs/menus/graphical/sxmo_menu_xournal.sh | 30 +
> configs/menus/graphical/sxmo_menu_zathura.sh | 26 +
> .../sxmo_menu_fallback.sh} | 1 +
> configs/menus/sxmo_menu_main.sh | 86 +++
> configs/menus/terminal/sxmo_menu_aerc.sh | 23 +
> .../terminal/sxmo_menu_apps.sh} | 1 +
> configs/menus/terminal/sxmo_menu_cmus.sh | 25 +
> configs/menus/terminal/sxmo_menu_config.sh | 59 ++
> configs/menus/terminal/sxmo_menu_foot.sh | 29 +
> configs/menus/terminal/sxmo_menu_git.sh | 20 +
> configs/menus/terminal/sxmo_menu_less.sh | 25 +
> configs/menus/terminal/sxmo_menu_micro.sh | 30 +
> configs/menus/terminal/sxmo_menu_modem.sh | 28 +
> configs/menus/terminal/sxmo_menu_mpv.sh | 28 +
> configs/menus/terminal/sxmo_menu_nano.sh | 27 +
> configs/menus/terminal/sxmo_menu_ncmpcpp.sh | 28 +
> configs/menus/terminal/sxmo_menu_phone.sh | 32 +
> configs/menus/terminal/sxmo_menu_power.sh | 25 +
> configs/menus/terminal/sxmo_menu_scripts.sh | 45 ++
> configs/menus/terminal/sxmo_menu_senpai.sh | 23 +
> configs/menus/terminal/sxmo_menu_st.sh | 33 +
> configs/menus/terminal/sxmo_menu_sthotkeys.sh | 26 +
> configs/menus/terminal/sxmo_menu_sys.sh | 41 ++
> configs/menus/terminal/sxmo_menu_terminal.sh | 1 +
> configs/menus/terminal/sxmo_menu_tuir.sh | 30 +
> configs/menus/terminal/sxmo_menu_vim.sh | 31 +
> configs/menus/terminal/sxmo_menu_w3m.sh | 28 +
> configs/menus/terminal/sxmo_menu_weechat.sh | 24 +
> configs/profile.d/sxmo_init.sh | 6 +
> docs/sxmo.7.scd | 4 +
> scripts/core/sxmo_appmenu.sh | 4 +-
> scripts/core/sxmo_migrate.sh | 24 +-
> 49 files changed, 1215 insertions(+), 689 deletions(-)
> delete mode 100755 configs/default_hooks/sxmo_hook_contextmenu.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_alacritty.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_falkon.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_feh.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_firefox.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_foxtrot.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_geopard.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_imv.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_kasts.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_lagrange.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_mepo.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_netsurf.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_okular.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_surf.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_sxiv.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_vimb.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_xournal.sh
> create mode 100755 configs/menus/graphical/sxmo_menu_zathura.sh
> rename configs/{default_hooks/sxmo_hook_contextmenu_fallback.sh => menus/sxmo_menu_fallback.sh} (99%)
> create mode 100755 configs/menus/sxmo_menu_main.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_aerc.sh
> rename configs/{default_hooks/sxmo_hook_apps.sh => menus/terminal/sxmo_menu_apps.sh} (99%)
> create mode 100755 configs/menus/terminal/sxmo_menu_cmus.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_config.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_foot.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_git.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_less.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_micro.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_modem.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_mpv.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_nano.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_ncmpcpp.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_phone.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_power.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_scripts.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_senpai.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_st.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_sthotkeys.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_sys.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_terminal.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_tuir.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_vim.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_w3m.sh
> create mode 100755 configs/menus/terminal/sxmo_menu_weechat.sh
>
>diff --git a/Makefile b/Makefile
>index 0eba191..9c17bdb 100644
>--- a/Makefile
>+++ b/Makefile
>@@ -51,8 +51,11 @@ install-scripts: $(PROGRAMS)
> cd configs && find . -type f -not -name sxmo-setpermissions -exec install -D -m 0644 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
>
> rm -rf "$(DESTDIR)$(PREFIX)/share/sxmo/default_hooks/"
>+ rm -rf "$(DESTDIR)$(PREFIX)/share/sxmo/menus/"
> cd configs && find default_hooks -type f -exec install -D -m 0755 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
> cd configs && find default_hooks -type l -exec cp -R "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
>+ cd configs && find menus -type f -exec install -D -m 0755 "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
>+ cd configs && find menus -type l -exec cp -R "{}" "$(DESTDIR)$(PREFIX)/share/sxmo/{}" \; && cd ..
>
> [ -n "$(GITVERSION)" ] && echo "$(GITVERSION)" > "$(DESTDIR)$(PREFIX)/share/sxmo/version" || echo "$(VERSION)" > "$(DESTDIR)$(PREFIX)/share/sxmo/version"
>
>diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh
>deleted file mode 100755
>index 2ee8ab5..0000000
>--- a/configs/default_hooks/sxmo_hook_contextmenu.sh
>+++ /dev/null
>@@ -1,682 +0,0 @@
>-#!/bin/sh
>-# SPDX-License-Identifier: AGPL-3.0-only
>-# Copyright 2022 Sxmo Contributors
>-
>-# This script will output the content of the contextual menu
>-# It should stdout the title as the first line followed by the entries
>-
>-# include common definitions
>-# shellcheck source=scripts/core/sxmo_common.sh
>-. sxmo_common.sh
>-# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>-. sxmo_hook_icons.sh
>-
>-XPROPOUT="$(sxmo_wm.sh focusedwindow)"
>-WMCLASS="${1:-$(printf %s "$XPROPOUT" | grep app: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
>-
>-superd_service_isrunning() {
>- superctl status "$1" | grep -q started
>-}
>-
>-sxmo_service_isrunning() {
>- sxmo_daemons.sh running "$1" > /dev/null
>-}
>-
>-if [ -z "$XPROPOUT" ]; then
>- sxmo_log "detected no active window, no problem, opening system menu"
>-else
>- sxmo_log "opening menu for wmclass $WMCLASS"
>-fi
>-
>-case "$WMCLASS" in
>- scripts)
>- # Scripts menu
>- CHOICES="$(sxmo_hook_scripts.sh)"
>- WINNAME=Scripts
>- ;;
>- applications)
>- # Apps menu
>- CHOICES="$(sxmo_hook_apps.sh)"
>- WINNAME=Apps
>- ;;
>- modem)
>- # modem related
>- CHOICES="
>- $icon_plk Modem PIN ^ 0 ^ sxmo_unlocksim.sh
>- $icon_phn Modem Monitor $(
>- superd_service_isrunning sxmo_modemmonitor &&
>- printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
>- printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
>- ) && sxmo_hook_statusbar.sh modem_monitor
>- $icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem
>- $icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh
>- $icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh
>- $icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh
>- $icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh
>- "
>- WINNAME=Modem
>- ;;
>- config)
>- # System Control menu
>- CHOICES="
>- $icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up
>- $icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down
>- $icon_cfg Touch $(
>- sxmo_wm.sh inputevent touchscreen | grep -q on && \
>- printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
>- printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
>- )
>- $icon_cfg Stylus $(
>- sxmo_wm.sh inputevent stylus | grep -q on && \
>- printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
>- printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
>- )
>- $icon_cfg Gestures $(
>- superd_service_isrunning "sxmo_hook_lisgd" &&
>- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
>- ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd'
>- $icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
>- $icon_bth Bluetooth $(
>- rfkill list bluetooth | grep -q "yes" &&
>- printf %b "$icon_tof" || printf %b "$icon_ton";
>- printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
>- )
>- $(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
>- $icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh
>- $icon_zzz Auto-suspend $(
>- [ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
>- ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.nosuspend || touch $XDG_CACHE_HOME/sxmo/sxmo.nosuspend)
>- $icon_zzz Auto-screen-off $(
>- [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
>- ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_hook_unlock.sh
>- $icon_ror Autorotate $(
>- sxmo_daemons.sh running autorotate -q &&
>- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
>- ) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh
>- $icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate
>- $icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh
>- $icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh
>- $icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh
>- $icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/$(test "$SXMO_WM" = sway && printf sway || printf xinit)
>- $(command -v pmos-tweaks >/dev/null && echo "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
>- $icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_wakelock.sh debug watch
>- $icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block
>- "
>- WINNAME=Config
>- ;;
>- power)
>- # Power menu
>- CHOICES="
>- $icon_lck Lock ^ 0 ^ sxmo_hook_lock.sh
>- $icon_lck Lock (Screen off) ^ 0 ^ sxmo_hook_screenoff.sh
>- $icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout
>- $([ -f "$(xdg_data_path xsessions/sxmo.desktop)" ] &&
>- [ -f "$(xdg_data_path wayland-sessions/swmo.desktop)" ] &&
>- echo "$icon_rol Toggle WM ^ 0 ^ confirm Toggle && sxmo_power.sh togglewm"
>- )
>- $icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
>- $icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
>- "
>- WINNAME=Power
>- ;;
>- *mpv*)
>- # MPV
>- CHOICES="
>- $icon_pau Pause ^ 0 ^ sxmo_type -k Space
>- $icon_fbw Seek ^ 1 ^ sxmo_type -k Left
>- $icon_ffw Seek ^ 1 ^ sxmo_type -k Right
>- $icon_aru App Volume Up ^ 1 ^ sxmo_type 0
>- $icon_ard App Volume Down ^ 1 ^ sxmo_type 9
>- $icon_aru Speed up ^ 1 ^ sxmo_type -k bracketRight
>- $icon_ard Speed down ^ 1 ^ sxmo_type -k bracketLeft
>- $icon_cam Screenshot ^ 1 ^ sxmo_type s
>- $icon_itm Loopmark ^ 1 ^ sxmo_type l
>- $icon_inf Info ^ 1 ^ sxmo_type i
>- $icon_inf Seek Info ^ 1 ^ sxmo_type o
>- "
>- WINNAME=Mpv
>- ;;
>- *feh*)
>- # Feh
>- CHOICES="
>- $icon_arr Next ^ 1 ^ sxmo_type -k Space
>- $icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k up
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k down
>- $icon_exp Zoom to fit ^ 1 ^ sxmo_type -k slash
>- $icon_shr Zoom to fill ^ 1 ^ sxmo_type '!'
>- $icon_rol Rotate ^ 1 ^ sxmo_type -k less
>- $icon_ror Rotate ^ 1 ^ sxmo_type -k greater
>- $icon_a2y Flip ^ 1 ^ sxmo_type -k underscore
>- $icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
>- $icon_inf Toggle filename ^ 1 ^ sxmo_type d
>- "
>- WINNAME=Feh
>- ;;
>- *sxiv*)
>- # Sxiv
>- CHOICES="
>- $icon_arr Next ^ 1 ^ sxmo_type -k Space
>- $icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k equal
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
>- $icon_rol Rotate ^ 1 ^ sxmo_type -k less
>- $icon_ror Rotate ^ 1 ^ sxmo_type -k greater
>- $icon_a2y Flip ^ 1 ^ sxmo_type -k question
>- $icon_a2x Mirror ^ 1 ^ sxmo_type -k bar
>- $icon_grd Thumbnail ^ 0 ^ sxmo_type -k Return
>- "
>- WINNAME=Sxiv
>- ;;
>- *imv*)
>- # imv
>- CHOICES="
>- $icon_arr Next ^ 1 ^ sxmo_type -k Right
>- $icon_arl Previous ^ 1 ^ sxmo_type -k Left
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k i
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus
>- $icon_exp Zoom to fit ^ 1 ^ sxmo_type -k r
>- $icon_ror Rotate ^ 1 ^ sxmo_type -M ctrl r
>- $icon_inf Toggle filename ^ 1 ^ sxmo_type -k d
>- "
>- WINNAME=Imv
>- ;;
>- *kasts*)
>- CHOICES="
>- $icon_mus Audio ^ 0 ^ sxmo_audio.sh
>- $icon_bth Bluetooth ^ 0 ^ sxmo_bluetoothmenu.sh
>- "
>- WINNAME="Kasts"
>- ;;
>- *sthotkeys*)
>- # St hotkeys
>- CHOICES="
>- Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c
>- Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z
>- Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l
>- Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d
>- Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a
>- Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b
>- Send ESC:w ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k Return
>- Send ESC:wq ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k q -k Return
>- Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k q -k exclam -k Return
>- "
>- WINNAME=St
>- ;;
>- *foot*|*st*|*terminal*|org.gnome.vte.application|*alacritty*)
>- # First we try to handle the app running inside the terminal:
>- WMNAME="${1:-$(printf %s "$XPROPOUT" | grep title: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
>- if printf %s "$WMNAME" | grep -qi -E -w "(vi|vim|vis|nvim|neovim|kakoune)"; then
>- #Vim in foot
>- CHOICES="
>- $icon_cls Save and Quit ^ 0 ^ sxmo_type -k Escape -s 300 ':wq' -k Return
>- $icon_sav Save ^ 0 ^ sxmo_type -k Escape -s 300 ':w' -k Return
>- $icon_cls Quit without saving ^ 0 ^ sxmo_type -k Escape -s 300 ':q!' -k Return
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl u
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl d
>- $icon_trm Command prompt ^ 0 ^ sxmo_type -k Escape -s 300 ':'
>- $icon_pst Paste Selection ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k asterisk -k p
>- $icon_pst Paste Clipboard ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k plus -k p
>- $icon_fnd Search ^ 0 ^ sxmo_type -k Escape -s 300 /
>- $icon_arr Next buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bn' -k Return
>- $icon_arl Previous buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bp' -k Return
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=Vim
>- elif printf %s "$WMNAME" | grep -qi -w "nano"; then
>- #Nano in foot
>- CHOICES="
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
>- $icon_sav Save ^ 0 ^ sxmo_type -M Ctrl o
>- $icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl x
>- $icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl u
>- $icon_itm Type complete ^ 0 ^ sxmo_type -M Shift -M Ctrl u
>- $icon_cpy Copy complete ^ 0 ^ sxmo_type -M Shift -M Ctrl i
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=Nano
>- elif printf %s "$WMNAME" | grep -qi -w "micro"; then
>- #Micro
>- CHOICES="
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
>- $icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt
>- $icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt
>- $icon_sav Save ^ 1 ^ sxmo_type -M Ctrl s -m Ctrl
>- $icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl q -m Ctrl
>- $icon_fnd Find ^ 0 ^ sxmo_type -M Ctrl f -m Ctrl
>- $icon_fnd Find Previous ^ 1 ^ sxmo_type -M Ctrl p -m Ctrl
>- $icon_fnd Find Next ^ 1 ^ sxmo_type -M Ctrl n -m Ctrl
>- $icon_trm Command Bar ^ 0 ^ sxmo_type -M Ctrl e -m Ctrl
>- $icon_cpy Copy ^ 0 ^ sxmo_type -M Ctrl c -m Ctrl
>- $icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v -m Ctrl
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=Micro
>- elif printf %s "$WMNAME" | grep -qi -w "tuir"; then
>- #tuir (reddit client) in foot
>- CHOICES="
>- $icon_aru Previous ^ 1 ^ sxmo_type k
>- $icon_ard Next ^ 1 ^ sxmo_type j
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
>- $icon_ret Open ^ 0 ^ sxmo_type o
>- $icon_arl Back ^ 0 ^ sxmo_type h
>- $icon_arr Comments ^ 0 ^ sxmo_type l
>- $icon_edt Post ^ 0 ^ sxmo_type c
>- $icon_rld Refresh ^ 0 ^ sxmo_type r
>- $icon_cls Quit ^ 0 ^ sxmo_type q
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=tuir
>- elif printf %s "$WMNAME" | grep -qi -w "w3m"; then
>- #w3m
>- CHOICES="
>- $icon_arl Back ^ 1 ^ sxmo_type b
>- $icon_glb Goto URL ^ 1 ^ sxmo_type u
>- $icon_arr Next Link ^ 1 ^ sxmo_type -k Tab
>- $icon_arl Previous Link ^ 1 ^ sxmo_type -M Shift -k Tab
>- $icon_tab Open tab ^ 0 ^ sxmo_type t
>- $icon_cls Close tab ^ 0 ^ sxmo_type -M Ctrl q
>- $icon_itm Next tab ^ 1 ^ sxmo_type -k braceRight
>- $icon_itm Previous tab ^ 1 ^ sxmo_type -k braceLeft
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=w3m
>- elif printf %s "$WMNAME" | grep -qi -w "ncmpcpp"; then
>- #ncmpcpp
>- CHOICES="
>- $icon_lst Playlist ^ 0 ^ sxmo_type 1
>- $icon_fnd Browser ^ 0 ^ sxmo_type 2
>- $icon_fnd Search ^ 0 ^ sxmo_type 3
>- $icon_nxt Next track ^ 0 ^ sxmo_type -k greater
>- $icon_prv Previous track ^ 0 ^ sxmo_type -k less
>- $icon_pau Pause ^ 0 ^ sxmo_type p
>- $icon_stp Stop ^ 0 ^ sxmo_type s
>- $icon_rld Toggle repeat ^ 0 ^ sxmo_type r
>- $icon_sfl Toggle random ^ 0 ^ sxmo_type z
>- $icon_itm Toggle consume ^ 0 ^ sxmo_type R
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=ncmpcpp
>- elif printf %s "$WMNAME" | grep -qi -w "aerc"; then
>- #aerc
>- CHOICES="
>- $icon_pau Archive ^ 1 ^ sxmo_type ':archive flat' -k Return
>- $icon_nxt Next Tab ^ 0 ^ sxmo_type ':next-tab' -k Return
>- $icon_prv Previous Tab ^ 0 ^ sxmo_type ':prev-tab' -k Return
>- $icon_cls Close Tab ^ 0 ^ sxmo_type ':close' -k Return
>- $icon_itm Next Part ^ 1 ^ sxmo_type ':next-part' -k Return
>- $icon_trm xdg-open Part ^ 0 ^ sxmo_type ':open' -k Return
>- "
>- WINNAME=aerc
>- elif printf %s "$WMNAME" | grep -qi -E -w "(less|mless)"; then
>- #less
>- CHOICES="
>- $icon_arr Page next ^ 1 ^ sxmo_type ':n' -k Return
>- $icon_arl Page previous ^ 1 ^ sxmo_type ':p' -k Return
>- $icon_cls Quit ^ 0 ^ sxmo_type q
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=less
>- elif printf %s "$WMNAME" | grep -qi -w "git \(blame\|diff\|grep\|help\|log\|stash\|tag\|var\)"; then
>- # These git commands only launch the pager.
>- exec "$0" "$WMCLASS ${PAGER:-less}"
>- elif printf %s "$WMNAME" | grep -qi -w "git \(add\|bugreport\|commit\|merge\|notes\|rebase\|replace\|send-email\|svn\)"; then
>- # These git commands only launch the editor.
>- exec "$0" "$WMCLASS $EDITOR"
>- elif printf %s "$WMNAME" | grep -qi -w "git"; then
>- # git am, branch, config, tag (and other commands which launch both).
>- CHOICES="
>- $icon_fil ${PAGER:-less} menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS ${PAGER:-less}'
>- $icon_edt $EDITOR menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS $EDITOR'
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=git
>- elif printf %s "$WMNAME" | grep -qi -w "senpai"; then
>- CHOICES="
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
>- $icon_ac1 Previous Buffer ^ 1 ^ sxmo_type -M Alt -k Left
>- $icon_ac4 Next Buffer ^ 1 ^ sxmo_type -M Alt -k Right
>- $icon_lst Toggle Channels ^ 0 ^ sxmo_type -k F7
>- $icon_usr Toggle Members ^ 0 ^ sxmo_type -k F8
>- "
>- WINNAME=senpai
>- elif printf %s "$WMNAME" | grep -qi -w "weechat"; then
>- #weechat
>- CHOICES="
>- $icon_msg Hotlist Next ^ 1 ^ sxmo_type -M Alt a
>- $icon_arl History Previous ^ 1 ^ sxmo_type -M Alt -k Less
>- $icon_arr History Next ^ 1 ^ sxmo_type -M Alt -k Greater
>- $icon_trm Buffer ^ 0 ^ sxmo_type '/buffer '
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -k Next
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=weechat
>- elif printf %s "$WMNAME" | grep -qi -w "sms\|missed call"; then
>- number="$(printf "%s\n" "$WMNAME" | xargs -0 pnc find | tr -d '\n')"
>- #sms
>- CHOICES="
>- $icon_msg Conversation ^ 0 ^ sxmo_terminal.sh sxmo_modemtext.sh conversationloop $number
>- $icon_msg Reply ^ 0 ^ sxmo_modemtext.sh sendtextmenu $number
>- $icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number
>- $([ -d "$SXMO_LOGDIR/$number/attachments" ] && echo "$icon_att View Attachments ^ 1 ^ sxmo_files.sh $SXMO_LOGDIR/$number/attachments --date-sort")
>- $(
>-
>- found_numbers="$(printf %s "$number" | xargs -I{} pnc find "{}")"
>- printf "%s\n" "$found_numbers" | while read -r line; do
>- sxmo_contacts.sh --name "$line" | grep -q '???' && echo "$icon_usr Add $line ^ 1 ^ sxmo_contactmenu.sh newcontact $line"
>- done
>- # if this is a group chain, then allow to add entire chain as a contact too
>- if [ "$(printf "%s\n" "$found_numbers" | wc -l)" -gt 1 ]; then
>- sxmo_contacts.sh --name "$number" | grep -q '???' && echo "$icon_usr Add $number ^ 1 ^ sxmo_contactmenu.sh newcontact $number"
>- fi
>-
>- )
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -M Ctrl b
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -M Ctrl f
>- $icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=phone
>- elif printf %s "$WMNAME" | grep -qi -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 Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS
>- "
>- WINNAME=cmus
>- else
>- # Now we fallback to the default terminal menu
>- case "$WMCLASS" in
>- *st*)
>- STSELMODEON="$(
>- printf %s "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '
>- )"
>- CHOICES="
>- $icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u
>- $icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i
>- $icon_itm Selmode $(
>- [ "$STSELMODEON" = 1 ] &&
>- printf %b "$icon_ton" ||
>- printf %b "$icon_tof"
>- printf %b '^ 0 ^ sxmo_type -M Ctrl -M Shift -k s'
>- )
>- $([ "$STSELMODEON" = 1 ] && echo 'Copy selection ^ 0 ^ sxmo_type -M Ctrl -M Shift -k c')
>- $icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl -M Shift -k v
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Prior
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Next
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f
>- $icon_a2x Invert ^ 1 ^ sxmo_type -M Ctrl -M Shift -k x
>- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
>- "
>- WINNAME=St
>- ;;
>- *foot*)
>- CHOICES="
>- $icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
>- $icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
>- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
>- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
>- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior
>- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next
>- $icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u
>- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
>- $icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r
>- $icon_aru Search Back ^ 0 ^ sxmo_type -M Ctrl -k r
>- $icon_ard Search Forward ^ 0 ^ sxmo_type -M Ctrl -k s
>- $icon_itm Search Extend ^ 0 ^ sxmo_type -M Ctrl -k w
>- "
>- WINNAME=Foot
>- ;;
>- *terminal*|org.gnome.vte.application)
>- CHOICES="$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
>- WINNAME=Terminal
>- ;;
>- *alacritty*)
>- CHOICES="
>- $icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
>- $icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
>- $icon_vim VI Mode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k Space
>- $icon_fnd Search Forward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k f
>- $icon_fnd Search Backward ^ 0 ^ sxmo_type -M Ctrl -M Shift -k b
>- $icon_aru Search Previous ^ 0 ^ sxmo_type -k Enter
>- $icon_ard Search Next ^ 0 ^ sxmo_type -M Shift -k Enter
>- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
>- "
>- WINNAME=Alacritty
>- ;;
>- esac
>- fi
>- ;;
>- *okular*)
>- # Okular
>- CHOICES="
>- $icon_cfg Touch $(
>- sxmo_wm.sh inputevent touchscreen | grep -q on && \
>- printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
>- printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
>- )
>- $icon_cfg Fullscreen ^ 0 ^ sxmo_type -k Ctrl -k Shift -k F
>- $icon_cfg Menubar ^ 0 ^ sxmo_type -k Ctrl -k M
>- $icon_cfg Toolbars ^ 0 ^ sxmo_type -k F7
>- $icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
>- "
>- WINNAME=Xournal
>- ;;
>- *xournal*)
>- # Xournalpp
>- CHOICES="
>- $icon_cfg Touch $(
>- sxmo_wm.sh inputevent touchscreen | grep -q on && \
>- printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
>- printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
>- )
>- $icon_flt Open ^ 0 ^ sxmo_type -k Ctrl -k o
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -k Ctrl -k plus
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -k Ctrl -k minus
>- $icon_zmi Next Page ^ 1 ^ sxmo_type -k Next
>- $icon_zmo Prev Page ^ 1 ^ sxmo_type -k Prior
>- $icon_cfg Menubar ^ 0 ^ sxmo_type -k F10
>- $icon_cfg Toolbars ^ 0 ^ sxmo_type -k F9
>- $icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar
>- "
>- WINNAME=Xournal
>- ;;
>- *zathura*)
>- # Zathura
>- CHOICES="
>- $icon_flt Open ^ 0 ^ sxmo_type -k o
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -k plus
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -k minus
>- $icon_arl History ^ 1 ^ sxmo_type -M Ctrl -k o
>- $icon_arr History ^ 1 ^ sxmo_type -M Ctrl -k i
>- $icon_cfg Invert ^ 0 ^ sxmo_type -M Ctrl -k r
>- $icon_flt Index ^ 0 ^ sxmo_type -k Tab
>- $icon_cfg Fit ^ 0 ^ sxmo_type -k a
>- $icon_cfg Width mode ^ 0 ^ sxmo_type -k s
>- "
>- WINNAME=Zathura
>- ;;
>- *netsurf*)
>- # Netsurf
>- CHOICES="
>- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
>- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
>- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
>- "
>- WINNAME=Netsurf
>- ;;
>- *surf*)
>- # Surf
>- CHOICES="
>- $icon_glb Navigate ^ 0 ^ sxmo_type -M Ctrl g
>- $icon_lnk Link Menu ^ 0 ^ sxmo_type -M Ctrl d
>- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
>- $icon_fnd Search Page ^ 0 ^ sxmo_type -M Ctrl f
>- $icon_fnd Find Next ^ 0 ^ sxmo_type -M Ctrl n
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl k
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl j
>- $icon_aru Scroll ^ 1 ^ sxmo_type -M Shift -k Space
>- $icon_ard Scroll ^ 1 ^ sxmo_type -k Space
>- $icon_itm JS Toggle ^ 1 ^ sxmo_type -M Shift -M Ctrl s
>- $icon_arl History ^ 1 ^ sxmo_type -M Ctrl h
>- $icon_arr History ^ 1 ^ sxmo_type -M Ctrl l
>- $icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
>- "
>- WINNAME=Surf
>- ;;
>- *falkon*)
>- # Falkon
>- CHOICES="
>- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
>- $icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
>- $icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
>- $icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
>- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
>- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
>- $icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
>- $icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
>- $icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
>- "
>- WINNAME=Falkon
>- ;;
>- *firefox*|*navigator*)
>- # Firefox
>- CHOICES="
>- $icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh
>- $icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t
>- $icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n
>- $icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
>- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
>- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
>- $icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home
>- $icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11
>- $icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r
>- "
>- WINNAME=Firefox
>- ;;
>- *vimb*)
>- CHOICES="
>- $icon_glb Navigate ^ 0 ^ sxmo_type -k Escape o && sxmo_keyboard.sh open
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -k Escape zi
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -k Escape zo
>- $icon_arl History ^ 1 ^ sxmo_type -M Ctrl o
>- $icon_arr History ^ 1 ^ sxmo_type -M Ctrl i
>- $icon_rld Refresh ^ 0 ^ sxmo_type -k Escape r
>- "
>- WINNAME=Vimb
>- ;;
>- *geopard*)
>- # Geopard
>- CHOICES="
>- $icon_pls New Tab ^ 0 ^ sxmo_type -M Ctrl t
>- $icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w
>- $icon_bok Open Bookmarks ^ 0 ^ sxmo_type -M Ctrl b
>- $icon_pls Add Bookmark ^ 0 ^ sxmo_type -M Ctrl d
>- $icon_edt Edit Bookmarks ^ 0 ^ sxmo_keyboard.sh open && sxmo_terminal.sh $EDITOR ~/.local/share/geopard/bookmarks.gemini
>- $icon_zmi Increase Font Size ^ 1 ^ sxmo_type -M Ctrl -k plus
>- $icon_zmo Decrease Font Size ^ 1 ^ sxmo_type -M Ctrl -k minus
>- $icon_arl History Back ^ 1 ^ sxmo_type -M Alt -k Left
>- $icon_arr History Forward ^ 1 ^ sxmo_type -M Alt -k Right
>- $icon_fnd URL Bar ^ 0 ^ sxmo_keyboard.sh open && sxmo_type -k F6
>- $icon_rld Refresh ^ 0 ^ sxmo_type -k F6 -k Return
>- "
>- WINNAME=Geopard
>- ;;
>- *lagrange*)
>- # Lagrange
>- CHOICES="
>- $icon_mnu Toggle sidebar ^ 0 ^ sxmo_type -M Shift -M Ctrl p
>- $icon_bok Open bookmarks ^ 0 ^ sxmo_type -M Ctrl l && sxmo_type 'about:bookmarks' -k Return
>- $icon_pls Add bookmark ^ 0 ^ sxmo_type -M Ctrl d
>- $icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k equal
>- $icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus
>- $icon_aru Parent dir ^ 1 ^ sxmo_type -M Alt -k Up
>- $icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left
>- $icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right
>- $icon_rld Refresh ^ 0 ^ sxmo_type -M Ctrl r
>- "
>- WINNAME=Lagrange
>- ;;
>- *mepo*)
>- # Mepo
>- # The choices / hotkeys for the contextmenu are generated through mepo's
>- # own scripting to be in congruence since the same menu can be launched
>- # via mepo's UI as well, this compatibility is available as of mepo 0.4
>- CHOICES="$(mepo_ui_central_menu.sh menuoptions | awk -F^ '{ print $1 "^ 0 ^ sxmo_type" $3 }')"
>- WINNAME=Mepo
>- ;;
>- *foxtrot*)
>- # Foxtrot GPS
>- CHOICES="
>- $icon_zmi Zoom ^ 1 ^ sxmo_type i
>- $icon_zmo Zoom ^ 1 ^ sxmo_type o
>- $icon_itm Panel Toggle ^ 1 ^ sxmo_type m
>- $icon_itm GPSD Toggle ^ 1 ^ sxmo_type a
>- "
>- WINNAME=Maps
>- ;;
>- *)
>- # Default system menu (no matches)
>- CHOICES="
>- $icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
>- $icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications
>- $icon_grd Binaries ^ 0 ^ sxmo_brun.sh
>- $icon_dir Files ^ 0 ^ sxmo_files.sh
>- $icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh
>- $icon_msg Texts ^ 0 ^ sxmo_modemtext.sh
>- $icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh
>- $(
>- rfkill list bluetooth | grep -q "yes" ||
>- printf %b "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
>- )
>- $(command -v megapixels >/dev/null && echo "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels")
>- $(
>- if [ -z "$SXMO_DISABLE_LEDS" ]; then
>- printf "%s Flashlight " "$icon_fll"
>- sxmo_led.sh get white | grep -vq ^100$ &&
>- printf %b "$icon_tof" || printf %b "$icon_ton";
>- printf %b "^ 1 ^ sxmo_flashtoggle.sh"
>- fi
>- )
>- $icon_net Networks ^ 0 ^ sxmo_networks.sh
>- $icon_mus Audio ^ 0 ^ sxmo_audio.sh
>- $icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem
>- $icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config
>- $icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power
>- "
>- WINNAME=Sys
>- ;;
>-esac
>-
>-printf "%b\n" "$WINNAME"
>-printf "%b\n" "$CHOICES"
>diff --git a/configs/menus/graphical/sxmo_menu_alacritty.sh b/configs/menus/graphical/sxmo_menu_alacritty.sh
>new file mode 100755
>index 0000000..75c3d38
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_alacritty.sh
>@@ -0,0 +1,25 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c"
>+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v"
>+write_line "$icon_vim VI Mode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k Space"
>+write_line "$icon_fnd Search Forward ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f"
>+write_line "$icon_fnd Search Backward ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b"
>+write_line "$icon_aru Search Previous ^ 1 ^ sxmo_type -k Enter"
>+write_line "$icon_ard Search Next ^ 1 ^ sxmo_type -M Shift -k Enter"
>+write_line "$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_falkon.sh b/configs/menus/graphical/sxmo_menu_falkon.sh
>new file mode 100755
>index 0000000..f023c7a
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_falkon.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
>+write_line "$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t"
>+write_line "$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n"
>+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
>+write_line "$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home"
>+write_line "$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_feh.sh b/configs/menus/graphical/sxmo_menu_feh.sh
>new file mode 100755
>index 0000000..e1b38f7
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_feh.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_arr Next ^ 1 ^ sxmo_type -k Space"
>+write_line "$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k up"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k down"
>+write_line "$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k slash"
>+write_line "$icon_shr Zoom to fill ^ 1 ^ sxmo_type '!'"
>+write_line "$icon_rol Rotate ^ 1 ^ sxmo_type -k less"
>+write_line "$icon_ror Rotate ^ 1 ^ sxmo_type -k greater"
>+write_line "$icon_a2y Flip ^ 1 ^ sxmo_type -k underscore"
>+write_line "$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar"
>+write_line "$icon_inf Toggle filename ^ 1 ^ sxmo_type d"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_firefox.sh b/configs/menus/graphical/sxmo_menu_firefox.sh
>new file mode 100755
>index 0000000..f023c7a
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_firefox.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
>+write_line "$icon_tab New Tab ^ 0 ^ sxmo_type -M Ctrl t"
>+write_line "$icon_win New Window ^ 0 ^ sxmo_type -M Ctrl n"
>+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
>+write_line "$icon_win Home ^ 0 ^ sxmo_type -M Alt -k Home"
>+write_line "$icon_zmo Full Screen ^ 0 ^ sxmo_type -k F11"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_foxtrot.sh b/configs/menus/graphical/sxmo_menu_foxtrot.sh
>new file mode 100755
>index 0000000..7465308
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_foxtrot.sh
>@@ -0,0 +1,21 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type i"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type o"
>+write_line "$icon_itm Panel Toggle ^ 1 ^ sxmo_type m"
>+write_line "$icon_itm GPSD Toggle ^ 1 ^ sxmo_type a"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_geopard.sh b/configs/menus/graphical/sxmo_menu_geopard.sh
>new file mode 100755
>index 0000000..57aee4c
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_geopard.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_pls New Tab ^ 0 ^ sxmo_type -M Ctrl t"
>+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type -M Ctrl w"
>+write_line "$icon_bok Open Bookmarks ^ 0 ^ sxmo_type -M Ctrl b"
>+write_line "$icon_pls Add Bookmark ^ 0 ^ sxmo_type -M Ctrl d"
>+write_line "$icon_edt Edit Bookmarks ^ 0 ^ sxmo_keyboard.sh open && sxmo_terminal.sh $EDITOR ~/.local/share/geopard/bookmarks.gemini"
>+write_line "$icon_zmi Increase Font Size ^ 1 ^ sxmo_type -M Ctrl -k plus"
>+write_line "$icon_zmo Decrease Font Size ^ 1 ^ sxmo_type -M Ctrl -k minus"
>+write_line "$icon_arl History Back ^ 1 ^ sxmo_type -M Alt -k Left"
>+write_line "$icon_arr History Forward ^ 1 ^ sxmo_type -M Alt -k Right"
>+write_line "$icon_fnd URL Bar ^ 0 ^ sxmo_keyboard.sh open && sxmo_type -k F6"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -k F6 -k Return"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_imv.sh b/configs/menus/graphical/sxmo_menu_imv.sh
>new file mode 100755
>index 0000000..00ec1cd
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_imv.sh
>@@ -0,0 +1,24 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_arr Next ^ 1 ^ sxmo_type -k Right"
>+write_line "$icon_arl Previous ^ 1 ^ sxmo_type -k Left"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k i"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus"
>+write_line "$icon_exp Zoom to fit ^ 1 ^ sxmo_type -k r"
>+write_line "$icon_ror Rotate ^ 1 ^ sxmo_type -M ctrl r"
>+write_line "$icon_inf Toggle filename ^ 1 ^ sxmo_type -k d"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_kasts.sh b/configs/menus/graphical/sxmo_menu_kasts.sh
>new file mode 100755
>index 0000000..beb27f1
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_kasts.sh
>@@ -0,0 +1,19 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_mus Audio ^ 0 ^ sxmo_audio.sh"
>+write_line "$icon_bth Bluetooth ^ 0 ^ sxmo_bluetoothmenu.sh"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_lagrange.sh b/configs/menus/graphical/sxmo_menu_lagrange.sh
>new file mode 100755
>index 0000000..3ca4154
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_lagrange.sh
>@@ -0,0 +1,26 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_mnu Toggle sidebar ^ 0 ^ sxmo_type -M Shift -M Ctrl p"
>+write_line "$icon_bok Open bookmarks ^ 0 ^ sxmo_type -M Ctrl l && sxmo_type 'about:bookmarks' -k Return"
>+write_line "$icon_pls Add bookmark ^ 0 ^ sxmo_type -M Ctrl d"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k equal"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
>+write_line "$icon_aru Parent dir ^ 1 ^ sxmo_type -M Alt -k Up"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Ctrl r"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_mepo.sh b/configs/menus/graphical/sxmo_menu_mepo.sh
>new file mode 100755
>index 0000000..bca0760
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_mepo.sh
>@@ -0,0 +1,22 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+# The choices / hotkeys for the contextmenu are generated through mepo's
>+# own scripting to be in congruence since the same menu can be launched
>+# via mepo's UI as well, this compatibility is available as of mepo 0.4
>+
>+write_line "mepo_ui_central_menu.sh menuoptions | awk -F^ '{ print $1 "^ 0 ^ sxmo_type" $3 }')"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_netsurf.sh b/configs/menus/graphical/sxmo_menu_netsurf.sh
>new file mode 100755
>index 0000000..2eed643
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_netsurf.sh
>@@ -0,0 +1,22 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Ctrl -k plus"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Ctrl -k minus"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Alt -k Left"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Alt -k Right"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_okular.sh b/configs/menus/graphical/sxmo_menu_okular.sh
>new file mode 100755
>index 0000000..785f8a0
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_okular.sh
>@@ -0,0 +1,26 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_cfg Touch $(
>+ sxmo_wm.sh inputevent touchscreen | grep -q on && \
>+ printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
>+ printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
>+)"
>+write_line "$icon_cfg Fullscreen ^ 0 ^ sxmo_type -k Ctrl -k Shift -k F"
>+write_line "$icon_cfg Menubar ^ 0 ^ sxmo_type -k Ctrl -k M"
>+write_line "$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F7"
>+write_line "$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_surf.sh b/configs/menus/graphical/sxmo_menu_surf.sh
>new file mode 100755
>index 0000000..fd3780c
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_surf.sh
>@@ -0,0 +1,30 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_glb Navigate ^ 0 ^ sxmo_type -M Ctrl g"
>+write_line "$icon_lnk Link Menu ^ 0 ^ sxmo_type -M Ctrl d"
>+write_line "$icon_flt Pipe URL ^ 0 ^ sxmo_urlhandler.sh"
>+write_line "$icon_fnd Search Page ^ 0 ^ sxmo_type -M Ctrl f"
>+write_line "$icon_fnd Find Next ^ 0 ^ sxmo_type -M Ctrl n"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl k"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -M Shift -M Ctrl j"
>+write_line "$icon_aru Scroll ^ 1 ^ sxmo_type -M Shift -k Space"
>+write_line "$icon_ard Scroll ^ 1 ^ sxmo_type -k Space"
>+write_line "$icon_itm JS Toggle ^ 1 ^ sxmo_type -M Shift -M Ctrl s"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Ctrl h"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Ctrl l"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -M Shift -M Ctrl r"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_sxiv.sh b/configs/menus/graphical/sxmo_menu_sxiv.sh
>new file mode 100755
>index 0000000..174f561
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_sxiv.sh
>@@ -0,0 +1,26 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_arr Next ^ 1 ^ sxmo_type -k Space"
>+write_line "$icon_arl Previous ^ 1 ^ sxmo_type -k BackSpace"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k equal"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k minus"
>+write_line "$icon_rol Rotate ^ 1 ^ sxmo_type -k less"
>+write_line "$icon_ror Rotate ^ 1 ^ sxmo_type -k greater"
>+write_line "$icon_a2y Flip ^ 1 ^ sxmo_type -k question"
>+write_line "$icon_a2x Mirror ^ 1 ^ sxmo_type -k bar"
>+write_line "$icon_grd Thumbnail ^ 0 ^ sxmo_type -k Return"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_vimb.sh b/configs/menus/graphical/sxmo_menu_vimb.sh
>new file mode 100755
>index 0000000..55ac960
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_vimb.sh
>@@ -0,0 +1,23 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_glb Navigate ^ 0 ^ sxmo_type -k Escape o && sxmo_keyboard.sh open"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -k Escape zi"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -k Escape zo"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Ctrl o"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Ctrl i"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type -k Escape r"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_xournal.sh b/configs/menus/graphical/sxmo_menu_xournal.sh
>new file mode 100755
>index 0000000..272a265
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_xournal.sh
>@@ -0,0 +1,30 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_cfg Touch $(
>+ sxmo_wm.sh inputevent touchscreen | grep -q on && \
>+ printf %b "$icon_ton ^ 0 ^ sxmo_wm.sh inputevent touchscreen off" || \
>+ printf %b "$icon_tof ^ 0 ^ sxmo_wm.sh inputevent touchscreen on"
>+)"
>+write_line "$icon_flt Open ^ 0 ^ sxmo_type -k Ctrl -k o"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -k Ctrl -k plus"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -k Ctrl -k minus"
>+write_line "$icon_zmi Next Page ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_zmo Prev Page ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_cfg Menubar ^ 0 ^ sxmo_type -k F10"
>+write_line "$icon_cfg Toolbars ^ 0 ^ sxmo_type -k F9"
>+write_line "$icon_cfg SXMO Bar ^ 0 ^ sxmo_wm.sh togglebar"
>\ No newline at end of file
>diff --git a/configs/menus/graphical/sxmo_menu_zathura.sh b/configs/menus/graphical/sxmo_menu_zathura.sh
>new file mode 100755
>index 0000000..f307777
>--- /dev/null
>+++ b/configs/menus/graphical/sxmo_menu_zathura.sh
>@@ -0,0 +1,26 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_flt Open ^ 0 ^ sxmo_type -k o"
>+write_line "$icon_zmi Zoom ^ 1 ^ sxmo_type -k plus"
>+write_line "$icon_zmo Zoom ^ 1 ^ sxmo_type -k minus"
>+write_line "$icon_arl History ^ 1 ^ sxmo_type -M Ctrl -k o"
>+write_line "$icon_arr History ^ 1 ^ sxmo_type -M Ctrl -k i"
>+write_line "$icon_cfg Invert ^ 0 ^ sxmo_type -M Ctrl -k r"
>+write_line "$icon_flt Index ^ 0 ^ sxmo_type -k Tab"
>+write_line "$icon_cfg Fit ^ 0 ^ sxmo_type -k a"
>+write_line "$icon_cfg Width mode ^ 0 ^ sxmo_type -k s"
>\ No newline at end of file
>diff --git a/configs/default_hooks/sxmo_hook_contextmenu_fallback.sh b/configs/menus/sxmo_menu_fallback.sh
>similarity index 99%
>rename from configs/default_hooks/sxmo_hook_contextmenu_fallback.sh
>rename to configs/menus/sxmo_menu_fallback.sh
>index 0e27649..8742108 100755
>--- a/configs/default_hooks/sxmo_hook_contextmenu_fallback.sh
>+++ b/configs/menus/sxmo_menu_fallback.sh
>@@ -1,4 +1,5 @@
> #!/bin/sh
>+
> # SPDX-License-Identifier: AGPL-3.0-only
> # Copyright 2022 Sxmo Contributors
>
>diff --git a/configs/menus/sxmo_menu_main.sh b/configs/menus/sxmo_menu_main.sh
>new file mode 100755
>index 0000000..6a8183d
>--- /dev/null
>+++ b/configs/menus/sxmo_menu_main.sh
>@@ -0,0 +1,86 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output the content of the contextual menu
>+# It should stdout the title as the first line followed by the entries
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+XPROPOUT="$(sxmo_wm.sh focusedwindow)"
>+WMCLASS="${1:-$(printf %s "$XPROPOUT" | grep app: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
>+
>+superd_service_isrunning() {
>+ superctl status "$1" | grep -q started
>+}
>+
>+sxmo_service_isrunning() {
>+ sxmo_daemons.sh running "$1" > /dev/null
>+}
>+
>+if [ -z "$XPROPOUT" ]; then
>+ sxmo_log "detected no active window, no problem, opening system menu"
>+else
>+ sxmo_log "opening menu for wmclass $WMCLASS"
>+fi
>+
>+case "$WMCLASS" in
>+ *foot*|*st*|*terminal*|org.gnome.vte.application|*alacritty*)
>+ # First we try to handle the app running inside the terminal:
>+ WMNAME="${1:-$(printf %s "$XPROPOUT" | grep title: | cut -d" " -f2- | tr '[:upper:]' '[:lower:]')}"
>+ case "$WMNAME" in
>+ vi|vim|vis|nvim|neovim|kakoune)
>+ printf "%b\n" "Vim"
>+ printf "%b\n" "$(sxmo_menu_vim.sh)"
>+ ;;
>+ 'git blame'|'git diff'|'git grep'|'git help'|'git log'|'git stash'|'git tag'|'git var')
>+ # These git commands only launch the pager.
>+ exec "$0" "$WMCLASS ${PAGER:-less}"
>+ ;;
>+ 'git add'|'git bugreport'|'git commit'|'git merge'|'git notes'|'git rebase'|'git replace'|'git send-email'|'git svn')
>+ # These git commands only launch the editor.
>+ exec "$0" "$WMCLASS $EDITOR"
>+ ;;
>+ sms|'missed call')
>+ number="$(printf "%s\n" "$WMNAME" | xargs -0 pnc find | tr -d '\n')"
>+ printf "%b\n" "phone"
>+ printf "%b\n" "$(sxmo_menu_phone.sh)"
>+ ;;
>+ *st*)
>+ STSELMODEON="$(
>+ printf %s "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '
>+ )"
>+ printf "%b\n" "St"
>+ printf "%b\n" "$(sxmo_menu_st.sh)"
>+ ;;
>+ *)
>+ if [ -z $(command -v sxmo_menu_$(echo $WMNAME | tr '[:upper:]' '[:lower:]').sh) ]; then
>+ printf "%b\n" "$(echo $WMCLASS | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')"
>+ printf "%b\n" "$(sxmo_menu_$(echo $WMCLASS | tr '[:upper:]' '[:lower:]').sh)"
>+ else
>+ printf "%b\n" "$(echo $WMNAME | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')"
>+ printf "%b\n" "$(sxmo_menu_$WMNAME.sh)"
>+ fi
>+ ;;
>+ esac
>+ ;;
>+ applications)
>+ # Apps Menu
>+ printf "%b\n" "Apps"
>+ printf "%b\n" "$(sxmo_menu_apps.sh)"
>+ ;;
>+ *)
>+ if [ -z $(command -v sxmo_menu_$(echo $WMCLASS | tr '[:upper:]' '[:lower:]').sh) ]; then
>+ printf "%b\n" "Sys"
>+ printf "%b\n" "$(sxmo_menu_sys.sh)"
>+ else
>+ printf "%b\n" "$(echo $WMCLASS | awk '{ print toupper(substr($0, 1, 1)) substr($0, 2) }')"
>+ printf "%b\n" "$(sxmo_menu_"$(echo $WMCLASS | tr '[:upper:]' '[:lower:]')".sh)"
>+ fi
>+ ;;
>+esac
>diff --git a/configs/menus/terminal/sxmo_menu_aerc.sh b/configs/menus/terminal/sxmo_menu_aerc.sh
>new file mode 100755
>index 0000000..68fa015
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_aerc.sh
>@@ -0,0 +1,23 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_pau Archive ^ 1 ^ sxmo_type ':archive flat' -k Return"
>+write_line "$icon_nxt Next Tab ^ 0 ^ sxmo_type ':next-tab' -k Return"
>+write_line "$icon_prv Previous Tab ^ 0 ^ sxmo_type ':prev-tab' -k Return"
>+write_line "$icon_cls Close Tab ^ 0 ^ sxmo_type ':close' -k Return"
>+write_line "$icon_itm Next Part ^ 1 ^ sxmo_type ':next-part' -k Return"
>+write_line "$icon_trm xdg-open Part ^ 0 ^ sxmo_type ':open' -k Return"
>\ No newline at end of file
>diff --git a/configs/default_hooks/sxmo_hook_apps.sh b/configs/menus/terminal/sxmo_menu_apps.sh
>similarity index 99%
>rename from configs/default_hooks/sxmo_hook_apps.sh
>rename to configs/menus/terminal/sxmo_menu_apps.sh
>index ba70a31..950d8b7 100755
>--- a/configs/default_hooks/sxmo_hook_apps.sh
>+++ b/configs/menus/terminal/sxmo_menu_apps.sh
>@@ -1,4 +1,5 @@
> #!/bin/sh
>+
> # SPDX-License-Identifier: AGPL-3.0-only
> # Copyright 2022 Sxmo Contributors
> # shellcheck disable=SC2154
>diff --git a/configs/menus/terminal/sxmo_menu_cmus.sh b/configs/menus/terminal/sxmo_menu_cmus.sh
>new file mode 100755
>index 0000000..db06813
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_cmus.sh
>@@ -0,0 +1,25 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_itm Play ^ 0 ^ cmus-remote -p"
>+write_line "$icon_pau Pause ^ 0 ^ cmus-remote -u"
>+write_line "$icon_stp Stop ^ 0 ^ cmus-remote -s"
>+write_line "$icon_nxt Next track ^ 0 ^ cmus-remote -n"
>+write_line "$icon_prv Previous track ^ 0 ^ cmus-remote -r"
>+write_line "$icon_rld Toggle repeat ^ 0 ^ cmus-remote -R"
>+write_line "$icon_sfl Toggle random ^ 0 ^ cmus-remote -S"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_config.sh b/configs/menus/terminal/sxmo_menu_config.sh
>new file mode 100755
>index 0000000..e786484
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_config.sh
>@@ -0,0 +1,59 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up"
>+write_line "$icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down"
>+write_line "$icon_cfg Touch $(
>+ sxmo_wm.sh inputevent touchscreen | grep -q on && \
>+ printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
>+ printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
>+ )"
>+write_line "$icon_cfg Stylus $(
>+ sxmo_wm.sh inputevent stylus | grep -q on && \
>+ printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
>+ printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
>+ )"
>+write_line "$icon_cfg Gestures $(
>+ superd_service_isrunning "sxmo_hook_lisgd" &&
>+ printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
>+ ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd'"
>+write_line "$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar"
>+write_line "$icon_bth Bluetooth $(
>+ rfkill list bluetooth | grep -q "yes" &&
>+ printf %b "$icon_tof" || printf %b "$icon_ton";
>+ printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
>+ )"
>+$(test "$SXMO_WM" = dwm && write_line "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
>+write_line "$icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh"
>+write_line "$icon_zzz Auto-suspend $(
>+ [ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
>+ ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.nosuspend || touch $XDG_CACHE_HOME/sxmo/sxmo.nosuspend)"
>+write_line "$icon_zzz Auto-screen-off $(
>+ [ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
>+ ) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_hook_unlock.sh"
>+write_line "$icon_ror Autorotate $(
>+ sxmo_daemons.sh running autorotate -q &&
>+ printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
>+ ) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh"
>+write_line "$icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate"
>+write_line "$icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh"
>+write_line "$icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh"
>+write_line "$icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh"
>+write_line "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/$(test "$SXMO_WM" = sway && printf sway || printf xinit)"
>+$(command -v pmos-tweaks >/dev/null && write_line "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
>+write_line "$icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_wakelock.sh debug watch"
>+write_line "$icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_foot.sh b/configs/menus/terminal/sxmo_menu_foot.sh
>new file mode 100755
>index 0000000..da95592
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_foot.sh
>@@ -0,0 +1,29 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c"
>+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus"
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next"
>+write_line "$icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u"
>+write_line "$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
>+write_line "$icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r"
>+write_line "$icon_aru Search Back ^ 1 ^ sxmo_type -M Ctrl -k r"
>+write_line "$icon_ard Search Forward ^ 1 ^ sxmo_type -M Ctrl -k s"
>+write_line "$icon_itm Search Extend ^ 1 ^ sxmo_type -M Ctrl -k w"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_git.sh b/configs/menus/terminal/sxmo_menu_git.sh
>new file mode 100755
>index 0000000..7de37a5
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_git.sh
>@@ -0,0 +1,20 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_fil ${PAGER:-less} menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS ${PAGER:-less}'"
>+write_line "$icon_edt $EDITOR menu ^ 0 ^ sxmo_appmenu.sh '$WMCLASS $EDITOR'"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_less.sh b/configs/menus/terminal/sxmo_menu_less.sh
>new file mode 100755
>index 0000000..554c0f0
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_less.sh
>@@ -0,0 +1,25 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_arr Page next ^ 1 ^ sxmo_type ':n' -k Return"
>+write_line "$icon_arl Page previous ^ 1 ^ sxmo_type ':p' -k Return"
>+write_line "$icon_cls Quit ^ 0 ^ sxmo_type q"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus"
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_micro.sh b/configs/menus/terminal/sxmo_menu_micro.sh
>new file mode 100755
>index 0000000..4bce367
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_micro.sh
>@@ -0,0 +1,30 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt"
>+write_line "$icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt"
>+write_line "$icon_sav Save ^ 1 ^ sxmo_type -M Ctrl s -m Ctrl"
>+write_line "$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl q -m Ctrl"
>+write_line "$icon_fnd Find ^ 0 ^ sxmo_type -M Ctrl f -m Ctrl"
>+write_line "$icon_fnd Find Previous ^ 1 ^ sxmo_type -M Ctrl p -m Ctrl"
>+write_line "$icon_fnd Find Next ^ 1 ^ sxmo_type -M Ctrl n -m Ctrl"
>+write_line "$icon_trm Command Bar ^ 0 ^ sxmo_type -M Ctrl e -m Ctrl"
>+write_line "$icon_cpy Copy ^ 0 ^ sxmo_type -M Ctrl c -m Ctrl"
>+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl v -m Ctrl"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_modem.sh b/configs/menus/terminal/sxmo_menu_modem.sh
>new file mode 100755
>index 0000000..45cc421
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_modem.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_plk Modem PIN ^ 0 ^ sxmo_unlocksim.sh"
>+write_line "$icon_phn Modem Monitor $(
>+ superd_service_isrunning sxmo_modemmonitor &&
>+ printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
>+ printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
>+ ) && sxmo_hook_statusbar.sh modem_monitor"
>+write_line "$icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem"
>+write_line "$icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh"
>+write_line "$icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh"
>+write_line "$icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh"
>+write_line "$icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_mpv.sh b/configs/menus/terminal/sxmo_menu_mpv.sh
>new file mode 100755
>index 0000000..0f0e616
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_mpv.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_pau Pause ^ 0 ^ sxmo_type -k Space"
>+write_line "$icon_fbw Seek ^ 1 ^ sxmo_type -k Left"
>+write_line "$icon_ffw Seek ^ 1 ^ sxmo_type -k Right"
>+write_line "$icon_aru App Volume ↑ ^ 1 ^ sxmo_type 0"
>+write_line "$icon_ard App Volume ↓ ^ 1 ^ sxmo_type 9"
>+write_line "$icon_aru Speed up ^ 1 ^ sxmo_type -k bracketRight"
>+write_line "$icon_ard Speed down ^ 1 ^ sxmo_type -k bracketLeft"
>+write_line "$icon_cam Screenshot ^ 1 ^ sxmo_type s"
>+write_line "$icon_itm Loopmark ^ 1 ^ sxmo_type l"
>+write_line "$icon_inf Info ^ 1 ^ sxmo_type i"
>+write_line "$icon_inf Seek Info ^ 1 ^ sxmo_type o"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_nano.sh b/configs/menus/terminal/sxmo_menu_nano.sh
>new file mode 100755
>index 0000000..4c2c111
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_nano.sh
>@@ -0,0 +1,27 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_sav Save ^ 0 ^ sxmo_type -M Ctrl o"
>+write_line "$icon_cls Quit ^ 0 ^ sxmo_type -M Ctrl x"
>+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl u"
>+write_line "$icon_itm Type complete ^ 0 ^ sxmo_type -M Shift -M Ctrl u"
>+write_line "$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Shift -M Ctrl i"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_ncmpcpp.sh b/configs/menus/terminal/sxmo_menu_ncmpcpp.sh
>new file mode 100755
>index 0000000..f2aaf4c
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_ncmpcpp.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_lst Playlist ^ 0 ^ sxmo_type 1"
>+write_line "$icon_fnd Browser ^ 0 ^ sxmo_type 2"
>+write_line "$icon_fnd Search ^ 0 ^ sxmo_type 3"
>+write_line "$icon_nxt Next track ^ 0 ^ sxmo_type -k greater"
>+write_line "$icon_prv Previous track ^ 0 ^ sxmo_type -k less"
>+write_line "$icon_pau Pause ^ 0 ^ sxmo_type p"
>+write_line "$icon_stp Stop ^ 0 ^ sxmo_type s"
>+write_line "$icon_rld Toggle repeat ^ 0 ^ sxmo_type r"
>+write_line "$icon_sfl Toggle random ^ 0 ^ sxmo_type z"
>+write_line "$icon_itm Toggle consume ^ 0 ^ sxmo_type R"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_phone.sh b/configs/menus/terminal/sxmo_menu_phone.sh
>new file mode 100755
>index 0000000..96411d6
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_phone.sh
>@@ -0,0 +1,32 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_msg Conversation ^ 0 ^ sxmo_terminal.sh sxmo_modemtext.sh conversationloop $number"
>+write_line "$icon_msg Reply ^ 0 ^ sxmo_modemtext.sh sendtextmenu $number"
>+write_line "$icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number"
>+ [ -d "$SXMO_LOGDIR/$number/attachments" ] && write_line "$icon_att View Attachments ^ 1 ^ sxmo_files.sh $SXMO_LOGDIR/$number/attachments --date-sort"
>+ found_numbers="$(printf %s "$number" | xargs -I{} pnc find "{}")"
>+ printf "%s\n" "$found_numbers" | while read -r line; do
>+ sxmo_contacts.sh --name "$line" | grep -q '???' && write_line "$icon_usr Add $line ^ 1 ^ sxmo_contactmenu.sh newcontact $line"
>+ done
>+ # if this is a group chain, then allow to add entire chain as a contact too
>+ if [ "$(printf "%s\n" "$found_numbers" | wc -l)" -gt 1 ]; then
>+ sxmo_contacts.sh --name "$number" | grep -q '???' && write_line "$icon_usr Add $number ^ 1 ^ sxmo_contactmenu.sh newcontact $number"
>+ fi
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -M Ctrl b"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -M Ctrl f"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_power.sh b/configs/menus/terminal/sxmo_menu_power.sh
>new file mode 100755
>index 0000000..fc87f36
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_power.sh
>@@ -0,0 +1,25 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_lck Lock ^ 0 ^ sxmo_hook_lock.sh"
>+write_line "$icon_lck Lock (Screen off) ^ 0 ^ sxmo_hook_screenoff.sh"
>+write_line "$icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout"
>+ [ -f "$(xdg_data_path xsessions/sxmo.desktop)" ] &&
>+ [ -f "$(xdg_data_path wayland-sessions/swmo.desktop)" ] &&
>+ write_line "$icon_rol Toggle WM ^ 0 ^ confirm Toggle && sxmo_power.sh togglewm"
>+write_line "$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot"
>+write_line "$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_scripts.sh b/configs/menus/terminal/sxmo_menu_scripts.sh
>new file mode 100755
>index 0000000..0ef36f7
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_scripts.sh
>@@ -0,0 +1,45 @@
>+#!/bin/sh
>+# configversion: 8fb4376641c86ac5e66d712f0cc0d087
>+# configversion: 79862f7af2e87209475e387e7abd17c0
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output the content of the scripts menu
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s ^ 0 ^ %s\n" "$1" "$2"
>+}
>+
>+get_title() {
>+ title=""
>+ eval "$(head "$1" | grep '# title="[^\\"]*"' | sed 's/^# //g')"
>+ if [ -n "$title" ]; then
>+ echo "$title"
>+ else
>+ basename="$(basename "$1")"
>+ echo "$icon_itm $basename"
>+ fi
>+}
>+
>+if [ -f "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
>+ cat "$XDG_CONFIG_HOME/sxmo/userscripts"
>+elif [ -d "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
>+ find -L "$XDG_CONFIG_HOME/sxmo/userscripts" -type f -o -type l | sort -f | while read -r script; do
>+ title="$(get_title "$script")"
>+ write_line "$title" "$script"
>+ done
>+fi
>+
>+write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
>+
>+# System Scripts
>+find "$(xdg_data_path sxmo/appscripts)" -type f -o -type l | sort -f | while read -r script; do
>+ title="$(get_title "$script")"
>+ write_line "$title" "$script"
>+done
>diff --git a/configs/menus/terminal/sxmo_menu_senpai.sh b/configs/menus/terminal/sxmo_menu_senpai.sh
>new file mode 100755
>index 0000000..e59b1cb
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_senpai.sh
>@@ -0,0 +1,23 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_ac1 Previous Buffer ^ 1 ^ sxmo_type -M Alt -k Left"
>+write_line "$icon_ac4 Next Buffer ^ 1 ^ sxmo_type -M Alt -k Right"
>+write_line "$icon_lst Toggle Channels ^ 0 ^ sxmo_type -k F7"
>+write_line "$icon_usr Toggle Members ^ 0 ^ sxmo_type -k F8"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_st.sh b/configs/menus/terminal/sxmo_menu_st.sh
>new file mode 100755
>index 0000000..0ce8876
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_st.sh
>@@ -0,0 +1,33 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u"
>+write_line "$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i"
>+write_line "$icon_itm Selmode $(
>+ [ "$STSELMODEON" = 1 ] &&
>+ printf %b "$icon_ton" ||
>+ printf %b "$icon_tof"
>+ printf %b '^ 0 ^ sxmo_type -M Ctrl -M Shift -k s'
>+)"
>+$([ "$STSELMODEON" = 1 ] && write_line "Copy selection ^ 0 ^ sxmo_type -M Ctrl -M Shift -k c")
>+write_line "$icon_pst Paste ^ 0 ^ sxmo_type -M Ctrl -M Shift -k v"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Prior"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -M Shift -k Next"
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl -M Shift -k b"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl -M Shift -k f"
>+write_line "$icon_a2x Invert ^ 1 ^ sxmo_type -M Ctrl -M Shift -k x"
>+write_line "$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_sthotkeys.sh b/configs/menus/terminal/sxmo_menu_sthotkeys.sh
>new file mode 100755
>index 0000000..f0d0a26
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_sthotkeys.sh
>@@ -0,0 +1,26 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "Send Ctrl-C ^ 0 ^ sxmo_type -M Ctrl -k c"
>+write_line "Send Ctrl-Z ^ 0 ^ sxmo_type -M Ctrl -k z"
>+write_line "Send Ctrl-L ^ 0 ^ sxmo_type -M Ctrl -k l"
>+write_line "Send Ctrl-D ^ 0 ^ sxmo_type -M Ctrl -k d"
>+write_line "Send Ctrl-A ^ 0 ^ sxmo_type -M Ctrl -k a"
>+write_line "Send Ctrl-B ^ 0 ^ sxmo_type -M Ctrl -k b"
>+write_line "Send ESC:w ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k Return"
>+write_line "Send ESC:wq ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k w -k q -k Return"
>+write_line "Send ESC:wq! ^ 0 ^ sxmo_type -k Escape -s 300 -M Shift -k semicolon -m Shift -k q -k exclam -k Return"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_sys.sh b/configs/menus/terminal/sxmo_menu_sys.sh
>new file mode 100755
>index 0000000..51fac10
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_sys.sh
>@@ -0,0 +1,41 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts"
>+write_line "$icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications"
>+write_line "$icon_grd Binaries ^ 0 ^ sxmo_brun.sh"
>+write_line "$icon_dir Files ^ 0 ^ sxmo_files.sh"
>+write_line "$icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh"
>+write_line "$icon_msg Texts ^ 0 ^ sxmo_modemtext.sh"
>+write_line "$icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh"
>+rfkill list bluetooth | grep -q "yes" || write_line "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
>+command -v megapixels >/dev/null && write_line "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels"
>+if [ -z "$SXMO_DISABLE_LEDS" ]; then
>+ if [ -d "$(locale | grep LANG | grep 'US|CA')" ]; then
>+ printf "%s Flashlight " "$icon_fll"
>+ else
>+ printf "%s Torch " "$icon_fll"
>+ fi
>+ sxmo_led.sh get white | grep -vq ^100$ &&
>+ printf %b "$icon_tof" || printf %b "$icon_ton";
>+ printf %b "^ 1 ^ sxmo_flashtoggle.sh\n"
>+fi
>+write_line "$icon_net Networks ^ 0 ^ sxmo_networks.sh"
>+write_line "$icon_mus Audio ^ 0 ^ sxmo_audio.sh"
>+write_line "$icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem"
>+write_line "$icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config"
>+write_line "$icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_terminal.sh b/configs/menus/terminal/sxmo_menu_terminal.sh
>new file mode 100755
>index 0000000..a582a55
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_terminal.sh
>@@ -0,0 +1 @@
>+$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_tuir.sh b/configs/menus/terminal/sxmo_menu_tuir.sh
>new file mode 100755
>index 0000000..4642684
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_tuir.sh
>@@ -0,0 +1,30 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_aru Previous ^ 1 ^ sxmo_type k"
>+write_line "$icon_ard Next ^ 1 ^ sxmo_type j"
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_ret Open ^ 0 ^ sxmo_type o"
>+write_line "$icon_arl Back ^ 0 ^ sxmo_type h"
>+write_line "$icon_arr Comments ^ 0 ^ sxmo_type l"
>+write_line "$icon_edt Post ^ 0 ^ sxmo_type c"
>+write_line "$icon_rld Refresh ^ 0 ^ sxmo_type r"
>+write_line "$icon_cls Quit ^ 0 ^ sxmo_type q"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_vim.sh b/configs/menus/terminal/sxmo_menu_vim.sh
>new file mode 100755
>index 0000000..21c72d3
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_vim.sh
>@@ -0,0 +1,31 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_cls Save and Quit ^ 0 ^ sxmo_type -k Escape -s 300 ':wq' -k Return"
>+write_line "$icon_sav Save ^ 0 ^ sxmo_type -k Escape -s 300 ':w' -k Return"
>+write_line "$icon_cls Quit without saving ^ 0 ^ sxmo_type -k Escape -s 300 ':q!' -k Return"
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -M Ctrl u"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -M Ctrl d"
>+write_line "$icon_trm Command prompt ^ 0 ^ sxmo_type -k Escape -s 300 ':'"
>+write_line "$icon_pst Paste Selection ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k asterisk -k p"
>+write_line "$icon_pst Paste Clipboard ^ 0 ^ sxmo_type -k Escape -s 300 -k quotedbl -k plus -k p"
>+write_line "$icon_fnd Search ^ 0 ^ sxmo_type -k Escape -s 300 /"
>+write_line "$icon_arr Next buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bn' -k Return"
>+write_line "$icon_arl Previous buffer ^ 1 ^ sxmo_type -k Escape -s 300 ':bp' -k Return"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_w3m.sh b/configs/menus/terminal/sxmo_menu_w3m.sh
>new file mode 100755
>index 0000000..d12a8a8
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_w3m.sh
>@@ -0,0 +1,28 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_arl Back ^ 1 ^ sxmo_type b"
>+write_line "$icon_glb Goto URL ^ 1 ^ sxmo_type u"
>+write_line "$icon_arr Next Link ^ 1 ^ sxmo_type -k Tab"
>+write_line "$icon_arl Previous Link ^ 1 ^ sxmo_type -M Shift -k Tab"
>+write_line "$icon_tab Open tab ^ 0 ^ sxmo_type t"
>+write_line "$icon_cls Close tab ^ 0 ^ sxmo_type -M Ctrl q"
>+write_line "$icon_itm Next tab ^ 1 ^ sxmo_type -k braceRight"
>+write_line "$icon_itm Previous tab ^ 1 ^ sxmo_type -k braceLeft"
>+write_line "$icon_zmi Zoom in ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_zmo Zoom out ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/menus/terminal/sxmo_menu_weechat.sh b/configs/menus/terminal/sxmo_menu_weechat.sh
>new file mode 100755
>index 0000000..b554139
>--- /dev/null
>+++ b/configs/menus/terminal/sxmo_menu_weechat.sh
>@@ -0,0 +1,24 @@
>+#!/bin/sh
>+
>+# SPDX-License-Identifier: AGPL-3.0-only
>+# Copyright 2022 Sxmo Contributors
>+
>+# This script will output config options.
>+
>+# include common definitions
>+# shellcheck source=scripts/core/sxmo_common.sh
>+. sxmo_common.sh
>+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
>+. sxmo_hook_icons.sh
>+
>+write_line() {
>+ printf "%s\n" "$1"
>+}
>+
>+write_line "$icon_msg Hotlist Next ^ 1 ^ sxmo_type -M Alt a"
>+write_line "$icon_arl History Previous ^ 1 ^ sxmo_type -M Alt -k Less"
>+write_line "$icon_arr History Next ^ 1 ^ sxmo_type -M Alt -k Greater"
>+write_line "$icon_trm Buffer ^ 0 ^ sxmo_type '/buffer '"
>+write_line "$icon_aru Scroll up ^ 1 ^ sxmo_type -k Prior"
>+write_line "$icon_ard Scroll down ^ 1 ^ sxmo_type -k Next"
>+write_line "$icon_mnu Terminal menu ^ 0 ^ sxmo_appmenu.sh $WMCLASS"
>\ No newline at end of file
>diff --git a/configs/profile.d/sxmo_init.sh b/configs/profile.d/sxmo_init.sh
>index 55baab3..2c7eaea 100644
>--- a/configs/profile.d/sxmo_init.sh
>+++ b/configs/profile.d/sxmo_init.sh
>@@ -113,8 +113,14 @@ _sxmo_load_environments() {
> PATH="\
> $XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME:\
> $XDG_CONFIG_HOME/sxmo/hooks:\
>+$XDG_CONFIG_HOME/sxmo/menus/:\
>+$XDG_CONFIG_HOME/sxmo/menus/terminal/:\
>+$XDG_CONFIG_HOME/sxmo/menus/graphical/:\
> $_device_hooks_path:\
> $(xdg_data_path "sxmo/default_hooks" 0 ':'):\
>+$(xdg_data_path "sxmo/menus" 0 ':'):\
>+$(xdg_data_path "sxmo/menus/terminal" 0 ':'):\
>+$(xdg_data_path "sxmo/menus/graphical" 0 ':'):\
> $PATH"
> export PATH
> else
>diff --git a/docs/sxmo.7.scd b/docs/sxmo.7.scd
>index 66856b5..5aaa0fd 100644
>--- a/docs/sxmo.7.scd
>+++ b/docs/sxmo.7.scd
>@@ -98,6 +98,9 @@ PATH to determine which hook executes. It will look first for hooks in
> For example, if you pickup
> a call and *~/.config/sxmo/hooks/sxmo_hook_pickup.sh* does not exist,
> */usr/share/sxmo/default_hooks/sxmo_hook_pickup.sh* will be run.
>+Menu system was removed from hooks and placed into it's own catagory called menus
>+(*sxmo_menu\*.sh). PATH will first check *~/.config/sxmo/menus/* then
>+in */usr/share/sxmo/menus/**.
>
> Note that some hooks are in a subdirectory under the *hooks/* main
> directory which will allow you to have hooks associated with a certain
>@@ -108,6 +111,7 @@ It should be a symlink to another subdirectory, e.g., *one_button_ereader* or
>
> While you can manually copy and edit hooks to your liking,
> _sxmo_hookmenu.sh_ (MENU > config > hooks) simplifies this process.
>+The same with menus, they can be edited to your liking.
>
> Note also that hooks do not have their own man pages. We have documented each
> hook in the comments of that hook.
>diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh
>index e45a54c..2a24e85 100755
>--- a/scripts/core/sxmo_appmenu.sh
>+++ b/scripts/core/sxmo_appmenu.sh
>@@ -70,7 +70,7 @@ call_entries() {
> }
>
> getprogchoices() {
>- RES="$(sxmo_hook_contextmenu.sh "$1")"
>+ RES="$(sxmo_menu_main.sh "$1")"
> if [ -n "$RES" ]; then
> WINNAME="$(printf %s "$RES" | head -n1)"
> CHOICES="$(printf %s "$RES" | tail -n+2)"
>@@ -128,7 +128,7 @@ mainloop() {
>
> if [ -z "$CMD" ]; then
> printf "%s\n" "sxmo_appmenu: Fallback: unknown choice <$PICKED> to contextmenu_fallback hook">&2
>- sxmo_hook_contextmenu_fallback.sh "$WINNAME" "$PICKED"
>+ sxmo_menu_fallback.sh "$WINNAME" "$PICKED"
> quit
> fi
>
>diff --git a/scripts/core/sxmo_migrate.sh b/scripts/core/sxmo_migrate.sh
>index 309987f..9d59ad0 100755
>--- a/scripts/core/sxmo_migrate.sh
>+++ b/scripts/core/sxmo_migrate.sh
>@@ -175,12 +175,26 @@ defaultconfig() {
> }
>
> checkhooks() {
>- if ! [ -e "$XDG_CONFIG_HOME/sxmo/hooks/" ]; then
>+ if [ -e "$XDG_CONFIG_HOME/sxmo/hooks/" ]; then
>+ HOME_HOOKS=1
>+ fi
>+ if [ -e "$XDG_CONFIG_HOME/sxmo/menus/" ]; then
>+ MENU_HOOKS=1
>+ fi
>+
>+ if [ -z "$HOME_HOOKS" ] && [ -z "$MENU_HOOKS" ]; then
> return
> fi
>+
> for hook in \
>- "$XDG_CONFIG_HOME/sxmo/hooks/"* \
>- ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME/"*}; do
>+ "$xdg_config_home/sxmo/hooks/"* \
>+ "$xdg_config_home/sxmo/menus/"* \
>+ "$xdg_config_home/sxmo/menus/terminal/"* \
>+ "$xdg_config_home/sxmo/menus/graphical/"* \
>+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME/"*} \
>+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/menus/"*} \
>+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/menus/terminal/"*} \
>+ ${SXMO_DEVICE_NAME:+"$XDG_CONFIG_HOME/sxmo/menus/graphical/"*}; do
> { [ -e "$hook" ] && [ -f "$hook" ];} || continue #sanity check because shell enters loop even when there are no files in dir (null glob)
>
> [ -h "$hook" ] && continue # shallow symlink
>@@ -188,11 +202,11 @@ checkhooks() {
> if printf %s "$hook" | grep -q "/$SXMO_DEVICE_NAME/"; then
> # We also compare the device user hook to the system
> # default version
>- DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/"$SXMO_DEVICE_NAME"/):$(xdg_data_path sxmo/default_hooks/)"
>+ DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/"$SXMO_DEVICE_NAME"/):$(xdg_data_path sxmo/default_hooks/):$(xdg_data_path sxmo/menus/terminal/):$(xdg_data_path sxmo/menus/graphical/):$(xdg_data_path sxmo/menus/)"
> else
> # We dont want to compare a default user hook to the device
> # system version
>- DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/)"
>+ DEFAULT_PATH="$(xdg_data_path sxmo/default_hooks/):$(xdg_data_path sxmo/menus/terminal/):$(xdg_data_path sxmo/menus/graphical/):$(xdg_data_path sxmo/menus/)"
> fi
>
> if [ "$MODE" = "reset" ]; then
>--
>2.40.1
>
--
sic dicit magister P
https://phartman.sites.luc.edu/
GPG keyID 0xE0DBD3D6 (CAE6 3A6F 755F 7BC3 36CA 330D B3E6 39C6 E0DB D3D6)