niri: set background and toggle (dark/light)

This commit is contained in:
2026-05-20 22:25:26 +02:00
parent 65e82799d6
commit f4dadb53a9
4 changed files with 27 additions and 1 deletions

View File

@@ -321,3 +321,5 @@ binds {
Mod+Shift+P { power-off-monitors; }
}
include "dark.kdl"

View File

@@ -0,0 +1,9 @@
layout {
background-color "#414853"
focus-ring {
width 4
active-color "#5396c7"
inactive-color "#505050"
}
}

View File

@@ -0,0 +1,9 @@
layout {
background-color "#c0c1c2"
focus-ring {
width 4
active-color "#85c9fc"
inactive-color "#505050"
}
}

View File

@@ -44,7 +44,6 @@ if [ -f "$ATOML" ]; then
sed -i "s#^import =.*#import = [\"~/.config/alacritty/$THEME.toml\"]#" "$ATOML"
fi
XSET=$(readlink -e ~/.config/xsettingsd/xsettingsd.conf)
if [ "$THEME" = dark ]; then
kitten themes --reload-in=all 'five-colors-dark'
elif [ "$THEME" = light ]; then
@@ -52,12 +51,19 @@ elif [ "$THEME" = light ]; then
fi
# GTK
XSET=$(readlink -e ~/.config/xsettingsd/xsettingsd.conf)
if [ -n "$XSET" ]; then
sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" "$XSET"
pkill -HUP -x xsettingsd
gsettings set org.gnome.desktop.interface gtk-theme "${GTK_THEME}"
fi
# niri
NIRI=$(readlink -e ~/.config/niri/config.kdl)
if [ -n "$NIRI" ]; then
sed -i -E "s%^(include) \"(dark|light).kdl\".*%\\1 \"${THEME}.kdl\"%" "$NIRI"
fi
# waybar
WCSS=$(readlink -e ~/.config/waybar/style.css)
if [ -f "$WCSS" ]; then