Advertisement
Guest User

Untitled

a guest
Jan 5th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # xfce4
  4. #
  5. # Copyright (C) 1999, 2003 Olivier Fourdan (fourdan@xfce.org)
  6. # Copyright (C) 2011 Guido Berhoerster (guido+xfce.org@berhoerster.name)
  7. # Copyright (C) 2011 Jarno Suni (8@iki.fi)
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. #
  23.  
  24. PATH=/bin:/usr/bin
  25. export PATH
  26.  
  27. # Lock by xscreensaver, gnome-screensaver, or light-locker, if a respective daemon is running
  28. for lock_cmd in \
  29. "xscreensaver-command -lock" \
  30. "gnome-screensaver-command --lock" \
  31. "light-locker-command -l"
  32. do
  33. $lock_cmd >/dev/null 2>&1 && exit
  34. done
  35.  
  36. # else run another access locking utility, if installed
  37. for lock_cmd in \
  38. "xlock -mode blank" \
  39. "slock"
  40. do
  41. set -- $lock_cmd
  42. if command -v -- $1 >/dev/null 2>&1; then
  43. $lock_cmd >/dev/null 2>&1 &
  44. # turn off display backlight:
  45. xset dpms force off
  46. exit
  47. fi
  48. done
  49.  
  50. # else access locking failed
  51. exit 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement