Skip to content

Instantly share code, notes, and snippets.

@kfreiman
Created September 18, 2018 09:04
Show Gist options
  • Save kfreiman/dbb13ec0a03c47bb44b8e54dbeea0fab to your computer and use it in GitHub Desktop.
Save kfreiman/dbb13ec0a03c47bb44b8e54dbeea0fab to your computer and use it in GitHub Desktop.
xfce hotkey show or hide window via xdotool
#!/bin/bash
# execute this script by setted hotkey in keyboard preferences
# this example operates with hyper-terminal
hyperid=$(xdotool search --desktop 0 --class hyper)
currentid=$(xdotool getactivewindow)
if [ -z $hyperid ]
then
hyper
elif [ $hyperid != $currentid ]
then
xdotool search --desktop 0 --class hyper windowactivate
xdotool search --desktop 0 --class hyper windowfocus
else
xdotool search --desktop 0 --class hyper windowminimize
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment