Advertisement
Guest User

Simple terminal toggle script

a guest
May 28th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. wid=$(xdotool search --classname st-256color)
  4.  
  5. if [ -z $wid ]
  6. then
  7.   st -e tmux
  8.   wid=$(xdotool search --classname st-256color)
  9.   xdotool windowfocus $wid
  10. elif [ -z $(xdotool search --onlyvisible --classname st-256color 2>/dev/null) ]
  11. then
  12.   xdotool windowmap $wid
  13.   xdotool windowfocus $wid
  14. else
  15.   xdotool windowsize --usehints $wid 100% 100%
  16.   xdotool windowunmap $wid
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement