summaryrefslogtreecommitdiffstats
path: root/Examples
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2022-06-03 19:42:40 +0200
committerDave Davenport <qball@blame.services>2022-06-06 11:34:49 +0200
commitb676dfe8ad0f805419c1ce5b97f0435bb9342584 (patch)
tree023fdab01fb0bf967c0e8db92c16a25c357ab9fa /Examples
parentc7776ce9b7fe1bf3f3df1a1ff146fcb7ec830866 (diff)
[DMenu|Script] Allow theme element updates from script.
Diffstat (limited to 'Examples')
-rwxr-xr-xExamples/test_script_mode_color.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/Examples/test_script_mode_color.sh b/Examples/test_script_mode_color.sh
new file mode 100755
index 00000000..4b0b19db
--- /dev/null
+++ b/Examples/test_script_mode_color.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+if [ "$*" = "quit" ]
+then
+ exit 0
+fi
+
+if [ "$@" ]
+then
+ # Override the previously set prompt.
+ echo -en "\0theme\x1felement-text { background-color: "$@";}\n"
+ echo "red"
+ echo "lightgreen"
+ echo "lightblue"
+ echo "lightyellow"
+ echo "quit"
+else
+ echo -en "\x00prompt\x1ftesting\n"
+ echo -en "\0urgent\x1f0,2\n"
+ echo -en "\0active\x1f1\n"
+ echo -en "\0message\x1fSpecial <b>bold</b>message\n"
+
+ echo "red"
+ echo "lightgreen"
+ echo "lightblue"
+ echo "lightyellow"
+ echo "quit"
+fi