2024-12-04 22:53:37 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
active_window=$(swaymsg -t get_tree |jq -r '..|try select(.focused == true) |.app_id')
|
|
|
|
|
|
|
|
if [ "$1" = "btn1" ]; then
|
|
|
|
if [ "$active_window" = "anki" ]; then
|
|
|
|
wtype " "
|
|
|
|
elif [ "$active_window" = "foot" ]; then
|
2024-12-08 03:18:00 -05:00
|
|
|
wtype -M ctrl -M shift -k c -m ctrl -m shift
|
|
|
|
elif [ "$active_window" = "chromium-browser" ]; then
|
|
|
|
wtype -M alt -P right -p right -m alt
|
2024-12-04 22:53:37 -05:00
|
|
|
else
|
2024-12-08 03:18:00 -05:00
|
|
|
wtype -M ctrl -k c -m ctrl
|
2024-12-04 22:53:37 -05:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ "$active_window" = "anki" ]; then
|
|
|
|
wtype "1"
|
|
|
|
elif [ "$active_window" = "foot" ]; then
|
|
|
|
wtype -M ctrl -M shift -k v
|
2024-12-06 01:54:12 -05:00
|
|
|
wtype -m ctrl
|
2024-12-08 03:18:00 -05:00
|
|
|
elif [ "$active_window" = "chromium-browser" ]; then
|
|
|
|
wtype -M alt -P left -p left -m alt
|
2024-12-04 22:53:37 -05:00
|
|
|
else
|
|
|
|
wtype -M ctrl -k v
|
2024-12-06 01:54:12 -05:00
|
|
|
wtype -m ctrl
|
2024-12-04 22:53:37 -05:00
|
|
|
fi
|
|
|
|
fi
|