desktop: add sway/swayfx profile (dormant) with waybar, kanshi, cliphist

New profile_desktop_sway role gated by desktop_sessions_enabled, with
SwayFX effects, Waybar bar (1:1 with Polybar layout + pulseaudio),
swayidle + swaylock-effects for locking, swayosd for OSD, cliphist for
clipboard history and kanshi for multi-monitor profiles. Emptty gains
WAYLAND_SESSIONS_PATH + wayland-sessions dir. start-sway wrapper handles
session env (dbus-run-session, gpg-agent, turnstile env). Profile stays
dormant until a host opts in via desktop_sessions_enabled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Fabio Scotto di Santolo
2026-05-16 19:39:11 +02:00
parent ea588a3fc8
commit cddaef3b04
17 changed files with 639 additions and 16 deletions

View File

@@ -156,6 +156,32 @@ desktop_i3_dotfiles:
dest: .xinitrc
mode: "0644"
desktop_sway_dotfiles:
- name: sway config
src: .config/sway/
dest: .config/sway/
mode: preserve
- name: Sway session launcher
src: .local/bin/start-sway
dest: .local/bin/start-sway
mode: "0755"
- name: dunst config
src: .config/dunst/
dest: .config/dunst/
mode: preserve
- name: rofi config
src: .config/rofi/
dest: .config/rofi/
mode: preserve
- name: waybar config
src: .config/waybar/
dest: .config/waybar/
mode: preserve
- name: alacritty config
src: .config/alacritty/
dest: .config/alacritty/
mode: preserve
noctalia_bar_monitors:
- DP-1

View File

@@ -63,7 +63,6 @@ void_packages_base:
- tealdeer
- tree-sitter-grammars
- ufw
- xdotool
- void-repo-nonfree
- vpm
- vsv
@@ -115,10 +114,6 @@ desktop_void_dotfiles:
src: .bashrc.d/15-runit-desktop.sh
dest: .bashrc.d/15-runit-desktop.sh
mode: "0644"
- name: alacritty config
src: .config/alacritty/
dest: .config/alacritty/
mode: preserve
- name: GTK theme setup script
src: .local/bin/setup-gtk-theme
dest: .local/bin/setup-gtk-theme
@@ -141,9 +136,11 @@ desktop_void_dotfiles:
mode: preserve
desktop_common_packages:
- blueman
- brightnessctl
- dex
- emptty
- network-manager-applet
- pinentry-emacs
- pinentry-gtk
- turnstile
@@ -151,6 +148,7 @@ desktop_common_packages:
- xdg-desktop-portal
- xdg-desktop-portal-gtk
- xdg-user-dirs
- xfce-polkit
desktop_i3_packages:
- arandr
@@ -162,22 +160,36 @@ desktop_i3_packages:
- i3lock-color
- i3status
- dunst
- network-manager-applet
- picom
- polybar
- rofi
- scrot
- setxkbmap
- blueman
- volumeicon
- xclip
- xfce-polkit
- xfce4-clipman-plugin
- xfce4-screenshooter
- xkbutils
- xorg-fonts
- xorg-minimal
- xss-lock
- xdotool
desktop_sway_packages:
- cliphist
- dunst
- kanshi
- rofi
- swayfx
- swaybg
- swayidle
- swaylock-effects
- SwayOSD
- waybar
- wl-clipboard
- xfce4-screenshooter
- xdg-desktop-portal-wlr
- xorg-server-xwayland
profile_packages:
- alacritty

View File

@@ -61,6 +61,11 @@
if 'i3' in (desktop_sessions_enabled | default([]))
else []
)
+ (
(desktop_sway_packages | default([]))
if 'sway' in (desktop_sessions_enabled | default([]))
else []
)
+ (host_packages | default([]))
)
| unique

View File

@@ -246,6 +246,7 @@
mode: "0755"
loop:
- /etc/emptty/xsessions
- /etc/emptty/wayland-sessions
when: "'void' in group_names"
- name: Configure emptty

View File

@@ -10,6 +10,7 @@ DEFAULT_SESSION_ENV={{ desktop_default_session_env | default('') }}
DBUS_LAUNCH=false
XINITRC_LAUNCH=true
XORG_SESSIONS_PATH=/etc/emptty/xsessions
WAYLAND_SESSIONS_PATH=/etc/emptty/wayland-sessions
VERTICAL_SELECTION=true
IDENTIFY_ENVS=true
SELECT_LAST_USER=global

View File

@@ -0,0 +1,5 @@
[Desktop Entry]
Name=Sway
Comment=SwayFX (Wayland)
Exec=start-sway
Type=Application

View File

@@ -0,0 +1,41 @@
---
- name: Ensure sway config directories exist
tags: [dotfiles, dotfiles:desktop, sway]
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
loop:
- "{{ user_home }}/.config/alacritty"
- "{{ user_home }}/.config/dunst"
- "{{ user_home }}/.config/rofi"
- "{{ user_home }}/.config/sway"
- "{{ user_home }}/.config/sway/scripts"
- "{{ user_home }}/.config/sway/wallpapers"
- "{{ user_home }}/.config/waybar"
when: "'sway' in (desktop_sessions_enabled | default([]))"
- name: Install allowed emptty Wayland sessions
tags: [packages, services, emptty, sway]
ansible.builtin.copy:
src: sway.desktop
dest: /etc/emptty/wayland-sessions/sway.desktop
owner: root
group: root
mode: "0644"
when: "'sway' in (desktop_sessions_enabled | default([]))"
- name: Copy sway desktop dotfiles
tags: [dotfiles, dotfiles:desktop, sway]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ desktop_sway_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
when: "'sway' in (desktop_sessions_enabled | default([]))"

View File

@@ -25,6 +25,7 @@
- services_runit
- profile_desktop_common
- profile_desktop_i3
- profile_desktop_sway
- profile_desktop_host
- hosts: workstation_dev_ubuntu