proof of concept for stevia (phosh-osk-stub) auto-changing shortcuts application-specifically
-rwxr-xr-xpos-dyntercomms.sh7
-rw-r--r--pos-dyntercomms.sh.1.scd34
2 files changed, 39 insertions, 2 deletions
diff --git a/pos-dyntercomms.sh b/pos-dyntercomms.sh
index 22e4a43..e9de0a3 100755
--- a/pos-dyntercomms.sh
+++ b/pos-dyntercomms.sh
@@ -8,7 +8,7 @@ setComms(){
activewmclass="$1"
activetitle="$2"
if ! test "$activewmclass"; then
- json="$(hyprctl -j -i 0 activewindow)"
+ json="$(hyprctl -j activewindow)"
activewmclass="$(printf "%s" "$json" | jq -r .class)"
activetitle="$(printf "%s" "$json" | jq -r .title)"
fi
@@ -137,7 +137,7 @@ 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','<ctrl>z','<ctrl>y'"
+ c="'Prior','Next','<alt>comma','<alt>period','<ctrl>s','<ctrl>q','<ctrl>f','<ctrl>p','<ctrl>n','<ctrl>e','<ctrl>c','<ctrl>v','<ctrl>z','<ctrl>y'"
CHOICES="
$icon_prv Previous Tab ^ 1 ^ sxmo_type -M Alt , -m Alt
$icon_nxt Next Tab ^ 1 ^ sxmo_type -M Alt . -m Alt
@@ -514,6 +514,9 @@ case "$activewmclass" in
c="'<ctrl>equal','<ctrl>minus','<ctrl><shift>F','<ctrl>f','<ctrl>r','<ctrl>d','<ctrl>l'"
WINNAME=Maps
;;
+ org.gnome.Loupe)
+ c="'Left','Right'"
+ ;;
*mepo*)
# Mepo
# The choices / hotkeys for the contextmenu are generated through mepo's
diff --git a/pos-dyntercomms.sh.1.scd b/pos-dyntercomms.sh.1.scd
new file mode 100644
index 0000000..c66f9b3
--- /dev/null
+++ b/pos-dyntercomms.sh.1.scd
@@ -0,0 +1,34 @@
+pos-dyntercomms.sh(1)
+
+# NAME
+phosh-osk-stub dynamic terminal commands - reconfigure terminal shortcuts automatically
+
+# SYNOPSIS
+
+*pos-dyntercomms.sh* _windowclass_ _WindowTitle_
+
+*pos-dyntercomms.sh*
+
+*pos-dyntercomms.sh* _--watch_
+
+
+# OPTIONS
+_--watch_
+ Monitor the window title for changes over IPC.
+
+_windowclass_
+ The class of the window (name of the running program)
+
+_WindowTitle_
+ The title of the window
+
+# DESCRIPTION
+
+When ran with arguments _windowclass_ and _WindowTitle_, changes phosh-osk-stub's Terminal shortcuts to appropriate shortcuts for that program.
+
+When ran without arguments, picks up the _windowclass_ and _WindowTitle_ from the active compositor. (currently only works with Hyprland, using hyprctl).
+
+When ran with _--watch_, monitors the active compositor for title changes and changes the shortcuts as the title changes. (currently only works with Hyprland, using IPC).
+
+# SEE ALSO
+*phosh-osk-stub*(1) *Hyprland*(1) *hyprctl*(1)