Last active
July 17, 2019 09:18
-
-
Save kfreiman/ce2b4d45a23a8c7d3ecd0192e29f257d to your computer and use it in GitHub Desktop.
show hide alacritty by hotkey (xdotool)
This file contains hidden or 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
#!/bin/bash | |
# activate and rise or hide alacritty terminal window | |
# xdotool required. For ubuntu/debian: `sudo apt install xdotool` | |
alacrittyid=$(xdotool search --desktop 0 --class alacritty) | |
currentid=$(xdotool getactivewindow) | |
if [ -z $alacrittyid ] | |
then | |
alacritty | |
elif [ $alacrittyid != $currentid ] | |
then | |
xdotool search --desktop 0 --class alacritty windowactivate | |
xdotool search --desktop 0 --class alacritty windowfocus | |
else | |
xdotool search --desktop 0 --class alacritty windowminimize | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment