Add Sway session with Waybar and split configs for Hyprland

This commit is contained in:
Fabio Scotto di Santolo
2026-03-31 17:04:05 +02:00
parent e57f2e8253
commit da3c97a35a
19 changed files with 533 additions and 32 deletions

View File

@@ -57,6 +57,20 @@ desktop_hyprland_packages:
- wl-clipboard
- xdg-desktop-portal-hyprland
desktop_sway_packages:
- grim
- kanshi
- slurp
- SwayOSD
- sway
- swayidle
- swaylock
- Waybar
- wl-clipboard
- xfce4-clipman-plugin
- xfce4-screenshooter
- xdg-desktop-portal-wlr
profile_packages:
- alacritty
- bluez
@@ -187,6 +201,28 @@ desktop_hyprland_dotfiles:
dest: .local/bin/screenshot-wayland
mode: "0755"
desktop_sway_dotfiles:
- name: Sway config
src: .config/sway/
dest: .config/sway/
mode: preserve
- name: Waybar config
src: .config/waybar/
dest: .config/waybar/
mode: preserve
- name: Sway wallpaper assets
src: .config/i3/wallpapers/
dest: .config/sway/wallpapers/
mode: preserve
- name: Sway session wrapper
src: .local/bin/start-sway-session
dest: .local/bin/start-sway-session
mode: "0755"
- name: Wayland screenshot script
src: .local/bin/screenshot-wayland
dest: .local/bin/screenshot-wayland
mode: "0755"
desktop_flatpak_packages:
- be.alexandervanhee.gradia
- ch.protonmail.protonmail-bridge

View File

@@ -3,6 +3,7 @@ hostname: nymph
desktop_sessions_enabled:
- i3
- sway
- hyprland
desktop_prompt_for_session: true
@@ -33,3 +34,14 @@ host_hyprland_dotfiles:
- src: .config/hypr/host.conf
dest: .config/hypr/host.conf
mode: "0644"
host_sway_dotfiles:
- src: .config/sway/host.conf
dest: .config/sway/host.conf
mode: "0644"
- src: .config/sway/session-env
dest: .config/sway/session-env
mode: "0644"
- src: .config/kanshi/config
dest: .config/kanshi/config
mode: "0644"

View File

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

View File

@@ -33,3 +33,18 @@
when:
- "'hyprland' in (desktop_sessions_enabled | default([]))"
- (host_hyprland_dotfiles | default([])) | length > 0
- name: Copy host-specific Sway dotfiles
tags: [dotfiles, dotfiles:desktop, dotfiles:host, sway]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/{{ hostname }}/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ host_sway_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
when:
- "'sway' in (desktop_sessions_enabled | default([]))"
- (host_sway_dotfiles | default([])) | length > 0

View File

@@ -0,0 +1,37 @@
---
- 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/sway"
- "{{ user_home }}/.config/waybar"
- "{{ user_home }}/.config/kanshi"
when: "'sway' in (desktop_sessions_enabled | default([]))"
- name: Install Sway emptty session entry
tags: [packages, services, emptty, sway]
ansible.builtin.template:
src: Sway.desktop.j2
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

@@ -0,0 +1,8 @@
[Desktop Entry]
Name=Sway
Comment=Sway Wayland compositor
Exec={{ user_home }}/.local/bin/start-sway-session
TryExec=sway
Type=Application
DesktopNames=sway;wlroots
Keywords=wayland;wm;windowmanager;window;manager;tiling;compositor;

View File

@@ -19,6 +19,7 @@
- services_runit
- profile_desktop_common
- profile_desktop_i3
- profile_desktop_sway
- profile_desktop_hyprland
- profile_desktop_host