From c30c2062ad3439fd59e2f86c26e7f4bc6348555a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 15 Sep 2012 10:04:34 +0200 Subject: [PATCH] xlock: move xautolock and notify stuff into shell scripts --- bin/notify-lock | 8 ++++++++ bin/xautolock | 10 ++++++++++ rc/xlock.lua | 10 +++------- 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100755 bin/notify-lock create mode 100755 bin/xautolock diff --git a/bin/notify-lock b/bin/notify-lock new file mode 100755 index 0000000..68f0309 --- /dev/null +++ b/bin/notify-lock @@ -0,0 +1,8 @@ +#!/bin/sh + +icon="$1" + +exec notify-send "Lock screen" \ + ${icon:+-i $icon} \ + -t 10000 \ + "Lock screen will be started in 10 seconds..." diff --git a/bin/xautolock b/bin/xautolock new file mode 100755 index 0000000..a3337e1 --- /dev/null +++ b/bin/xautolock @@ -0,0 +1,10 @@ +#!/bin/sh + +icon="$1" +notify=$(dirname $(readlink -f "$0"))/notify-lock + +exec xautolock \ + -time 4 \ + -locker "i3lock -n -i $HOME/.cache/awesome/current-wallpaper.png" \ + -notify 10 \ + -notifier "$notify $icon" diff --git a/rc/xlock.lua b/rc/xlock.lua index fa6d8e1..27bb03c 100644 --- a/rc/xlock.lua +++ b/rc/xlock.lua @@ -3,13 +3,9 @@ local icons = loadrc("icons", "vbe/icons") xrun("xautolock", - "xautolock -notify 10 -notifier " .. - " 'notify-send Lock\\ screen -i " .. - icons.lookup({name = "system-lock-screen", type = "actions" }) .. - " -t 10000 " .. - " Lock\\ screen\\ will\\ be\\ started\\ in\\ 10\\ seconds...' " .. - " -time 3 -locker " .. - " 'i3lock -n -i " .. awful.util.getdir("cache") .. "/current-wallpaper.png'") + awful.util.getdir("config") .. + "/bin/xautolock " .. + icons.lookup({name = "system-lock-screen", type = "actions" })) config.keys.global = awful.util.table.join( config.keys.global,