Advertisement
Guest User

autounclutter

a guest
Nov 14th, 2014
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # It is a program named autoclutter, and it is sensing if flash player is in
  4. # fullscreen and than it will hide the cursor with the unclutter command.
  5. # It will also hide when the mouse cursor is on the right edge of the screen.
  6. # You will need packages: unclutter xdotool
  7. #
  8. # Under license GPLv3
  9. # Made by té
  10.  
  11. resx=`xdpyinfo | grep dimensions | sed 's/[a-z :]*//' | sed 's/\([0-9]*\).*/\1/'`
  12.  
  13. while true; do
  14. if ((xwininfo -tree -root | grep plugin | grep $resx > /dev/null) || (xdotool getmouselocation | grep `expr $resx - 1` > /dev/null))
  15. then
  16. ps aux | grep -v defunct | grep -v grep | grep -v autounclutter | grep unclutter > /dev/null || unclutter -idle 3 -jitter 50 &
  17. else
  18. ps aux | grep -v defunct | grep -v grep | grep -v autounclutter | grep unclutter > /dev/null && killall unclutter > /dev/null
  19. fi
  20. sleep 3; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement