lock-screen 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. if [[ $# -eq 0 ]] ; then
  3. echo "lock-screen [ enable | disable | suspend | lock | start ]"
  4. exit
  5. fi
  6. case ${1} in
  7. locker-command)
  8. i3lock -c 536a77 -e -f -n
  9. ;;
  10. locker-command-fork)
  11. i3lock -c 536a77 -e -f
  12. ;;
  13. lock)
  14. ssh-add -D
  15. xidlehook-client --socket ~/.xidlehook.sock \
  16. control --action trigger --timer 0
  17. ;;
  18. start)
  19. rm ~/.xidlehook.sock
  20. xidlehook --socket ~/.xidlehook.sock \
  21. --not-when-fullscreen \
  22. --not-when-audio \
  23. --timer 300 "lock-screen locker-command" ""
  24. ;;
  25. disable)
  26. xidlehook-client --socket ~/.xidlehook.sock \
  27. control --action disable --timer 0
  28. ;;
  29. enable)
  30. xidlehook-client --socket ~/.xidlehook.sock \
  31. controll --action enable --timer 0
  32. ;;
  33. suspend)
  34. ssh-add -D
  35. lock-screen lock
  36. sleep 1
  37. systemctl suspend
  38. ;;
  39. hibernate)
  40. ssh-add -D
  41. lock-screen lock
  42. sleep 1
  43. systemctl hibernate
  44. ;;
  45. suspend-hibernate)
  46. ssh-add -D
  47. lock-screen lock
  48. sleep 1
  49. systemctl suspend-hibernate
  50. ;;
  51. *)
  52. echo "lock-screen [ enable | disable | lock | start ]"
  53. esac