Skip to content

Instantly share code, notes, and snippets.

@AloisJanicek
Created September 30, 2014 04:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AloisJanicek/29c0f3b4e675f6869db2 to your computer and use it in GitHub Desktop.
Save AloisJanicek/29c0f3b4e675f6869db2 to your computer and use it in GitHub Desktop.
Toggle urxvt
#!/bin/sh
wid=$(xdotool search --classname urxvt)
if [ -z $wid ]
then
urxvt -e sh -c "tmux"
wid=$(xdotool search --classname urxvt)
xdotool windowfocus $wid
elif [ -z $(xdotool search --onlyvisible --classname urxvt 2>/dev/null) ]
then
xdotool windowmap $wid
xdotool windowfocus $wid
else
xdotool windowunmap $wid
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment