proof of concept for stevia (phosh-osk-stub) auto-changing shortcuts application-specifically
improve watch
Zach DeCook 2024-10-14
parent 94f4c3d · commit 69dedb1
-rwxr-xr-xpos-dyntercomms.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/pos-dyntercomms.sh b/pos-dyntercomms.sh
index 2110bd3..187912f 100755
--- a/pos-dyntercomms.sh
+++ b/pos-dyntercomms.sh
@@ -137,19 +137,11 @@ case "$activewmclass" in
;;
*micro*)
#Micro
+ c="'Prior','Next','<alt>Comma','<alt>Period','<ctrl>s','<ctrl>q','<ctrl>f','<ctrl>p','<ctrl>n','<ctrl>e','<ctrl>c','<ctrl>v'"
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
@@ -209,6 +201,7 @@ case "$activewmclass" in
;;
*aerc*)
#aerc
+ c="'<shift>a','<ctrl>n'"
CHOICES="
$icon_pau Archive ^ 1 ^ sxmo_type ':archive flat' -k Return
$icon_nxt Next Tab ^ 0 ^ sxmo_type ':next-tab' -k Return
@@ -666,7 +659,12 @@ gsettings set sm.puri.phosh.osk.Terminal shortcuts "[$c]"
}
if test "$1" = "--watch"; then
- socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" |grep 'activewindow>>' | while read -r line; do setComms; done
+ socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" |stdbuf -o0 grep 'activewindow>>' | while read -r line;
+ do
+ win="$(printf %s "$line" |cut -d '>' -f3 |cut -d , -f1)"
+ tit=$(printf %s "$line" |cut -d , -f2)
+ setComms "$win" "$tit"
+ done
else
setComms "$@"
fi