This commit is contained in:
zerf58 2025-06-13 16:09:14 -07:00
parent a31e08bd5f
commit 388924ed6e
16 changed files with 951 additions and 294 deletions

28
get_active_window.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
shopt -s nocasematch # ignore case for website titles
websites=("youtube" "youtube" "pbs")
### get active window
active="$(xdotool getactivewindow getwindowclassname)"
name="$(xdotool getactivewindow getwindowname)"
active="${active,,}"
case "$active" in
*"firefox" )
for ws in "${websites[@]}"; do
if [[ "$name" == *"$ws"* ]]; then
active+="_$ws"
break
fi
done
;;
*"steam")
if [[ "$name" == *"picture"* ]]; then
active+="_big"
else
active+="_little"
fi
;;
esac
echo "$active"