From b0de96b1b80706094f8155f56eb28fc1ca5310aa Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 19 Nov 2024 16:27:05 +0200 Subject: Fixed telescope fzf-native issue --- scripts/focus_app.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts/focus_app.sh') 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 -- cgit v1.3.1