From 425993da8504d7b418e52f0f6671e1afe04f77b9 Mon Sep 17 00:00:00 2001 From: L3D Date: Tue, 23 Jul 2024 15:54:25 +0200 Subject: [PATCH] Improve some features --- defaults/main.yml | 1 + tasks/main.yml | 5 +++++ tasks/setup-Debian.yml | 1 - tasks/waybar.yml | 2 +- tasks/wlsunset.yml | 8 ++++++++ templates/config.j2 | 3 +++ 6 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tasks/wlsunset.yml diff --git a/defaults/main.yml b/defaults/main.yml index 2cf4e72..c235087 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -19,6 +19,7 @@ sway__keyboard_lang: 'de' sway__lock: 'swaylock --color 000000 --image /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png' sway__waybar: true sway__waybar_modules_right: ["idle_inhibitor", "custom/weather", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "clock", "tray"] +sway__wlsunset: true sway__keybindings: - keybinding: diff --git a/tasks/main.yml b/tasks/main.yml index e33ef25..2f6e509 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,6 +13,11 @@ file: "setup-Debian.yml" when: ansible_os_family == 'Debian' +- name: Install wlsunset + ansible.builtin.import_tasks: + file: "wlsunset.yml" + when: sway__wlsunset | bool + - name: Create sway configuration and features ansible.builtin.import_tasks: file: "config.yml" diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 4075c1d..a607b2f 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -21,7 +21,6 @@ - 'swayidle' - 'swayimg' - 'wdisplays' - - 'wlsunset' - name: Ensure font-awesome is installed ansible.builtin.apt: diff --git a/tasks/waybar.yml b/tasks/waybar.yml index ea1e1c8..86ba5c3 100644 --- a/tasks/waybar.yml +++ b/tasks/waybar.yml @@ -1,6 +1,6 @@ --- - name: Ensure waybar is installed. - ansible.builtin.apt: + ansible.builtin.package: name: "{{ item }}" state: "present" become: true diff --git a/tasks/wlsunset.yml b/tasks/wlsunset.yml new file mode 100644 index 0000000..2450fbc --- /dev/null +++ b/tasks/wlsunset.yml @@ -0,0 +1,8 @@ +--- +- name: Ensure swaywm is installed. + ansible.builtin.package: + name: "{{ item }}" + state: "present" + become: true + with_items: + - 'wlsunset' diff --git a/templates/config.j2 b/templates/config.j2 index dd0c0bd..a7b71d3 100644 --- a/templates/config.j2 +++ b/templates/config.j2 @@ -257,5 +257,8 @@ bar { } } {% endif %} +exec_always --no-startup-id exec wlsunset +{% if sway__wlsunset | bool %} +{% endif %} include /etc/sway/config.d/*