From c982829b11f5e5fd7abef1ad8be9828f58a95a87 Mon Sep 17 00:00:00 2001 From: cmacrae Date: Thu, 16 Apr 2020 10:18:49 +0100 Subject: [PATCH 1/2] cleanup: Remove 'status_bar_' config prefixes As this project is now simply a status bar on its own, the 'status_bar_' prefix on all config options seemed superfluous :) --- README.md | 16 ++++++++-------- doc/spacebar.1 | 20 ++++++++++---------- doc/spacebar.asciidoc | 20 ++++++++++---------- examples/spacebarrc | 18 +++++++++--------- src/message.c | 18 +++++++++--------- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index fa91e74..1808615 100644 --- a/README.md +++ b/README.md @@ -53,14 +53,14 @@ All of the configuration options can be changed at runtime as well. Example configuration: ``` -spacebar -m config status_bar_text_font "Helvetica Neue:Bold:12.0" -spacebar -m config status_bar_icon_font "Font Awesome 5:Regular:12.0" -spacebar -m config status_bar_background_color 0xff202020 -spacebar -m config status_bar_foreground_color 0xffa8a8a8 -spacebar -m config status_bar_space_icon_strip I II III IV V VI VII VIII IX X -spacebar -m config status_bar_power_icon_strip   -spacebar -m config status_bar_space_icon  -spacebar -m config status_bar_clock_icon  +spacebar -m config text_font "Helvetica Neue:Bold:12.0" +spacebar -m config icon_font "Font Awesome 5:Regular:12.0" +spacebar -m config background_color 0xff202020 +spacebar -m config foreground_color 0xffa8a8a8 +spacebar -m config space_icon_strip I II III IV V VI VII VIII IX X +spacebar -m config power_icon_strip   +spacebar -m config space_icon  +spacebar -m config clock_icon  ``` - Sample configuration files can be found in the [↗ examples][spacebar-examples] directory. Refer to the [↗ documentation][spacebar-docs]. diff --git a/doc/spacebar.1 b/doc/spacebar.1 index d48a22c..e3aba5b 100644 --- a/doc/spacebar.1 +++ b/doc/spacebar.1 @@ -70,48 +70,48 @@ Get or set the value of . Enable output of debug information to stdout. .RE .sp -\fBstatus_bar_text_font\fP [\fI::\fP] +\fBtext_font\fP [\fI::\fP] .RS 4 Specify name, style and size of font to use for drawing text. .br Use \fIFont Book.app\fP to identify the correct name. .RE .sp -\fBstatus_bar_icon_font\fP [\fI::\fP] +\fBicon_font\fP [\fI::\fP] .RS 4 Specify name, style and size of font to use for drawing icon symbols. .br Use \fIFont Book.app\fP to identify the correct name. .RE .sp -\fBstatus_bar_background_color\fP [\fI\fP] +\fBbackground_color\fP [\fI\fP] .RS 4 Color to use for drawing status bar background. .RE .sp -\fBstatus_bar_foreground_color\fP [\fI\fP] +\fBforeground_color\fP [\fI\fP] .RS 4 Color to use for drawing status bar elements. .RE .sp -\fBstatus_bar_space_icon_strip\fP [\fI \fP] +\fBspace_icon_strip\fP [\fI \fP] .RS 4 Specify symbols separated by whitespace to be used for visualizing spaces. .RE .sp -\fBstatus_bar_power_icon_strip\fP [\fI \fP] +\fBpower_icon_strip\fP [\fI \fP] .RS 4 Specify two symbols separated by whitespace. .br The first symbol represents battery power and the second symbol indicates AC. .RE .sp -\fBstatus_bar_space_icon\fP [\fI\fP] +\fBspace_icon\fP [\fI\fP] .RS 4 -Specify a general symbol to use for any given space that does not have a match in \fIstatus_bar_space_icon_strip\fP. +Specify a general symbol to use for any given space that does not have a match in \fIspace_icon_strip\fP. .RE .sp -\fBstatus_bar_clock_icon\fP [\fI\fP] +\fBclock_icon\fP [\fI\fP] .RS 4 Specify a symbol to represent the current time. .RE @@ -120,4 +120,4 @@ Specify a symbol to represent the current time. If \fBspacebar\fP can\(cqt handle a message, it will return a non\-zero exit code. .SH "AUTHOR" .sp -Doron Somech \ No newline at end of file +Doron Somech diff --git a/doc/spacebar.asciidoc b/doc/spacebar.asciidoc index 6ea8112..697f104 100644 --- a/doc/spacebar.asciidoc +++ b/doc/spacebar.asciidoc @@ -60,34 +60,34 @@ Settings *debug_output* ['']:: Enable output of debug information to stdout. -*status_bar_text_font* ['::']:: +*text_font* ['::']:: Specify name, style and size of font to use for drawing text. + Use 'Font Book.app' to identify the correct name. -*status_bar_icon_font* ['::']:: +*icon_font* ['::']:: Specify name, style and size of font to use for drawing icon symbols. + Use 'Font Book.app' to identify the correct name. -*status_bar_background_color* ['']:: +*background_color* ['']:: Color to use for drawing status bar background. -*status_bar_foreground_color* ['']:: +*foreground_color* ['']:: Color to use for drawing status bar elements. -*status_bar_space_icon_strip* [' ']:: +*space_icon_strip* [' ']:: Specify symbols separated by whitespace to be used for visualizing spaces. -*status_bar_power_icon_strip* [' ']:: +*power_icon_strip* [' ']:: Specify two symbols separated by whitespace. + The first symbol represents battery power and the second symbol indicates AC. -*status_bar_space_icon* ['']:: - Specify a general symbol to use for any given space that does not have a match in 'status_bar_space_icon_strip'. +*space_icon* ['']:: + Specify a general symbol to use for any given space that does not have a match in 'space_icon_strip'. -*status_bar_clock_icon* ['']:: +*clock_icon* ['']:: Specify a symbol to represent the current time. -*status_bar_clock_format* ['']:: +*clock_format* ['']:: Specify a format for the current time, according to the strftime function. Exit Codes diff --git a/examples/spacebarrc b/examples/spacebarrc index b037144..2fcf18f 100755 --- a/examples/spacebarrc +++ b/examples/spacebarrc @@ -1,13 +1,13 @@ #!/usr/bin/env sh -spacebar -m config status_bar_text_font "Helvetica Neue:Bold:12.0" -spacebar -m config status_bar_icon_font "Font Awesome 5 Free:Regular:12.0" -spacebar -m config status_bar_background_color 0xff202020 -spacebar -m config status_bar_foreground_color 0xffa8a8a8 -spacebar -m config status_bar_space_icon_strip I II III IV V VI VII VIII IX X -spacebar -m config status_bar_power_icon_strip   -spacebar -m config status_bar_space_icon  -spacebar -m config status_bar_clock_icon  -spacebar -m config status_bar_clock_format "%d/%m/%y %R" +spacebar -m config text_font "Helvetica Neue:Bold:12.0" +spacebar -m config icon_font "Font Awesome 5 Free:Regular:12.0" +spacebar -m config background_color 0xff202020 +spacebar -m config foreground_color 0xffa8a8a8 +spacebar -m config space_icon_strip I II III IV V VI VII VIII IX X +spacebar -m config power_icon_strip   +spacebar -m config space_icon  +spacebar -m config clock_icon  +spacebar -m config clock_format "%d/%m/%y %R" echo "spacebar configuration loaded.." diff --git a/src/message.c b/src/message.c index 1616ff6..b66507d 100644 --- a/src/message.c +++ b/src/message.c @@ -12,15 +12,15 @@ extern bool g_verbose; /* --------------------------------DOMAIN CONFIG-------------------------------- */ #define COMMAND_CONFIG_DEBUG_OUTPUT "debug_output" -#define COMMAND_CONFIG_BAR_TEXT_FONT "status_bar_text_font" -#define COMMAND_CONFIG_BAR_ICON_FONT "status_bar_icon_font" -#define COMMAND_CONFIG_BAR_BACKGROUND "status_bar_background_color" -#define COMMAND_CONFIG_BAR_FOREGROUND "status_bar_foreground_color" -#define COMMAND_CONFIG_BAR_SPACE_STRIP "status_bar_space_icon_strip" -#define COMMAND_CONFIG_BAR_POWER_STRIP "status_bar_power_icon_strip" -#define COMMAND_CONFIG_BAR_SPACE_ICON "status_bar_space_icon" -#define COMMAND_CONFIG_BAR_CLOCK_ICON "status_bar_clock_icon" -#define COMMAND_CONFIG_BAR_CLOCK_FORMAT "status_bar_clock_format" +#define COMMAND_CONFIG_BAR_TEXT_FONT "text_font" +#define COMMAND_CONFIG_BAR_ICON_FONT "icon_font" +#define COMMAND_CONFIG_BAR_BACKGROUND "background_color" +#define COMMAND_CONFIG_BAR_FOREGROUND "foreground_color" +#define COMMAND_CONFIG_BAR_SPACE_STRIP "space_icon_strip" +#define COMMAND_CONFIG_BAR_POWER_STRIP "power_icon_strip" +#define COMMAND_CONFIG_BAR_SPACE_ICON "space_icon" +#define COMMAND_CONFIG_BAR_CLOCK_ICON "clock_icon" +#define COMMAND_CONFIG_BAR_CLOCK_FORMAT "clock_format" /* --------------------------------COMMON ARGUMENTS----------------------------- */ #define ARGUMENT_COMMON_VAL_ON "on" From f1352347073f13c780f734ad400c476a51590481 Mon Sep 17 00:00:00 2001 From: cmacrae Date: Thu, 16 Apr 2020 16:12:04 +0100 Subject: [PATCH 2/2] docs: Update manpage with 'clock_format' --- doc/spacebar.1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/spacebar.1 b/doc/spacebar.1 index e3aba5b..c029b12 100644 --- a/doc/spacebar.1 +++ b/doc/spacebar.1 @@ -115,6 +115,11 @@ Specify a general symbol to use for any given space that does not have a match i .RS 4 Specify a symbol to represent the current time. .RE +.sp +\fBclock_format\fP [\fI\fP] +.RS 4 +Specify a format for the current time, according to the strftime function. +.RE .SH "EXIT CODES" .sp If \fBspacebar\fP can\(cqt handle a message, it will return a non\-zero exit code.