Skip to content

Instantly share code, notes, and snippets.

@kfreiman
Last active July 17, 2019 09:18
Show Gist options
  • Save kfreiman/ce2b4d45a23a8c7d3ecd0192e29f257d to your computer and use it in GitHub Desktop.
Save kfreiman/ce2b4d45a23a8c7d3ecd0192e29f257d to your computer and use it in GitHub Desktop.
show hide alacritty by hotkey (xdotool)
#!/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