summaryrefslogtreecommitdiffstats
path: root/screen-locker.sh
blob: d0eb820b8d5124abfe16fdf82d8bc9cabf87e610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#----------------------------------------------------
# Author:       Florian "Bluewind" Pritz <flo@xssn.at>
#
# Licensed under WTFPL v2
#   (see COPYING for full license text)
#    
#----------------------------------------------------
# managing script for locking the screen
#----------------------------------------------------

lock () {
  gajim-remote change_status away &
  echo "command /away afk" | ssh mistral 'socat stdin unix-connect:.irssi/socket'
  xset dpms 5 5 5
  slock 
}

unlock () {
  xset dpms 0 0 0
  gajim-remote change_status online &
  echo "command /away" | ssh mistral 'socat stdin unix-connect:.irssi/socket'
}

if pidof slock &> /dev/null; then exit 1; fi

(lock && unlock) &