summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-05-14 18:22:27 +0200
committerDave Davenport <qball@gmpclient.org>2017-05-14 18:22:27 +0200
commite4c935c764d1e1d1425c6615d4258a6e9f2a584d (patch)
tree8be7ad98b7a409c15593875a521446c2b29831c6
parent4e7aa06333341e5f0c76c909355ff00614c1ae0f (diff)
Add a old theme conversion test and default theme dump test.
-rw-r--r--Makefile.am8
-rw-r--r--doc/default_theme.rasi111
-rw-r--r--doc/old-theme-convert-input.theme154
-rw-r--r--doc/old-theme-convert-output.rasi111
-rwxr-xr-xtest/convert_old_theme_test.sh14
-rwxr-xr-xtest/default_theme_test.sh14
6 files changed, 410 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index c48a8915..9411806d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -530,9 +530,13 @@ test-x: $(bin_PROGRAMS)
echo "Test dmenu glob"
$(top_srcdir)/test/run_test.sh 216 $(top_srcdir)/test/run_glob_test.sh $(top_builddir)
echo "Test issue 333"
- $(top_srcdir)/test/run_test.sh 221 $(top_srcdir)/test/run_issue333_test.sh $(top_builddir)
+ $(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/run_issue333_test.sh $(top_builddir)
echo "Test help output"
- $(top_srcdir)/test/run_test.sh 212 $(top_srcdir)/test/help_output_test.sh $(top_builddir) $(top_srcdir)
+ $(top_srcdir)/test/run_test.sh 218 $(top_srcdir)/test/help_output_test.sh $(top_builddir) $(top_srcdir)
+ echo "Test theme output"
+ $(top_srcdir)/test/run_test.sh 219 $(top_srcdir)/test/default_theme_test.sh $(top_builddir) $(top_srcdir)
+ echo "Test theme convert output"
+ $(top_srcdir)/test/run_test.sh 220 $(top_srcdir)/test/convert_old_theme_test.sh $(top_builddir) $(top_srcdir)
test-x1: $(bin_PROGRAMS)
echo "Test dmenu-normal-window"
diff --git a/doc/default_theme.rasi b/doc/default_theme.rasi
new file mode 100644
index 00000000..4f17f684
--- /dev/null
+++ b/doc/default_theme.rasi
@@ -0,0 +1,111 @@
+* {
+ foreground: #FF002B36;
+ selected-normal-foreground: @lightbg;
+ normal-foreground: @foreground;
+ red: #FFDC322F;
+ alternate-normal-background: @lightbg;
+ blue: #FF268BD2;
+ selected-urgent-foreground: @background;
+ urgent-foreground: @red;
+ alternate-urgent-background: @lightbg;
+ active-foreground: @blue;
+ lightbg: #FFEEE8D5;
+ selected-active-foreground: @background;
+ alternate-normal-foreground: @foreground;
+ alternate-active-background: @lightbg;
+ bordercolor: @foreground;
+ background: #FFFDF6E3;
+ normal-background: @background;
+ lightfg: #FF586875;
+ selected-normal-background: @lightfg;
+ separatorcolor: @foreground;
+ spacing: 2;
+ urgent-background: @background;
+ alternate-urgent-foreground: @red;
+ selected-urgent-background: @red;
+ alternate-active-foreground: @blue;
+ selected-active-background: @blue;
+ active-background: @background;
+}
+#window {
+ border: 1;
+ foreground: @foreground;
+ background: #00000000;
+ padding: 5;
+}
+#window.box {
+ foreground: @bordercolor;
+ background: @background;
+}
+#window.mainbox {
+ border: 0;
+ padding: 0;
+}
+#window.mainbox.message.box {
+ border: 1px dash 0px 0px ;
+ foreground: @separatorcolor;
+ padding: 2px 0px 0px ;
+}
+#window.mainbox.message.normal {
+ foreground: @foreground;
+}
+#window.mainbox.listview {
+ fixed-height: 0;
+ border: 1px dash 0px 0px ;
+ padding: 2px 0px 0px ;
+}
+#window.mainbox.listview.element {
+ border: 0;
+}
+#window.mainbox.listview.element.normal.normal {
+ foreground: @normal-foreground;
+ background: @normal-background;
+}
+#window.mainbox.listview.element.normal.urgent {
+ foreground: @urgent-foreground;
+ background: @urgent-background;
+}
+#window.mainbox.listview.element.normal.active {
+ foreground: @active-foreground;
+ background: @active-background;
+}
+#window.mainbox.listview.element.selected.normal {
+ foreground: @selected-normal-foreground;
+ background: @selected-normal-background;
+}
+#window.mainbox.listview.element.selected.urgent {
+ foreground: @selected-urgent-foreground;
+ background: @selected-urgent-background;
+}
+#window.mainbox.listview.element.selected.active {
+ foreground: @selected-active-foreground;
+ background: @selected-active-background;
+}
+#window.mainbox.listview.element.alternate.normal {
+ foreground: @alternate-normal-foreground;
+ background: @alternate-normal-background;
+}
+#window.mainbox.listview.element.alternate.urgent {
+ foreground: @alternate-urgent-foreground;
+ background: @alternate-urgent-background;
+}
+#window.mainbox.listview.element.alternate.active {
+ foreground: @alternate-active-foreground;
+ background: @alternate-active-background;
+}
+#window.mainbox.listview.scrollbar {
+ border: 0;
+ padding: 0;
+}
+#window.mainbox.sidebar.box {
+ border: 1px dash 0px 0px ;
+}
+#window.mainbox.inputbar {
+ spacing: 0;
+}
+#window.mainbox.inputbar.box {
+ border: 0px ;
+}
+#window.mainbox.inputbar.normal {
+ foreground: @foreground;
+}
diff --git a/doc/old-theme-convert-input.theme b/doc/old-theme-convert-input.theme
new file mode 100644
index 00000000..a3f19d73
--- /dev/null
+++ b/doc/old-theme-convert-input.theme
@@ -0,0 +1,154 @@
+background: rgba(0,0,0,0.0);
+foreground: rgba(1,1,1,1);
+font: "Ubuntu Mono 15";
+padding: 0;
+spacing: 0em;
+
+#window.mainbox.inputbar.box {
+ padding: 5px 30px 5px 30px;
+
+}
+#window.mainbox.inputbar {
+ background: #88003300;
+ foreground: #FFFFFF;
+ padding: 0px;
+ end: false;
+}
+#mainbox.inputbar.entry {
+ padding: 0px;
+ border: 0px;
+}
+#mainbox.inputbar.prompt {
+ padding: 0px;
+}
+#mainbox.inputbar.case-indicator
+{
+ padding: 0px;
+ border: 0px;
+ end: true;
+}
+
+#window.mainbox.listview {
+ fixed-height: true;
+ border: 1px 1px 1px 1px;
+ spacing: 0px;
+ reverse: false;
+}
+#window.mainbox.listview.element {
+ border: 1px;
+ background: #22000000;
+ padding: 5px;
+}
+#window.mainbox.inputbar.entry normal.normal {
+ background: #00000000;
+ foreground: #FFFFFF;
+ padding: 0px;
+}
+#window.mainbox.inputbar.prompt normal.normal {
+ background: #00000000;
+ foreground: #FFFFFF;
+ padding: 0px;
+}
+#window.mainbox.inputbar.case-indicator normal.normal {
+ background: #00000000;
+ foreground: #FFFFFF;
+ padding: 0px;
+}
+
+#window.mainbox.inputbar.separator {
+ background: #FF0000;
+ foreground: #FFFFFF;
+ padding: 0px;
+ end: false;
+}
+
+#window.mainbox.box {
+ foreground: #ffffff;
+ background: #aaFFFFFF;
+ border: 2px dash 2px dash 0px 2px dash;
+}
+#window.mainbox {
+ background: #00000000;
+ padding: 0px;
+ border: 0px;
+ foreground: #ffffff;
+}
+
+#window.mainbox.listview.element normal.normal {
+ foreground: #002b36;
+}
+#window.mainbox.listview.element selected.normal {
+ foreground: #ffffff;
+ background: #770000f5;
+}
+#window.mainbox.listview.element alternate.normal {
+ foreground: #002b36;
+}
+#window.mainbox.listview.element normal.urgent {
+ foreground: #473f00;
+}
+#window.mainbox.listview.element selected.urgent {
+ background: #aa673f00;
+ foreground: #ffffff;
+}
+#window.mainbox.listview.element alternate.urgent {
+ foreground: #473f00;
+}
+#window.mainbox.listview.element normal.active {
+ foreground: #005f87;
+}
+#window.mainbox.listview.element selected.active {
+ background: #aa008fa7;
+ foreground: #FFFFFF;
+}
+#window.mainbox.listview.element alternate.active {
+ foreground: #005f87;
+}
+/**
+ * Override the sidebar button
+ * Change color of text on selected.
+ */
+#sidebar.button normal {
+ foreground: #444444;
+}
+#sidebar.button selected {
+ foreground: #4271ae;
+}
+
+#window.mainbox.listview {
+ scrollbar: true;
+ scrollbar-width: 5px;
+ padding: 30px 30px 5px 30px;
+ spacing: 0em;
+ dynamic: true;
+ border: 0px;
+ fixed-height: true;
+ border: 2px 0px 0px 0px;
+}
+#window.mainbox.listview.scrollbar {
+ border: 1px 1px 1px 0px;
+ foreground: #000000;
+ background: #88003300;
+ padding: 2px;
+}
+#window.mainbox.listview.scrollbar handle {
+ foreground: #d75f00;
+ padding: 2px;
+}
+
+#window {
+ border: 4px 4px 0px 4px;
+ padding: 5% 5% 0% 5%;
+ border-width: 2;
+ transparency: "real";
+ background: #aa000000;
+ foreground: #aaaaaa;
+}
+#window.message.textbox {
+ foreground: #000000;
+ border: 1px;
+ padding: 10px;
+}
+#window.message {
+ end: false;
+}
diff --git a/doc/old-theme-convert-output.rasi b/doc/old-theme-convert-output.rasi
new file mode 100644
index 00000000..4460ae40
--- /dev/null
+++ b/doc/old-theme-convert-output.rasi
@@ -0,0 +1,111 @@
+* {
+ foreground: #FFDBDFBC;
+ selected-normal-foreground: #FF02143F;
+ normal-foreground: @foreground;
+ red: #FFDC322F;
+ alternate-normal-background: #3AFFFFFF;
+ blue: #FF268BD2;
+ selected-urgent-foreground: #FF02143F;
+ urgent-foreground: #FFFF817F;
+ alternate-urgent-background: #3AFFFFFF;
+ active-foreground: #FF6AA4FF;
+ lightbg: #FFEEE8D5;
+ selected-active-foreground: #FF02143F;
+ alternate-normal-foreground: @foreground;
+ alternate-active-background: #3AFFFFFF;
+ bordercolor: #FFDBDFBC;
+ background: #EE27201A;
+ normal-background: #00000000;
+ lightfg: #FF586875;
+ selected-normal-background: #FFDBDFBC;
+ separatorcolor: #FFDBDFBC;
+ spacing: 2;
+ urgent-background: #00000000;
+ alternate-urgent-foreground: @urgent-foreground;
+ selected-urgent-background: #FFFF817F;
+ alternate-active-foreground: @active-foreground;
+ selected-active-background: #FF6AA4FF;
+ active-background: #00000000;
+}
+#window {
+ border: 1;
+ foreground: @foreground;
+ background: #00000000;
+ padding: 5;
+}
+#window.box {
+ foreground: @bordercolor;
+ background: @background;
+}
+#window.mainbox {
+ border: 0;
+ padding: 0;
+}
+#window.mainbox.message.box {
+ border: 1px dash 0px 0px ;
+ foreground: @separatorcolor;
+ padding: 2px 0px 0px ;
+}
+#window.mainbox.message.normal {
+ foreground: @foreground;
+}
+#window.mainbox.listview {
+ fixed-height: 0;
+ border: 1px dash 0px 0px ;
+ padding: 2px 0px 0px ;
+}
+#window.mainbox.listview.element {
+ border: 0;
+}
+#window.mainbox.listview.element.normal.normal {
+ foreground: @normal-foreground;
+ background: @normal-background;
+}
+#window.mainbox.listview.element.normal.urgent {
+ foreground: @urgent-foreground;
+ background: @urgent-background;
+}
+#window.mainbox.listview.element.normal.active {
+ foreground: @active-foreground;
+ background: @active-background;
+}
+#window.mainbox.listview.element.selected.normal {
+ foreground: @selected-normal-foreground;
+ background: @selected-normal-background;
+}
+#window.mainbox.listview.element.selected.urgent {
+ foreground: @selected-urgent-foreground;
+ background: @selected-urgent-background;
+}
+#window.mainbox.listview.element.selected.active {
+ foreground: @selected-active-foreground;
+ background: @selected-active-background;
+}
+#window.mainbox.listview.element.alternate.normal {
+ foreground: @alternate-normal-foreground;
+ background: @alternate-normal-background;
+}
+#window.mainbox.listview.element.alternate.urgent {
+ foreground: @alternate-urgent-foreground;
+ background: @alternate-urgent-background;
+}
+#window.mainbox.listview.element.alternate.active {
+ foreground: @alternate-active-foreground;
+ background: @alternate-active-background;
+}
+#window.mainbox.listview.scrollbar {
+ border: 0;
+ padding: 0;
+}
+#window.mainbox.sidebar.box {
+ border: 1px dash 0px 0px ;
+}
+#window.mainbox.inputbar {
+ spacing: 0;
+}
+#window.mainbox.inputbar.box {
+ border: 0px ;
+}
+#window.mainbox.inputbar.normal {
+ foreground: @foreground;
+}
diff --git a/test/convert_old_theme_test.sh b/test/convert_old_theme_test.sh
new file mode 100755
index 00000000..2b362627
--- /dev/null
+++ b/test/convert_old_theme_test.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+TOP_DIR=$1
+
+rofi -config ${TOP_DIR}/doc/old-theme-convert-input.theme -dump-theme > temp.txt
+
+if ! diff temp.txt ${TOP_DIR}/doc/old-theme-convert-output.rasi > /dev/null
+then
+ echo "Dump default theme does not match."
+ diff temp.txt ${TOP_DIR}/doc/old-theme-convert-output.rasi
+ exit 1;
+fi
+
+exit ${RETV}
diff --git a/test/default_theme_test.sh b/test/default_theme_test.sh
new file mode 100755
index 00000000..8baa66c9
--- /dev/null
+++ b/test/default_theme_test.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+TOP_DIR=$1
+
+rofi -no-config -dump-theme > temp.txt
+
+if ! diff temp.txt ${TOP_DIR}/doc/default_theme.rasi > /dev/null
+then
+ echo "Dump default theme does not match."
+ diff temp.txt ${TOP_DIR}/doc/default_theme.rasi
+ exit 1;
+fi
+
+exit ${RETV}