Gnome and Windows have that feature that makes accessing application windows very easy: when you have an application "pinned" in your application list, pressing super
+1
takes you to the first pinned ap, super
+2
to the second, etc.
The killer property of this feature for me is that when the pinned application is already open its window is brought to the front instead of opening a new window of the application.
This saved me a lot of time, because i didn't have to perform the mental effort of calculating how many times to press alt+tab, whether or not I have the app open, etc. Now I just say to the computer "Bring me to the app X" and that's where I'm brought to.
This is a feature that I really miss on XFCE. Obviously I could create an application shortcut to run firefox
, but that would open a new Firefox window each time I press the key combination. Hardly useful.
So, I came up with a script of my own that does exactly that - I can bind it to whatever key combination my heart desires and make it run any app I want:
#!/bin/bash
CMD=$1
NOTIF_TIMEOUT=2000
if [ -n "$2" ]; then
CLASS=$2
else
CLASS=$CMD
fi
WINDOW_IDS=`xdotool search --class $CLASS`
while read -r id; do
if [[ $id = "" ]]; then
break
fi;
info=`xwinfo -s $id`;
if [[ $info != *"N/A"* ]]; then
if [[ $info != *"modal"* ]]; then
xdotool windowactivate $id;
exit 0;
fi
fi
result=$id$' '$info;
done <<< "$WINDOW_IDS"
notify-send "Starting $CLASS..." -i "$CLASS" -t $NOTIF_TIMEOUT
echo $CMD
$CMD
Use it like so:
$ ./raisewindow.sh firefox-developer-edition firefox
The first argument is the command to run, and the second is the app name. The script searches through windows with classnames matching the app name and brings it to focus.
I hope someone else finds it as useful as me