diff --git a/i3/config.m4 b/i3/config.m4 index b4a721a..ebd7860 100644 --- a/i3/config.m4 +++ b/i3/config.m4 @@ -146,9 +146,8 @@ bindsym $mod+Ctrl+l exec --no-startup-id loginctl lock-session exec --no-startup-id xset s 300 exec --no-startup-id xss-lock -lv /home/gebner/etc/lock.sh -exec_always --no-startup-id ifelse(hostname, -[theba], [feh --bg-fill ~/Pictures/20140915-133957-DSC_7414.jpg], -[xsetroot -solid grey]) +exec_always --no-startup-id xsetroot -solid grey +exec_always --no-startup-id feh --bg-fill /home/gebner/Desktop/background.png ifelse(hostname, [theba], [ workspace 1 output eDP1 diff --git a/lock.sh b/lock.sh index e0f79f2..b594d39 100755 --- a/lock.sh +++ b/lock.sh @@ -1,17 +1,18 @@ #!/usr/bin/env bash -# Options to pass to i3lock -i3lock_options="-c 777777" +do_lock() { + bg_file=$HOME/Desktop/background.png + if test -f $bg_file && which i3lock-color >/dev/null 2>&1; then + i3lock-color -i $bg_file "$@" + else + i3lock -c 777777 "$@" + fi +} -xset +dpms dpms 5 5 5 +xset +dpms dpms 10 10 10 revert_dpms() { xset dpms 0 0 0; } trap revert_dpms EXIT -pre_xset_dpms_sleep=0.1 -[ "$HOSTNAME" = decoysnail ] && pre_xset_dpms_sleep=0.5 - -# pre_lock - # We set a trap to kill the locker if we get killed, then start the locker and # wait for it to exit. The waiting is not that straightforward when the locker # forks, so we use this polling only if we have a sleep lock to deal with. @@ -23,7 +24,7 @@ if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then trap kill_i3lock TERM INT # we have to make sure the locker does not inherit a copy of the lock fd - i3lock $i3lock_options {XSS_SLEEP_LOCK_FD}<&- + do_lock {XSS_SLEEP_LOCK_FD}<&- # now close our fd (only remaining copy) to indicate we're ready to sleep exec {XSS_SLEEP_LOCK_FD}<&- @@ -33,9 +34,6 @@ if [[ -e /dev/fd/${XSS_SLEEP_LOCK_FD:--1} ]]; then done else trap 'kill %%' TERM INT - i3lock -n $i3lock_options & - sleep $pre_xset_dpms_sleep; xset dpms force off + do_lock -n & wait fi - -# post_lock