refactor
This commit is contained in:
parent
a31e08bd5f
commit
388924ed6e
16 changed files with 951 additions and 294 deletions
28
get_active_window.sh
Executable file
28
get_active_window.sh
Executable 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"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue