29 lines
528 B
Bash
29 lines
528 B
Bash
![]() |
#!/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"
|
||
|
|