Last active
September 13, 2022 21:37
-
-
Save fabioam/1c12bd455eca57cab71e67b8cee7c434 to your computer and use it in GitHub Desktop.
Run cool-retro-term as Guake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script searchs for the application with the | |
# given classname. There are three possibilities: | |
# 1. If the app is not open, opens it | |
# 2. If the app is open but is not the active window, activates it | |
# 3. If the app is open AND is the active window, minimizes it# | |
# The idea is to assign this script to keyboard shortcuts in order | |
# to launch/activate/minimize a common used application quickly | |
# | |
# Requieres 'xdotool' installed | |
APPNAME="$1" | |
WINDOWIDS=( $(xdotool search --class $APPNAME) ) | |
ACTIVEWINDOW=$(xdotool getactivewindow) | |
if [ -n "$WINDOWIDS" ]; then | |
for i in "${WINDOWIDS[@]}" | |
do | |
# si es la ventana activa la miniza, si no, la activa | |
if [ "$i" == "$ACTIVEWINDOW" ]; then | |
xdotool windowminimize $i & | |
else | |
xdotool windowactivate $i & | |
fi | |
done | |
else | |
$APPNAME "${@:2}" & | |
fi |
Author
fabioam
commented
Mar 16, 2018
- Create a executable file with content above (Ex: ~/bin/runapp.sh)
- Create a shortcut to this app + cool-retro-term command: "Ex: ~/bin/runapp.sh cool-retro-term --fullscreen"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment