aboutsummaryrefslogtreecommitdiff
path: root/.local/share/mode/plug.d/20_export_mode
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-03-10 11:00:17 +0100
committerlonkaars <loek@pipeframe.xyz>2024-03-10 11:00:17 +0100
commitfed2e42488194bfc45a55f687dd97b28a998a3f3 (patch)
tree8d1ffe023bb7228c43c35da6db45a72243c94739 /.local/share/mode/plug.d/20_export_mode
parentf99aa9d2c9baa0ce6ca01f47bf69e4c3901b54a8 (diff)
more refactoring
Diffstat (limited to '.local/share/mode/plug.d/20_export_mode')
-rw-r--r--.local/share/mode/plug.d/20_export_mode9
1 files changed, 9 insertions, 0 deletions
diff --git a/.local/share/mode/plug.d/20_export_mode b/.local/share/mode/plug.d/20_export_mode
new file mode 100644
index 0000000..78432b6
--- /dev/null
+++ b/.local/share/mode/plug.d/20_export_mode
@@ -0,0 +1,9 @@
+#!/bin/sh
+# $mode = "light" | "dark"
+if [ "$mode" != 'dark' ] && [ "$mode" != 'light' ] ; then
+ pastel format hsl-lightness "$bg" | awk '{ exit($1 > 0.5) }'
+ [ $? -eq 0 ] && mode=dark || mode=light
+ echo "warn: theme $theme did not define \$mode as \"light\" or \"dark\", guessed $mode" >&2
+fi
+export mode
+