diff --git a/dot_config/darkman/config.yaml b/dot_config/darkman/config.yaml new file mode 100644 index 0000000..bec6320 --- /dev/null +++ b/dot_config/darkman/config.yaml @@ -0,0 +1,3 @@ +lat: 42.32 +lng: -83.17 +portal: true diff --git a/dot_local/share/darkman/executable_desktop-notification.sh b/dot_local/share/darkman/executable_desktop-notification.sh new file mode 100644 index 0000000..01ab53b --- /dev/null +++ b/dot_local/share/darkman/executable_desktop-notification.sh @@ -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" diff --git a/dot_local/share/darkman/executable_foot.sh b/dot_local/share/darkman/executable_foot.sh new file mode 100644 index 0000000..5df0ff9 --- /dev/null +++ b/dot_local/share/darkman/executable_foot.sh @@ -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 diff --git a/dot_local/share/darkman/executable_kde-global-theme.sh b/dot_local/share/darkman/executable_kde-global-theme.sh new file mode 100644 index 0000000..0c84d4d --- /dev/null +++ b/dot_local/share/darkman/executable_kde-global-theme.sh @@ -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" diff --git a/dot_local/share/darkman/executable_neovim-background.sh b/dot_local/share/darkman/executable_neovim-background.sh new file mode 100644 index 0000000..b99fa80 --- /dev/null +++ b/dot_local/share/darkman/executable_neovim-background.sh @@ -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