From af6f3b94793d9f173aef3b7c04c4f12c8d4f900f Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Tue, 2 Feb 2016 14:54:20 +0100 Subject: [PATCH] add autolock stuff --- autolock.sh | 6 ++++++ init.sh | 1 + qtile_config.py | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 autolock.sh diff --git a/autolock.sh b/autolock.sh new file mode 100755 index 0000000..a2cce5f --- /dev/null +++ b/autolock.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +exec xautolock -detectsleep \ + -time 15 -locker "i3lock -c 000000" \ + -notify 30 \ + -notifier "notify-send -u critical -t 10000 -- 'LOCKING screen in 30 seconds'" diff --git a/init.sh b/init.sh index f2b0199..e7c38cd 100755 --- a/init.sh +++ b/init.sh @@ -5,6 +5,7 @@ ln -snf `pwd`/tmux.conf ~/.tmux.conf ln -snf `pwd`/qtile_config.py ~/.config/qtile/config.py ln -snf `pwd`/gitconfig ~/.gitconfig ln -snf `pwd`/gitignore ~/.gitignore +ln -snf `pwd`/autolock.sh ~/.autolock.sh echo "Installing oh-my-zsh..." sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" diff --git a/qtile_config.py b/qtile_config.py index e72ad43..f6be391 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -25,10 +25,11 @@ # SOFTWARE. import os +import subprocess from libqtile.config import Key, Screen, Group, Drag, Click from libqtile.command import lazy -from libqtile import layout, bar, widget +from libqtile import layout, bar, widget, hook mod = "mod4" @@ -81,7 +82,7 @@ keys = [ lazy.layout.toggle_split() ), Key([mod], "Return", lazy.spawn("terminator")), - Key(["control", "mod1"], "l", lazy.spawn("i3lock -c 000000")), + Key(["control", "mod1"], "l", lazy.spawn("xautolock -locknow")), # Toggle between different layouts as defined below Key([mod], "Tab", lazy.next_layout()),