From 59f0ae08b4f740fdafd6b3428da93ab4e0250ec7 Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 30 Aug 2024 18:44:18 +0200 Subject: [PATCH] Create I3 variable swap --- README.md | 6 +++++- defaults/main.yml | 13 +++++++++---- tasks/config.yml | 2 +- templates/config.j2 | 10 +++++++--- vars/main.yml | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index af42d67..fe7b43c 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,11 @@ For a good overview about possible variables, please have a look into ``defaults on_startup: true # lock your screen after 90 min - enable_lock_after_time: true + i3_wallpaper: true + i3_no_screensaver: true + i3_xautolock: true + i3_screensaver_time: '90' + i3_disable_beep: true files/rofi/dracula_dark.rasi diff --git a/defaults/main.yml b/defaults/main.yml index 174a22e..10dd091 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -61,11 +61,16 @@ i3_terminal: "terminator" i3_packages_extra: - ranger -i3wm_copy_wallpapers: true -disable_screensaver: true -enable_lock_after_time: false -lock_after_time: '90' # minutes to wait until your screen is locked +i3_wallpaper: true +i3_no_screensaver: true +i3_xautolock: true +i3_screensaver_time: '90' +i3_disable_beep: true + +# +# enable_lock_after_time: false +# lock_after_time: '90' # minutes to wait until your screen is locked # version check for this role? submodules_versioncheck: true diff --git a/tasks/config.yml b/tasks/config.yml index 1841b9f..f335901 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -28,7 +28,7 @@ loop: - {src: 'files/background.png', dest: "{{ i3wm_usr.home }}/.config/background.png"} - {src: 'files/lockscreen.png', dest: '{{ i3wm_usr.home }}/.config/lockscreen.png'} - when: i3wm_copy_wallpapers | bool + when: i3_wallpaper | bool - name: Copy and validate i3wm config file become: true diff --git a/templates/config.j2 b/templates/config.j2 index 4bcdabb..4a35e62 100644 --- a/templates/config.j2 +++ b/templates/config.j2 @@ -183,13 +183,17 @@ exec_always sleep 1 && xrandr \ exec_always feh --bg-scale {{ i3_desktop_background }} {% endif %} -{% if disable_screensaver | bool %} -# Disable screensaver by default +{% if i3_no_screensaver | bool %} +# Disable screensaver exec_always xset s off exec xset -dpms {% endif %} -{% if enable_lock_after_time | bool %} +{% if i3_disable_beep | bool %} +exec_always xset b off +{% endif %} + +{% if i3_xautolock | bool %} exec xautolock -time {{ lock_after_time }} -locker 'maim /tmp/screen_locked.png; mogrify -scale 10% -scale 1000% /tmp/screen_locked.png; i3lock -i /tmp/screen_locked.png' {% endif %} diff --git a/vars/main.yml b/vars/main.yml index 4ae8fdc..b887a1f 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -33,5 +33,5 @@ __i3_workspaces: user: "{{ i3wm_user }}" -playbook_version_number: 9027 # should be int +playbook_version_number: 9028 # should be int playbook_version_path: 'role-i3wm_chaos-bodensee_github.com.version'