From fb9854e79be9b9420c7c4d7aa61e7f57ffeeed27 Mon Sep 17 00:00:00 2001 From: Lilian Roller Date: Mon, 24 Jun 2019 15:33:51 +0200 Subject: [PATCH] lock screen --- README.md | 7 +++++++ defaults/main.yml | 2 ++ templates/config.j2 | 8 ++++++-- vars/Archlinux.yml | 3 +++ vars/Debian.yml | 3 +++ vars/RedHat.yml | 3 +++ vars/main.yml | 2 +- 7 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bf47aa1..4804962 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,14 @@ Including an example of how to use your role (for instance, with variables passe *`vars/main.yml`* ```bash + # background image i3_desktop_background: "~/Bilder/wallpaper.jpg" + # additional programms you need i3_packages_extra: - ranger + # you want additional keybindings? i3_keybindings_extra: - keybinding: name: Volume (mute/unmute) @@ -52,6 +55,7 @@ Including an example of how to use your role (for instance, with variables passe key: $mod+Shift+F12 exec: --no-startup-id amixer sset Master 40% + # how your monitors are configured i3_monitors: - monitor: id: 1 @@ -68,6 +72,7 @@ Including an example of how to use your role (for instance, with variables passe rotate: "normal" workspaces: [7,8,9,0] + # startup applications i3_applications: - application: class: "Firefox" @@ -80,4 +85,6 @@ Including an example of how to use your role (for instance, with variables passe workspace: 7 on_startup: true + # lock your screen after 3 hours + enable_lock_after_time: true ``` diff --git a/defaults/main.yml b/defaults/main.yml index 44c6f15..dec98b7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -41,3 +41,5 @@ submodules_versioncheck: true i3wm_copy_wallpapers: true disable_screensaver: true +enable_lock_after_time: false +lock_after_time: '200' # minutes to wait until your screen is locked diff --git a/templates/config.j2 b/templates/config.j2 index 062032c..37dc5d7 100644 --- a/templates/config.j2 +++ b/templates/config.j2 @@ -153,7 +153,7 @@ bar { } # Setup Monitors -exec sleep 2 && xrandr {% for monitor in i3_monitors %} --output {{ monitor.output }} --mode {{ monitor.mode }} --pos {{ monitor.pos }} --rotate {{ monitor.rotate }} {% endfor %} +exec_always sleep 1 && xrandr {% for monitor in i3_monitors %} --output {{ monitor.output }} --mode {{ monitor.mode }} --pos {{ monitor.pos }} --rotate {{ monitor.rotate }} {% endfor %} # Background {% if i3_desktop_background is defined %} @@ -162,11 +162,15 @@ exec_always feh --bg-scale {{ i3_desktop_background }} {% if disable_screensaver | bool %} # Disable screensaver by default -exec xset s off +exec_always xset s off exec xset -dpms {% endif %} exec compton +{% if enable_lock_after_time | bool %} +exec xautolock -time {{ lock_after_time }} -locker 'scrot /tmp/screen_locked.png; mogrify -scale 10% -scale 1000% /tmp/screen_locked.png; i3lock -i /tmp/screen_locked.png' +{% endif %} + # Start Default Applications {% for application in i3_applications if application.on_startup %} exec sleep 3 && {{ application.name }} diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml index 0bdf526..1a39334 100644 --- a/vars/Archlinux.yml +++ b/vars/Archlinux.yml @@ -7,3 +7,6 @@ __i3_packages: - tmux - terminator - i3lock + - xautolock + - scrot + - imagemagick diff --git a/vars/Debian.yml b/vars/Debian.yml index 0bdf526..1a39334 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -7,3 +7,6 @@ __i3_packages: - tmux - terminator - i3lock + - xautolock + - scrot + - imagemagick diff --git a/vars/RedHat.yml b/vars/RedHat.yml index bf06435..94bc56c 100644 --- a/vars/RedHat.yml +++ b/vars/RedHat.yml @@ -7,3 +7,6 @@ __i3_packages: - terminator - i3lock - dmenu + - xautolock + - scrot + - imagemagick diff --git a/vars/main.yml b/vars/main.yml index 1a08541..a471162 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -33,5 +33,5 @@ __i3_workspaces: user: "{{ i3wm_user }}" -playbook_version_number: 9006 # should be over ninethousand +playbook_version_number: 9007 # should be over ninethousand playbook_version_path: '/etc/ansible-version/role-i3wm_chaos-bodensee_github.com.version'