mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
sway: deploy start-sway system-wide and fix runtime warnings
- Move start-sway to /usr/local/bin so emptty resolves it without a user PATH (it runs the launcher with an absolute path). The role copies the script as root; the user dotfile entry is removed. - Fix runtime errors / deprecations in sway/config: tiling_drag accepts only enable|disable|toggle; new_window / new_float have been superseded by default_border / default_floating_border. - Simplify workspace names to numeric only; waybar already maps them to roman numerals via format-icons. - Update cleanup-sway.sh to remove /usr/local/bin/start-sway and the emptty session entry together as system files. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -162,10 +162,6 @@ desktop_sway_dotfiles:
|
|||||||
src: .config/sway/
|
src: .config/sway/
|
||||||
dest: .config/sway/
|
dest: .config/sway/
|
||||||
mode: preserve
|
mode: preserve
|
||||||
- name: Sway session launcher
|
|
||||||
src: .local/bin/start-sway
|
|
||||||
dest: .local/bin/start-sway
|
|
||||||
mode: "0755"
|
|
||||||
- name: dunst config
|
- name: dunst config
|
||||||
src: .config/dunst/
|
src: .config/dunst/
|
||||||
dest: .config/dunst/
|
dest: .config/dunst/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Sway
|
Name=Sway
|
||||||
Comment=SwayFX (Wayland)
|
Comment=SwayFX (Wayland)
|
||||||
Exec=start-sway
|
Exec=/usr/local/bin/start-sway
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|||||||
@@ -27,6 +27,16 @@
|
|||||||
mode: "0644"
|
mode: "0644"
|
||||||
when: "'sway' in (desktop_sessions_enabled | default([]))"
|
when: "'sway' in (desktop_sessions_enabled | default([]))"
|
||||||
|
|
||||||
|
- name: Install Sway session launcher in /usr/local/bin
|
||||||
|
tags: [packages, services, sway]
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ playbook_dir }}/../dotfiles/desktop/.local/bin/start-sway"
|
||||||
|
dest: /usr/local/bin/start-sway
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
when: "'sway' in (desktop_sessions_enabled | default([]))"
|
||||||
|
|
||||||
- name: Copy sway desktop dotfiles
|
- name: Copy sway desktop dotfiles
|
||||||
tags: [dotfiles, dotfiles:desktop, sway]
|
tags: [dotfiles, dotfiles:desktop, sway]
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ set $down j
|
|||||||
set $up k
|
set $up k
|
||||||
set $right l
|
set $right l
|
||||||
|
|
||||||
# Workspaces (etichette in numeri romani)
|
# Workspaces (waybar formatta i numeri in romani via format-icons)
|
||||||
set $ws1 "1: I"
|
set $ws1 "1"
|
||||||
set $ws2 "2: II"
|
set $ws2 "2"
|
||||||
set $ws3 "3: III"
|
set $ws3 "3"
|
||||||
set $ws4 "4: IV"
|
set $ws4 "4"
|
||||||
set $ws5 "5: V"
|
set $ws5 "5"
|
||||||
set $ws6 "6: VI"
|
set $ws6 "6"
|
||||||
set $ws7 "7: VII"
|
set $ws7 "7"
|
||||||
set $ws8 "8: VIII"
|
set $ws8 "8"
|
||||||
set $ws9 "9: IX"
|
set $ws9 "9"
|
||||||
set $ws10 "10: X"
|
set $ws10 "10"
|
||||||
|
|
||||||
# Input devices
|
# Input devices
|
||||||
input * {
|
input * {
|
||||||
@@ -49,13 +49,11 @@ xwayland enable
|
|||||||
focus_follows_mouse no
|
focus_follows_mouse no
|
||||||
mouse_warping none
|
mouse_warping none
|
||||||
floating_modifier $mod
|
floating_modifier $mod
|
||||||
tiling_drag modifier titlebar
|
tiling_drag enable
|
||||||
|
|
||||||
# Borders
|
# Borders
|
||||||
default_border pixel 2
|
default_border pixel 2
|
||||||
default_floating_border pixel 2
|
default_floating_border pixel 2
|
||||||
new_window pixel 2
|
|
||||||
new_float pixel 2
|
|
||||||
hide_edge_borders none
|
hide_edge_borders none
|
||||||
|
|
||||||
# Gaps
|
# Gaps
|
||||||
|
|||||||
@@ -22,11 +22,13 @@ xorg-server-xwayland
|
|||||||
SWAY_DOTFILES="
|
SWAY_DOTFILES="
|
||||||
$HOME/.config/sway
|
$HOME/.config/sway
|
||||||
$HOME/.config/waybar
|
$HOME/.config/waybar
|
||||||
$HOME/.local/bin/start-sway
|
|
||||||
$HOME/.cache/cliphist
|
$HOME/.cache/cliphist
|
||||||
"
|
"
|
||||||
|
|
||||||
EMPTTY_SESSION=/etc/emptty/wayland-sessions/sway.desktop
|
SWAY_SYSTEM_FILES="
|
||||||
|
/etc/emptty/wayland-sessions/sway.desktop
|
||||||
|
/usr/local/bin/start-sway
|
||||||
|
"
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
printf '%s [y/N] ' "$1"
|
printf '%s [y/N] ' "$1"
|
||||||
@@ -65,12 +67,12 @@ for d in $SWAY_DOTFILES; do
|
|||||||
printf ' %s\n' "$d"
|
printf ' %s\n' "$d"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
printf '\nEmptty session entry:\n'
|
printf '\nSystem files to remove:\n'
|
||||||
if [ -e "$EMPTTY_SESSION" ]; then
|
for f in $SWAY_SYSTEM_FILES; do
|
||||||
printf ' %s\n' "$EMPTTY_SESSION"
|
if [ -e "$f" ] || [ -L "$f" ]; then
|
||||||
else
|
printf ' %s\n' "$f"
|
||||||
printf ' (absent)\n'
|
fi
|
||||||
fi
|
done
|
||||||
printf '\nShared (NOT removed): dunst, rofi, alacritty, xfce4-screenshooter and their configs.\n\n'
|
printf '\nShared (NOT removed): dunst, rofi, alacritty, xfce4-screenshooter and their configs.\n\n'
|
||||||
|
|
||||||
confirm 'Proceed?' || { printf 'Aborted.\n'; exit 0; }
|
confirm 'Proceed?' || { printf 'Aborted.\n'; exit 0; }
|
||||||
@@ -86,8 +88,10 @@ for d in $SWAY_DOTFILES; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -e "$EMPTTY_SESSION" ]; then
|
for f in $SWAY_SYSTEM_FILES; do
|
||||||
sudo rm -f -- "$EMPTTY_SESSION"
|
if [ -e "$f" ] || [ -L "$f" ]; then
|
||||||
fi
|
sudo rm -f -- "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
printf '\nDone.\n'
|
printf '\nDone.\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user