150 lines
4.6 KiB
Bash
150 lines
4.6 KiB
Bash
#!/bin/bash
|
|
# Niri-specific customizations. Sourced by customizations.sh after the generic
|
|
# helpers when PROFILE=mainline-niri.
|
|
# Available env: $TARGET, $USERNAME, $PROFILE, $PROFILE_DIR, all install.conf vars.
|
|
|
|
_niri_write_kdl() {
|
|
local TARGET="$1"
|
|
local cfg="$TARGET/etc/skel/.config/niri"
|
|
install -d -m 0755 "$cfg"
|
|
cat > "$cfg/config.kdl" <<'EOF'
|
|
// niri config — generated by void-installer (mainline-niri profile).
|
|
input {
|
|
keyboard {
|
|
xkb {
|
|
layout "ch"
|
|
variant "fr"
|
|
}
|
|
}
|
|
touchpad {
|
|
tap
|
|
natural-scroll
|
|
dwt
|
|
}
|
|
mouse {
|
|
accel-speed 0.0
|
|
}
|
|
}
|
|
|
|
layout {
|
|
gaps 12
|
|
center-focused-column "never"
|
|
preset-column-widths {
|
|
proportion 0.33333
|
|
proportion 0.5
|
|
proportion 0.66667
|
|
}
|
|
default-column-width { proportion 0.5; }
|
|
focus-ring {
|
|
width 2
|
|
active-color "#fabd2f"
|
|
inactive-color "#3c3836"
|
|
}
|
|
border { off; }
|
|
}
|
|
|
|
prefer-no-csd
|
|
|
|
spawn-at-startup "swaybg" "-i" "/usr/share/backgrounds/void-installer/pxfuel.jpg"
|
|
spawn-at-startup "mako"
|
|
spawn-at-startup "nm-applet" "--indicator"
|
|
spawn-at-startup "blueman-applet"
|
|
spawn-at-startup "/usr/libexec/polkit-gnome-authentication-agent-1"
|
|
spawn-at-startup "noctalia-shell"
|
|
|
|
cursor {
|
|
xcursor-theme "Bibata-Modern-Ice"
|
|
xcursor-size 24
|
|
}
|
|
|
|
binds {
|
|
Mod+T { spawn "alacritty"; }
|
|
Mod+D { spawn "fuzzel"; }
|
|
Mod+Q { close-window; }
|
|
Mod+Shift+E { quit; }
|
|
Print { screenshot; }
|
|
Mod+H { focus-column-left; }
|
|
Mod+L { focus-column-right; }
|
|
Mod+J { focus-window-down; }
|
|
Mod+K { focus-window-up; }
|
|
Mod+Shift+H { move-column-left; }
|
|
Mod+Shift+L { move-column-right; }
|
|
Mod+1 { focus-workspace 1; }
|
|
Mod+2 { focus-workspace 2; }
|
|
Mod+3 { focus-workspace 3; }
|
|
Mod+4 { focus-workspace 4; }
|
|
Mod+Shift+1 { move-column-to-workspace 1; }
|
|
Mod+Shift+2 { move-column-to-workspace 2; }
|
|
XF86AudioRaiseVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"; }
|
|
XF86AudioLowerVolume { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"; }
|
|
XF86AudioMute { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
|
|
XF86MonBrightnessUp { spawn "brightnessctl" "set" "+5%"; }
|
|
XF86MonBrightnessDown { spawn "brightnessctl" "set" "5%-"; }
|
|
}
|
|
EOF
|
|
# Mirror into the actual user home.
|
|
install -d -m 0755 "$TARGET/home/$USERNAME/.config/niri"
|
|
cp "$cfg/config.kdl" "$TARGET/home/$USERNAME/.config/niri/config.kdl"
|
|
run_chroot "chown -R $USERNAME:$USERNAME /home/$USERNAME/.config/niri" || true
|
|
log "niri KDL config installed"
|
|
}
|
|
|
|
_niri_write_env() {
|
|
local TARGET="$1"
|
|
cat > "$TARGET/etc/profile.d/wayland.sh" <<'EOF'
|
|
# Wayland defaults installed by void-installer (mainline-niri profile).
|
|
export QT_QPA_PLATFORM="wayland;xcb"
|
|
export GDK_BACKEND=wayland,x11
|
|
export MOZ_ENABLE_WAYLAND=1
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
export XDG_CURRENT_DESKTOP=niri
|
|
export XDG_SESSION_TYPE=wayland
|
|
EOF
|
|
chmod 0644 "$TARGET/etc/profile.d/wayland.sh"
|
|
log "wayland environment installed at /etc/profile.d/wayland.sh"
|
|
}
|
|
|
|
_niri_setup_greetd() {
|
|
local TARGET="$1"
|
|
install -d -m 0755 "$TARGET/etc/greetd"
|
|
cat > "$TARGET/etc/greetd/config.toml" <<EOF
|
|
[terminal]
|
|
vt = 1
|
|
|
|
[default_session]
|
|
command = "tuigreet --time --remember --cmd niri-session"
|
|
user = "_greeter"
|
|
EOF
|
|
log "greetd configured for niri-session"
|
|
}
|
|
|
|
_niri_install_noctalia() {
|
|
local TARGET="$1"
|
|
# Third-party Void repo that ships noctalia-shell + noctalia-qs.
|
|
# Source: https://docs.noctalia.dev/getting-started/installation/#void
|
|
install -d -m 0755 "$TARGET/etc/xbps.d"
|
|
cat > "$TARGET/etc/xbps.d/10-noctalia.conf" <<'EOF'
|
|
repository=https://universalrepo.r1xelelo.workers.dev/void
|
|
EOF
|
|
|
|
# If quickshell is somehow installed it conflicts with noctalia-qs.
|
|
run_chroot "xbps-remove -y quickshell 2>/dev/null || true"
|
|
|
|
# Sync the new repo and install. Prefix with the proxy mirror configured
|
|
# by the installer environment so noctalia-shell deps still resolve fast.
|
|
if ! run_chroot "xbps-install -Sy"; then
|
|
log "WARN: noctalia repo sync failed; skipping noctalia-shell install"
|
|
return 0
|
|
fi
|
|
if run_chroot "xbps-install -y noctalia-shell"; then
|
|
log "noctalia-shell installed from third-party repo"
|
|
else
|
|
log "WARN: noctalia-shell install failed (repo may be down); shell omitted"
|
|
fi
|
|
}
|
|
|
|
_niri_write_kdl "$TARGET"
|
|
_niri_write_env "$TARGET"
|
|
_niri_setup_greetd "$TARGET"
|
|
_niri_install_noctalia "$TARGET"
|