Skip to content

Commit

Permalink
Merge pull request #28 from roles-ansible/br
Browse files Browse the repository at this point in the history
Create I3 variable swap
  • Loading branch information
DO1JLR authored Aug 30, 2024
2 parents 9790aca + 59f0ae0 commit 50241e7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions templates/config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 50241e7

Please sign in to comment.