wyatt8740

Hiding windows in X11

Oct 18th, 2014
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. #Map these to keyboard shortcuts to hide and show windows with the commands. hidewindow.sh hides the currently focused window, and showwindow.sh unhides the most recently hidden windows in reverse order.
  2. #Requires xdotool
  3.  
  4. #hidewindow.sh
  5. #! /bin/sh
  6. xdotool windowunmap `xdotool getwindowfocus | tee -a $HOME/hidden`
  7.  
  8. #showwindow.sh
  9. #! /bin/bash
  10. export WINDOWID=`awk '/./{line=$0} END{print line}' $HOME/hidden`
  11. if [[ -n "$WINDOWID" ]]; then
  12.   xdotool windowmap $WINDOWID
  13.   sed -i '/'${WINDOWID}'/d' $HOME/hidden
  14.   export WINDOWID=
  15. else
  16.   echo "No hidden (unmapped) windows found in '$HOME/hidden'."
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment