helix: add script to reload on dark mode change
This commit is contained in:
@@ -337,6 +337,7 @@ screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
|
||||
spawn-at-startup "dms" "run"
|
||||
spawn-at-startup "kdeconnect-indicator"
|
||||
spawn-at-startup "~/rep/flocon/home/bin/monitor-dark-mode.sh"
|
||||
|
||||
spawn-at-startup "xwayland-satellite"
|
||||
environment {
|
||||
|
||||
4
home/bin/monitor-dark-mode.sh
Executable file
4
home/bin/monitor-dark-mode.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
gsettings monitor org.gnome.desktop.interface color-scheme \
|
||||
| xargs -L1 "${HOME}/rep/flocon/home/bin/switch-helix-theme.sh"
|
||||
15
home/bin/switch-helix-theme.sh
Executable file
15
home/bin/switch-helix-theme.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euox pipefail
|
||||
|
||||
HELIX_CONFIG_PATH=$(readlink -f "${HOME}/.config/helix/config.toml")
|
||||
HELIX_THEME_LIGHT="zed_onelight"
|
||||
HELIX_THEME_DARK="kanagawa"
|
||||
|
||||
if [[ "$2" == "prefer-dark" ]]; then
|
||||
sed -i "s/^theme .*/theme = \"$HELIX_THEME_DARK\"/" "$HELIX_CONFIG_PATH"
|
||||
else
|
||||
sed -i "s/^theme .*/theme = \"$HELIX_THEME_LIGHT\"/" "$HELIX_CONFIG_PATH"
|
||||
fi
|
||||
|
||||
pkill -USR1 hx || true
|
||||
Reference in New Issue
Block a user