From e45444045ab67219d921b4b175cec32bd63dc289 Mon Sep 17 00:00:00 2001 From: chodak166 Date: Sun, 6 Sep 2026 18:55:57 +0200 Subject: [PATCH] Added ubuntu/init-sway.sh; updated sway config --- .config/sway/config | 5 ++ .config/yazi/yazi.toml | 20 ++--- .dotfiles.d/init/ubuntu/init-sway.sh | 113 +++++++++++++++++++++++++++ 3 files changed, 128 insertions(+), 10 deletions(-) create mode 100755 .dotfiles.d/init/ubuntu/init-sway.sh diff --git a/.config/sway/config b/.config/sway/config index 5c534e3..1ddd6d1 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -164,6 +164,8 @@ bindsym Control+Mod1+h exec cliphist list | fuzzel --width 80 --dmenu | cliphist # Run app assigned to current workspace bindsym $mod+Shift+a exec $scriptsDir/autoapp +# Window switcher +bindsym Mod1+Tab exec swayr switch-window ################################################################# # Window Navigation @@ -579,6 +581,9 @@ exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Background services for XDG desktop portals (screen sharing, file picker) exec --no-startup-id dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway +# Window switcher swayrd env settings: +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP + ################################################################# # Key repeat rate ################################################################# diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml index 4a5376f..8544329 100644 --- a/.config/yazi/yazi.toml +++ b/.config/yazi/yazi.toml @@ -1,14 +1,14 @@ -[[plugin.prepend_fetchers]] +# [[plugin.prepend_fetchers]] # id = "git" # Remove if Yazi > v26.1.22 -url = "*" -run = "git" -group = "git" - -[[plugin.prepend_fetchers]] -# id = "git" # Remove if Yazi > v26.1.22 -url = "*/" -run = "git" -group = "git" +# url = "*" +# run = "git" +# group = "git" + +# [[plugin.prepend_fetchers]] +# # id = "git" # Remove if Yazi > v26.1.22 +# url = "*/" +# run = "git" +# group = "git" [opener] edit = [ diff --git a/.dotfiles.d/init/ubuntu/init-sway.sh b/.dotfiles.d/init/ubuntu/init-sway.sh new file mode 100755 index 0000000..4d51b3a --- /dev/null +++ b/.dotfiles.d/init/ubuntu/init-sway.sh @@ -0,0 +1,113 @@ +#!/bin/env bash +#---------------------------------------------------------------- +# init-sway.sh — Install everything needed to run the sway config +# from ~/.config/sway on Ubuntu 26.04 (resolute). +# +# Covers: compositor stack, bar/launcher/notifications, screenshot, +# clipboard, color temperature, audio (PipeWire), portals, fonts, +# wallpaper, helper-script dependencies, plus the applications +# referenced by keybindings and workspace assignments. +#---------------------------------------------------------------- +set -euo pipefail + +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + +echo "[1/8] Updating apt..." +sudo apt update -y + +echo "[2/8] Installing sway core stack and helper-script dependencies..." +sudo apt install -y \ + sway \ + swayidle \ + swaylock \ + swaybg \ + waybar \ + mako-notifier \ + fuzzel \ + wofi \ + kitty \ + grim \ + slurp \ + wl-clipboard \ + cliphist \ + brightnessctl \ + gammastep \ + playerctl \ + translate-shell \ + libnotify-bin \ + jq \ + osmo \ + network-manager-applet \ + policykit-1-gnome \ + xdg-desktop-portal \ + xdg-desktop-portal-wlr \ + xdg-desktop-portal-gtk \ + dbus-user-session \ + fontconfig \ + fonts-noto-core + +# Qt/Java apps referenced in window assignments run via XWayland by default; +# qt6-wayland makes Qt apps native Wayland clients. Optional. +sudo apt install -y qt6-wayland || true + +echo "[3/8] Installing PipeWire audio stack (volctl uses wpctl)..." +sudo apt install -y pipewire-audio pipewire-pulse wireplumber + +echo "[4/8] Installing applications referenced by keybindings/workspace assignments..." +# firefox/thunderbird on Ubuntu 24.04+ are snap-transitioning deb packages, +# but they still work; missing ones here must not abort the script. +sudo apt install -y \ + firefox \ + thunar \ + thunderbird \ + telegram-desktop \ + mpv \ + virt-manager \ + || true + +if command -v snap >/dev/null 2>&1; then + sudo snap install spotify || true +fi + +echo "[5/8] Installing Sway wallpaper (not shipped in Ubuntu's sway package)..." +sudo mkdir -p /usr/share/backgrounds/sway +sudo curl -fL -o /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png \ + https://raw.githubusercontent.com/swaywm/sway/master/assets/Sway_Wallpaper_Blue_1920x1080.png + +echo "[6/8] Installing Source Sans 3 font (not packaged in Ubuntu)..." +mkdir -p "$HOME/.local/share/fonts/SourceSans3" +if curl -fL -o /tmp/SourceSans3.zip \ + https://github.com/adobe-fonts/source-sans/releases/download/3.052R/SourceSans3_FontsOnly.zip; then + unzip -o -q /tmp/SourceSans3.zip -d "$HOME/.local/share/fonts/SourceSans3" + rm -f /tmp/SourceSans3.zip +else + # Fallback: variable font from the Google Fonts repository + curl -fL -o "$HOME/.local/share/fonts/SourceSans3/SourceSans3[wght].ttf" \ + "https://github.com/google/fonts/raw/main/ofl/sourcesans3/SourceSans3%5Bwght%5D.ttf" || \ + echo " -> WARNING: failed to download Source Sans 3; sway bar will fall back to another font" +fi +fc-cache -f >/dev/null 2>&1 + +echo "[7/8] Enabling services and device group membership..." +# Audio (socket-activated user services; enabling is idempotent) +systemctl --user enable --now pipewire pipewire-pulse wireplumber 2>/dev/null || true +# NetworkManager (already default on desktop installs; needed by nm-applet) +sudo systemctl enable --now NetworkManager 2>/dev/null || true +# Device access for sway started from a TTY / display manager +sudo usermod -aG video,input,render "$USER" 2>/dev/null || true + +echo "[8/8] Installing swayr window switcher (Alt+Tab, cargo-based)..." +if command -v cargo >/dev/null 2>&1; then + cargo install swayr || echo " -> WARNING: cargo install swayr failed" +else + echo " -> cargo not found. Run init-cargo-tools.sh first, then: cargo install swayr" +fi + +cat <<'EOF' + +Done. Next steps: + 1. Log out and back in (group membership takes effect on new login). + 2. Start sway: pick "Sway" in the login manager, or run `sway` from a TTY. + 3. Verify audio with `wpctl status` and notifications with `notify-send test`. + +EOF