summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-19 16:27:05 +0200
committerKyren223 <Kyren223@proton.me>2024-11-19 16:27:05 +0200
commitb0de96b1b80706094f8155f56eb28fc1ca5310aa (patch)
tree075fb6396a19c77dd3e67bde5b4914fda4bd87df /scripts
parent7bb4afe3fe024954a18448784ef4c8ebbb0a24db (diff)
Fixed telescope fzf-native issue
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/focus_app.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/focus_app.sh b/scripts/focus_app.sh
index 955a15d..11c23c4 100755
--- a/scripts/focus_app.sh
+++ b/scripts/focus_app.sh
@@ -1,9 +1,9 @@
-APP=$1
-WID=$(xdotool search --class "$APP" | head -n 1)
-
-if [ -z "$WID" ]; then
- nohup $APP &>/dev/null &
+if xdotool search --class "firefox" getwindowname %@ | grep -q "firefox"; then
+if xdotool search --onlyvisible --class "firefox" windowactivate %@; then
+ echo "firefox is focused. Minimizing."
+ xdotool search --onlyvisible --class "firefox" windowminimize %@
else
- xdotool windowactivate "$WID"
+ echo "firefox is open but not focused. Focusing the existing instance."
+ xdotool search --class "firefox" windowactivate %@
fi