add darkman

This commit is contained in:
Joel Beckmeyer
2026-05-18 21:19:00 -04:00
parent 528ed9b0b7
commit e9cd7c268a
5 changed files with 52 additions and 0 deletions
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
# trigger a small, passive popup dialog to inform the user about darkman's activity
# reference https://wiki.archlinux.org/title/Desktop_notifications#Usage_in_programming
case "$1" in
dark) ICON=weather-clear-night ;;
light) ICON=weather-clear ;;
default) exit 1 ;;
esac
notify-send --app-name="darkman" --urgency=low --icon="$ICON" "switching to $1 mode"
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/foot/foot.ini"
case "$1" in
dark) sed -i 's/initial-color-theme=light/initial-color-theme=dark/' "$CONFIG";
pkill -u "$USER" --signal=SIGUSR1 ^foot$ ;;
light) sed -i 's/initial-color-theme=dark/initial-color-theme=light/' "$CONFIG";
pkill -u "$USER" --signal=SIGUSR2 ^foot$ ;;
esac
@@ -0,0 +1,17 @@
#!/usr/bin/env sh
# Change the global Plasma Theme. On Manjaro you can use "org.manjaro.breath-dark.desktop"
# or "org.manjaro.breath-light.desktop", or you can create your own global Plasma Theme
# with the "Plasma Look And Feel Explorer".
# Reference: https://userbase.kde.org/Plasma/Create_a_Global_Theme_Package
#
# Since Plasma 5.26 the lookandfeeltool does not work anymore without "faking" the screen.
# Reference: https://bugs.kde.org/show_bug.cgi?id=460643
case "$1" in
dark) THEME=org.kde.breezedark.desktop ;;
light) THEME=org.kde.breeze.desktop ;;
default) exit 1 ;;
esac
lookandfeeltool -platform offscreen --apply "$THEME"
@@ -0,0 +1,10 @@
#!/bin/sh
# This uses the neovim-remote python package to control other neovim instances.
# see: https://github.com/mhinz/neovim-remote
# Further, it is assumed that toggling the background in neovim is enough.
# Anything else should be handled by the set color scheme.
for server in $(nvr --serverlist); do
nvr --servername "$server" -cc "set background=$1"
done