allow running find_or_open as standalone

This commit is contained in:
zerf58 2025-06-18 09:27:25 -07:00
parent 847ecd0214
commit fa119a8d4f
3 changed files with 14 additions and 8 deletions

View file

@ -1,5 +1,5 @@
#!/bin/bash
helper_find_or_open(){
find_or_open(){
windows=$(wmctrl -l)
if [[ "${windows,,}" == *"$1"* ]]; then
xdotool windowactivate "$(wmctrl -l | grep -i "$1" | cut -d " " -f 1)"
@ -9,3 +9,7 @@ helper_find_or_open(){
echo "opening $1"
fi
}
if [[ ! -z $1 ]]; then
find_or_open $1
fi