latest config updates

This commit is contained in:
Alex Selimov 2026-03-14 10:58:18 -04:00
parent 34421ffd64
commit 86f31edec2
4 changed files with 42 additions and 112 deletions

View file

@ -2,21 +2,24 @@
NVIM_CONF="${HOME}/.config/nvim/init.lua"
GHOSTTY_CONF="${HOME}/.config/ghostty/config"
DUNST_CONF="${HOME}/.config/dunst/dunstrc"
GEMINI_CONF="${HOME}/repos/SelimovDE/gemini/settings.json"
[ -f "$NVIM_CONF" ] || { echo "Missing $NVIM_CONF"; exit 1; }
[ -f "$GHOSTTY_CONF" ] || { echo "Missing $GHOSTTY_CONF"; exit 1; }
[ -f "$DUNST_CONF" ] || { echo "Missing $DUNST_CONF"; exit 1; }
[ -f "$GEMINI_CONF" ] || { echo "Missing $GEMINI_CONF"; exit 1; }
which sed
set_light_mode() {
sed -E -i 's/^([[:space:]]*theme[[:space:]]*=[[:space:]]*)zenwritten-dark/\1zenwritten-light/' "$GHOSTTY_CONF"
sed -E -i 's/(vim.g.light_mode[[:space:]]*=[[:space:]]*).*/\1true/' "$NVIM_CONF"
sed -i 's/"theme": "Zenwritten Dark"/"theme": "Zenwritten Light"/' "$GEMINI_CONF"
MODE="light"
}
set_dark_mode() {
sed -E -i 's/^([[:space:]]*theme[[:space:]]*=[[:space:]]*)zenwritten-light/\1zenwritten-dark/' "$GHOSTTY_CONF"
sed -E -i 's/(vim.g.light_mode[[:space:]]*=[[:space:]]*).*/\1false/' "$NVIM_CONF"
sed -i 's/"theme": "Zenwritten Light"/"theme": "Zenwritten Dark"/' "$GEMINI_CONF"
MODE="dark"
}
@ -54,80 +57,11 @@ for dir in "${XDG_RUNTIME_DIR:-}" "${TMPDIR:-/tmp}" "/tmp" "$HOME/.local/state/n
done
# Reload Ghostty: send SIGUSR2 to running ghostty processes (macOS/Linux)
pkill -USR2 -x ghostty 2>/dev/null
# Reload Ghostty via AppleScript menu click
osascript -e 'tell application "System Events"
tell process "Ghostty"
click menu item "Reload Configuration" of menu "Ghostty" of menu bar item "Ghostty" of menu bar 1
end tell
end tell' 2>/dev/null || true
echo "Switched to ${MODE} mode"
# Script for changing between light and dark modes on Linux
if [ "$(uname)" != "Darwin" ]; then
if [ "$MODE" == "dark" ]; then
echo "Swapping to dark mode"
# GTK Theme
gsettings set org.gnome.desktop.interface gtk-theme ''
gsettings set org.gnome.desktop.interface gtk-theme 'WhiteSur-Dark'
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
sed -i -e 's@Net/ThemeName.*@Net/ThemeName "WhiteSur-Dark"@' ~/.xsettingsd
# Rofi theme
sed -i -e "s/light.rasi/dark.rasi/" $HOME/.config/rofi/config.rasi
# Swap dunst urgency_low background and foreground
sed -E -i '/^\[urgency_low\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#3d3839"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#8e8e8e"/
}' "$DUNST_CONF"
# Swap dunst urgency_normal background and foreground
sed -E -i '/^\[urgency_normal\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#3d3839"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#BBBBBB"/
}' "$DUNST_CONF"
# Plasma theme
if [[ "$XDG_CURRENT_DESKTOP" == "KDE" ]]; then
plasma-apply-lookandfeel -a com.github.vinceliuice.WhiteSur-dark
plasma-apply-cursortheme phinger-cursors-dark
kwriteconfig6 --file kdeglobals --group Icons --key Theme Papirus-Dark
kwriteconfig6 --file ksplashrc --group KSplash --key Theme Breeze
kquitapp6 plasmashell
sleep 0.3
kstart5 plasmashell
fi
else
echo "Swapping to light mode"
# GTK Theme
gsettings set org.gnome.desktop.interface gtk-theme ''
gsettings set org.gnome.desktop.interface gtk-theme 'WhiteSur-Light'
gsettings set org.gnome.desktop.interface color-scheme 'default'
sed -i -e 's@Net/ThemeName.*@Net/ThemeName "WhiteSur-Light"@' ~/.xsettingsd
# Swap dunst urgency_low background and foreground
sed -E -i '/^\[urgency_low\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#8e8e8e"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#3d3839"/
}' "$DUNST_CONF"
# Swap dunst urgency_normal background and foreground
sed -E -i '/^\[urgency_normal\]/,/^\[.*\]/ {
s/^([[:space:]]*background[[:space:]]*=[[:space:]]*).*/\1"#BBBBBB"/
s/^([[:space:]]*foreground[[:space:]]*=[[:space:]]*).*/\1"#191919"/
}' "$DUNST_CONF"
# Rofi theme
sed -i -e "s/dark.rasi/light.rasi/" $HOME/.config/rofi/config.rasi
#
# Plasma theme
if [[ "$XDG_CURRENT_DESKTOP" == "KDE" ]]; then
plasma-apply-lookandfeel -a com.github.vinceliuice.WhiteSur-alt
plasma-apply-cursortheme phinger-cursors-dark
kwriteconfig6 --file kdeglobals --group Icons --key Theme Papirus
kwriteconfig6 --file ksplashrc --group KSplash --key Theme Breeze
kquitapp6 plasmashell
sleep 0.3
kstart6 plasmashell
fi
fi
killall dunst
killall -HUP xsettingsd
fi