Browse Source

Merge branch 'master' of http://git.nixlab.in/chodak166/dotfiles into trb

trb
chodylal 2 weeks ago
parent
commit
91281f477c
  1. 7
      .config/sway/config
  2. 20
      .config/yazi/yazi.toml
  3. 113
      .dotfiles.d/init/ubuntu/init-sway.sh

7
.config/sway/config

@ -168,6 +168,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
@ -592,6 +594,7 @@ exec_always gsettings set org.gnome.desktop.interface icon-theme 'Yaru'
exec_always gsettings set org.gnome.desktop.interface cursor-theme 'Yaru'
exec_always gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
#################################################################
# Key repeat rate
#################################################################
@ -615,9 +618,5 @@ exec_always gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
# xkb_options grp:alt_shift_toggle
# }
# input type:keyboard {
# xkb_layout pl,us
# # lv3:ralt_switch keeps Right Alt working for Polish chars
# # grp:alt_shift_toggle allows Alt+Shift to switch layouts
# xkb_options lv3:ralt_switch,grp:alt_shift_toggle
# }

20
.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 = [

113
.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
Loading…
Cancel
Save