summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <DaveDavenport@users.noreply.github.com>2017-11-01 20:28:41 +0100
committerGitHub <noreply@github.com>2017-11-01 20:28:41 +0100
commitc70d519226f6b85504b29e15cd2e867cea84316f (patch)
treef590757286b34f43c39dd27bfa86d98a5d27e18a
parent43588947246ddff102a8fe60b1dbb61e48b64065 (diff)
parent0ef2ad0771e003f1170368703d988664a943f12f (diff)
Merge pull request #714 from DaveDavenport/dumptheme
Changes the dump theme format to not have the prefix # and uses dots only to separate modifiers.
-rw-r--r--doc/default_theme.rasi49
-rw-r--r--doc/old-theme-convert-output.rasi49
-rw-r--r--source/theme.c8
-rwxr-xr-xtest/convert_old_theme_test.sh2
-rwxr-xr-xtest/default_theme_test.sh2
5 files changed, 58 insertions, 52 deletions
diff --git a/doc/default_theme.rasi b/doc/default_theme.rasi
index fd9d0549..ebf9bbbb 100644
--- a/doc/default_theme.rasi
+++ b/doc/default_theme.rasi
@@ -1,3 +1,6 @@
+/**
+ * rofi -dump-theme output.
+ **/
* {
selected-normal-foreground: @lightbg;
foreground: rgba ( 0, 43, 54, 100 % );
@@ -28,24 +31,24 @@
active-background: @background;
selected-active-background: @blue;
}
-#window {
+window {
background-color: @background;
border: 1;
padding: 5;
}
-#mainbox {
+mainbox {
border: 0;
padding: 0;
}
-#message {
+message {
border: 2px dash 0px 0px ;
border-color: @separatorcolor;
padding: 1px ;
}
-#textbox {
+textbox {
text-color: @foreground;
}
-#listview {
+listview {
fixed-height: 0;
border: 2px dash 0px 0px ;
border-color: @separatorcolor;
@@ -53,79 +56,79 @@
scrollbar: true;
padding: 2px 0px 0px ;
}
-#element {
+element {
border: 0;
padding: 1px ;
}
-#element.normal.normal {
+element normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
-#element.normal.urgent {
+element normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
-#element.normal.active {
+element normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
-#element.selected.normal {
+element selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
-#element.selected.urgent {
+element selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
-#element.selected.active {
+element selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
-#element.alternate.normal {
+element alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
-#element.alternate.urgent {
+element alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
-#element.alternate.active {
+element alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
-#scrollbar {
+scrollbar {
width: 4px ;
border: 0;
handle-color: @normal-foreground;
handle-width: 8px ;
padding: 0;
}
-#sidebar {
+sidebar {
border: 2px dash 0px 0px ;
border-color: @separatorcolor;
}
-#button {
+button {
spacing: 0;
text-color: @normal-foreground;
}
-#button.selected {
+button selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
-#inputbar {
+inputbar {
spacing: 3px ;
text-color: @normal-foreground;
padding: 1px ;
}
-#case-indicator {
+case-indicator {
spacing: 0;
text-color: @normal-foreground;
}
-#entry {
+entry {
spacing: 0;
text-color: @normal-foreground;
}
-#prompt {
+prompt {
spacing: 0;
text-color: @normal-foreground;
}
diff --git a/doc/old-theme-convert-output.rasi b/doc/old-theme-convert-output.rasi
index 18bfa179..fb2c578d 100644
--- a/doc/old-theme-convert-output.rasi
+++ b/doc/old-theme-convert-output.rasi
@@ -1,3 +1,6 @@
+/**
+ * rofi -dump-theme output.
+ **/
* {
selected-normal-foreground: rgba ( 2, 20, 63, 100 % );
foreground: rgba ( 219, 223, 188, 100 % );
@@ -28,24 +31,24 @@
active-background: rgba ( 0, 0, 0, 0 % );
selected-active-background: rgba ( 138, 196, 255, 100 % );
}
-#window {
+window {
background-color: @background;
border: 1;
padding: 5;
}
-#mainbox {
+mainbox {
border: 0;
padding: 0;
}
-#message {
+message {
border: 2px 0px 0px ;
border-color: @separatorcolor;
padding: 1px ;
}
-#textbox {
+textbox {
text-color: @foreground;
}
-#listview {
+listview {
fixed-height: 0;
border: 2px 0px 0px ;
border-color: @separatorcolor;
@@ -53,79 +56,79 @@
scrollbar: true;
padding: 2px 0px 0px ;
}
-#element {
+element {
border: 0;
padding: 1px ;
}
-#element.normal.normal {
+element normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
-#element.normal.urgent {
+element normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
-#element.normal.active {
+element normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
-#element.selected.normal {
+element selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
-#element.selected.urgent {
+element selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
-#element.selected.active {
+element selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
-#element.alternate.normal {
+element alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
-#element.alternate.urgent {
+element alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
-#element.alternate.active {
+element alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
-#scrollbar {
+scrollbar {
width: 4px ;
border: 0;
handle-color: @normal-foreground;
handle-width: 8px ;
padding: 0;
}
-#sidebar {
+sidebar {
border: 2px 0px 0px ;
border-color: @separatorcolor;
}
-#button {
+button {
spacing: 0;
text-color: @normal-foreground;
}
-#button.selected {
+button selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
-#inputbar {
+inputbar {
spacing: 3px ;
text-color: @normal-foreground;
padding: 1px ;
}
-#case-indicator {
+case-indicator {
spacing: 0;
text-color: @normal-foreground;
}
-#entry {
+entry {
spacing: 0;
text-color: @normal-foreground;
}
-#prompt {
+prompt {
spacing: 0;
text-color: @normal-foreground;
}
diff --git a/source/theme.c b/source/theme.c
index 42c5c270..e0a5dfbb 100644
--- a/source/theme.c
+++ b/source/theme.c
@@ -286,11 +286,10 @@ static void rofi_theme_print_index ( ThemeWidget *widget )
index = 4;
for ( GList *iter = g_list_first ( list ); iter != NULL; iter = g_list_next ( iter ) ) {
char *name = (char *) iter->data;
- if ( iter->prev == NULL ) {
- putchar ( '#' );
- }
fputs ( name, stdout );
- if ( iter->next ) {
+ if ( iter->prev == NULL && iter->next ) {
+ putchar ( ' ' );
+ } else if ( iter->next ) {
putchar ( '.' );
}
}
@@ -321,6 +320,7 @@ static void rofi_theme_print_index ( ThemeWidget *widget )
void rofi_theme_print ( ThemeWidget *widget )
{
if ( widget != NULL ) {
+ printf("/**\n * rofi -dump-theme output.\n * Rofi version: %s\n **/\n", PACKAGE_VERSION);
rofi_theme_print_index ( widget );
}
}
diff --git a/test/convert_old_theme_test.sh b/test/convert_old_theme_test.sh
index 75fc392b..52bbc6a7 100755
--- a/test/convert_old_theme_test.sh
+++ b/test/convert_old_theme_test.sh
@@ -3,7 +3,7 @@
TOP_DIR=$1
xrdb -retain -load ${TOP_DIR}/doc/old-theme-convert-input.theme
-rofi -config ${TOP_DIR}/doc/old-theme-convert-input.theme -dump-theme > temp.txt
+rofi -config ${TOP_DIR}/doc/old-theme-convert-input.theme -dump-theme | grep -v "Rofi version" > temp.txt
if ! diff temp.txt ${TOP_DIR}/doc/old-theme-convert-output.rasi > /dev/null
then
diff --git a/test/default_theme_test.sh b/test/default_theme_test.sh
index 8baa66c9..7e497686 100755
--- a/test/default_theme_test.sh
+++ b/test/default_theme_test.sh
@@ -2,7 +2,7 @@
TOP_DIR=$1
-rofi -no-config -dump-theme > temp.txt
+rofi -no-config -dump-theme | grep -v "Rofi version" > temp.txt
if ! diff temp.txt ${TOP_DIR}/doc/default_theme.rasi > /dev/null
then