wyatt8740

X11 window hider

Jul 27th, 2014
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. #! /bin/sh
  2. #REQUIRES XDOTOOL
  3. #hidewindow - an X11 window-hiding shellscript
  4. #hides current window, writes it's ID to a file at ~/hidden so showwindow can unhide it
  5. #for best results, assign to a keyboard shortcut.
  6.  
  7. xdotool windowunmap `xdotool getwindowfocus | tee -a $HOME/hidden`
  8.  
  9.  
  10.  
  11. #! /bin/bash
  12. #showwindow - an X11 window-unhiding shellscript
  13. #requires bash and xdotool
  14. #shows most recently hidden window first, run again to unhide the window hidden before that.
  15. #only works if ~/hidden has the window ID's, hidewindow should write window ID's.
  16. #for best results, assign to a keyboard shortcut.
  17.  
  18. export WINDOWID=`awk '/./{line=$0} END{print line}' $HOME/hidden`
  19. if [[ -n "$WINDOWID" ]]; then
  20.   xdotool windowmap $WINDOWID
  21.   sed -i '/'${WINDOWID}'/d' $HOME/hidden
  22.   export WINDOWID=
  23. else
  24.   echo "No hidden (unmapped) windows found in '$HOME/hidden'."
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment