make niri config templateable

This commit is contained in:
2025-10-05 21:40:47 +02:00
parent 86e20c06bc
commit d3498f1724
3 changed files with 25 additions and 6 deletions

View File

@@ -159,7 +159,7 @@ layout {
// off
// How many logical pixels the ring extends out from the windows.
width 3
width 4
// Colors can be set in a variety of ways:
// - CSS named colors: "red"
@@ -167,13 +167,13 @@ layout {
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor.
active-color "#7fc8ff"
active-color "$focus_active"
// Color of the ring on inactive monitors.
//
// The focus ring only draws around the active window, so the only place
// where you can see its inactive-color is on other monitors.
inactive-color "#505050"
inactive-color "#005050"
// You can also use gradients. They take precedence over solid colors.
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
@@ -283,7 +283,7 @@ hotkey-overlay {
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
// This option will also fix border/focus ring drawing behind some semitransparent windows.
// After enabling or disabling this, you need to restart the apps for this to take effect.
// prefer-no-csd
prefer-no-csd
// You can change the path where screenshots are saved.
// A ~ at the front will be expanded to the home directory.

17
config/niri/generate_kdl.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
. "$HOME/.cache/wal/colors.sh"
echo "$color1"
export focus_active="$color2"
#export focus_inactive="$FOCUS_INACTIVE"
#export border_active="$BORDER_ACTIVE"
#export border_inactive="$BORDER_INACTIVE"
#export border_urgent="$BORDER_URGENT"
# for simplicity, using envsubst:
envsubst <$HOME/.config/niri/config.template.kdl >$HOME/.config/niri/config.kdl
# optionally force Niri to reload or redraw (if needed)
#niri msg action redraw

View File

@@ -7,8 +7,6 @@ fi
#wal -q -n --iterative -i ~/Pictures/niribg
wal -q -n -i /usr/share/endeavouros/backgrounds/ -i /usr/share/endeavouros/backgrounds/eos_wallpapers_classic/ -i /usr/share/endeavouros/backgrounds/eos_wallpapers_community/
notify-send -i "$(<"${HOME}/.cache/wal/wal")" "Theme Changed"
if [[ $(pidof waybar) ]]; then
killall -SIGUSR2 waybar
fi
@@ -17,4 +15,8 @@ swaybg -m fill -i "$(<"${HOME}/.cache/wal/wal")" &
$HOME/.config/mako/update_theme.sh
$HOME/.config/niri/generate_kdl.sh
niri msg action do-screen-transition --delay-ms 300
notify-send -i "$(<"${HOME}/.cache/wal/wal")" "Theme Changed"