aboutsummaryrefslogtreecommitdiff
path: root/.local/share/mode/plug.d/20_export_mode
diff options
context:
space:
mode:
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
+