NoPaste

xflock

von Blackbox
Beschreibung:
xflock
Snippet erstellt:
06.04.2018 09:07:34
Snippet wird automatisch gelöscht:
Niemals

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

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. Alternativ kannst du den gesamten Eintrag auch als Datei herunterladen.