From ab530b9b9bf3f1009fcfab50ee87e4225de43bf3 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Thu, 26 Mar 2026 14:43:52 +0100 Subject: [PATCH] Refine desktop audio and power defaults --- ansible/inventory/group_vars/desktop.yml | 6 +++++- ansible/roles/profile_desktop_i3/tasks/main.yml | 8 ++++++++ dotfiles/desktop/.config/i3/config | 5 ++--- dotfiles/desktop/.config/i3blocks/config | 4 ++++ .../wireplumber.conf.d/51-bluetooth-no-autoswitch.conf | 3 +++ 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 dotfiles/desktop/.config/wireplumber/wireplumber.conf.d/51-bluetooth-no-autoswitch.conf diff --git a/ansible/inventory/group_vars/desktop.yml b/ansible/inventory/group_vars/desktop.yml index d7bca42..68b3f76 100644 --- a/ansible/inventory/group_vars/desktop.yml +++ b/ansible/inventory/group_vars/desktop.yml @@ -16,7 +16,6 @@ profile_packages: - thunar-volman - udiskie - xfce-polkit - - xfce4-power-manager - xfce4-clipman-plugin - xfce4-screenshooter - volumeicon @@ -74,6 +73,7 @@ profile_packages: - blueman - bluez - libspa-bluetooth + - wireplumber - yaru - yaru-plus @@ -110,6 +110,10 @@ desktop_dotfiles: src: .config/fontconfig/ dest: .config/fontconfig/ mode: preserve + - name: WirePlumber config + src: .config/wireplumber/ + dest: .config/wireplumber/ + mode: preserve - name: yt-dlp config src: .config/yt-dlp/ dest: .config/yt-dlp/ diff --git a/ansible/roles/profile_desktop_i3/tasks/main.yml b/ansible/roles/profile_desktop_i3/tasks/main.yml index 52a805a..44156cb 100644 --- a/ansible/roles/profile_desktop_i3/tasks/main.yml +++ b/ansible/roles/profile_desktop_i3/tasks/main.yml @@ -1,4 +1,12 @@ --- +- name: Configure elogind to suspend on lid close + tags: [packages] + ansible.builtin.lineinfile: + path: /etc/elogind/logind.conf + regexp: '^#?HandleLidSwitch=' + line: 'HandleLidSwitch=suspend' + state: present + - name: Ensure config directories exist tags: [dotfiles, dotfiles:desktop] ansible.builtin.file: diff --git a/dotfiles/desktop/.config/i3/config b/dotfiles/desktop/.config/i3/config index f5b4af1..390e367 100644 --- a/dotfiles/desktop/.config/i3/config +++ b/dotfiles/desktop/.config/i3/config @@ -28,11 +28,10 @@ exec --no-startup-id nm-applet exec --no-startup-id blueman-applet exec --no-startup-id udiskie --tray --automount exec --no-startup-id volumeicon -exec --no-startup-id xfce4-power-manager exec --no-startup-id xfce4-clipman -# Lock before suspend -exec --no-startup-id xss-lock --transfer-sleep-lock -- ~/.config/i3/scripts/lockscreen +# Lock screen on suspend (handled by elogind) +exec --no-startup-id xss-lock -- ~/.config/i3/scripts/lockscreen # General behavior focus_follows_mouse no diff --git a/dotfiles/desktop/.config/i3blocks/config b/dotfiles/desktop/.config/i3blocks/config index 1a0e081..c315494 100644 --- a/dotfiles/desktop/.config/i3blocks/config +++ b/dotfiles/desktop/.config/i3blocks/config @@ -21,6 +21,10 @@ command=~/.config/i3blocks/scripts/wifi interval=10 color=#4a90d9 +[battery] +command=~/.config/i3blocks/scripts/battery +interval=30 + [time] command=date '+%Y-%m-%d %H:%M' interval=60 diff --git a/dotfiles/desktop/.config/wireplumber/wireplumber.conf.d/51-bluetooth-no-autoswitch.conf b/dotfiles/desktop/.config/wireplumber/wireplumber.conf.d/51-bluetooth-no-autoswitch.conf new file mode 100644 index 0000000..556d8c7 --- /dev/null +++ b/dotfiles/desktop/.config/wireplumber/wireplumber.conf.d/51-bluetooth-no-autoswitch.conf @@ -0,0 +1,3 @@ +wireplumber.settings = { + bluetooth.autoswitch-to-headset-profile = false +}