Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wob for openSUSE:Factory checked in 
at 2021-08-18 08:55:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wob (Old)
 and      /work/SRC/openSUSE:Factory/.wob.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wob"

Wed Aug 18 08:55:42 2021 rev:4 rq:912349 version:0.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/wob/wob.changes  2021-02-09 21:16:25.446784697 
+0100
+++ /work/SRC/openSUSE:Factory/.wob.new.1899/wob.changes        2021-08-18 
08:56:25.986938135 +0200
@@ -1,0 +2,11 @@
+Mon Aug 16 06:58:43 UTC 2021 - Michael Vetter <[email protected]>
+
+- Update to 0.12:
+  Fixed:
+  * Allow munmap syscall to fix sandbox on musl libc #74
+  Changed:
+  * Change color format from #AARRGGBB to #RRGGBBAA #79 #81
+  Added:
+  * Allow overflow #67
+
+-------------------------------------------------------------------

Old:
----
  wob-0.11.tar.gz
  wob-0.11.tar.gz.sig

New:
----
  wob-0.12.tar.gz
  wob-0.12.tar.gz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ wob.spec ++++++
--- /var/tmp/diff_new_pack.Ne0y37/_old  2021-08-18 08:56:27.042936894 +0200
+++ /var/tmp/diff_new_pack.Ne0y37/_new  2021-08-18 08:56:27.046936889 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           wob
-Version:        0.11
+Version:        0.12
 Release:        0
 Summary:        A lightweight overlay volume/backlight/progress/anything bar 
for Wayland
 License:        ISC

++++++ wob-0.11.tar.gz -> wob-0.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/README.md new/wob-0.12/README.md
--- old/wob-0.11/README.md      2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/README.md      2021-08-13 19:41:56.000000000 +0200
@@ -1,10 +1,10 @@
 # wob ??? Wayland Overlay Bar
 
-[![Build 
Status](https://travis-ci.com/francma/wob.svg?branch=master)](https://travis-ci.com/francma/wob)
+[![Build 
Status](https://github.com/francma/wob/workflows/test/badge.svg)](https://github.com/francma/wob/actions)
 
 ![preview](https://martinfranc.eu/wob-preview.svg)
 
-A lightweight overlay volume/backlight/progress/anything bar for Wayland. This 
project is inspired by [xob - X Overlay Bar](https://github.com/florentc/xob).
+A lightweight overlay volume/backlight/progress/anything bar for wlroots based 
Wayland compositors (requrires support for `wlr_layer_shell_unstable_v1`). This 
project is inspired by [xob - X Overlay Bar](https://github.com/florentc/xob).
 
 ## Release signatures
 
@@ -75,32 +75,60 @@
 Add these lines to your Sway config file:
 
 ```
-exec mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob
+set $WOBSOCK $XDG_RUNTIME_DIR/wob.sock
+exec mkfifo $WOBSOCK && tail -f $WOBSOCK | wob
 ```
 
 Volume using alsa:
 
 ```
-bindsym XF86AudioRaiseVolume exec amixer sset Master 5%+ | sed -En 
's/.*\[([0-9]+)%\].*/\1/p' | head -1 > $SWAYSOCK.wob
-bindsym XF86AudioLowerVolume exec amixer sset Master 5%- | sed -En 
's/.*\[([0-9]+)%\].*/\1/p' | head -1 > $SWAYSOCK.wob
-bindsym XF86AudioMute exec amixer sset Master toggle | sed -En '/\[on\]/ 
s/.*\[([0-9]+)%\].*/\1/ p; /\[off\]/ s/.*/0/p' | head -1 > $SWAYSOCK.wob
+bindsym XF86AudioRaiseVolume exec amixer sset Master 5%+ | sed -En 
's/.*\[([0-9]+)%\].*/\1/p' | head -1 > $WOBSOCK
+bindsym XF86AudioLowerVolume exec amixer sset Master 5%- | sed -En 
's/.*\[([0-9]+)%\].*/\1/p' | head -1 > $WOBSOCK
+bindsym XF86AudioMute exec amixer sset Master toggle | sed -En '/\[on\]/ 
s/.*\[([0-9]+)%\].*/\1/ p; /\[off\]/ s/.*/0/p' | head -1 > $WOBSOCK
 ```
 
 Volume using pulse audio:
 
 ```
-bindsym XF86AudioRaiseVolume exec pamixer -ui 2 && pamixer --get-volume > 
$SWAYSOCK.wob
-bindsym XF86AudioLowerVolume exec pamixer -ud 2 && pamixer --get-volume > 
$SWAYSOCK.wob
-bindsym XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && 
echo 0 > $SWAYSOCK.wob ) || pamixer --get-volume > $SWAYSOCK.wob
+bindsym XF86AudioRaiseVolume exec pamixer -ui 2 && pamixer --get-volume > 
$WOBSOCK
+bindsym XF86AudioLowerVolume exec pamixer -ud 2 && pamixer --get-volume > 
$WOBSOCK
+bindsym XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && 
echo 0 > $WOBSOCK ) || pamixer --get-volume > $WOBSOCK
 ```
 
 Brightness using [haikarainen/light](https://github.com/haikarainen/light):
 
 ```
-bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > 
$SWAYSOCK.wob
-bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > 
$SWAYSOCK.wob
+bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > 
$WOBSOCK
+bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > 
$WOBSOCK
+```
+
+Brightness using [brightnessctl](https://github.com/Hummer12007/brightnessctl):
+
+```
+bindsym XF86MonBrightnessDown exec brightnessctl set 5%- | sed -En 
's/.*\(([0-9]+)%\).*/\1/p' > $WOBSOCK
+bindsym XF86MonBrightnessUp exec brightnessctl set +5% | sed -En 
's/.*\(([0-9]+)%\).*/\1/p' > $WOBSOCK
+```
+
+#### Systemd
+
+Add this line to your config file:
+
+```
+exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
+```
+
+Copy systemd unit files (if not provided by your distribution package):
+
+```
+cp contrib/systemd/wob.{service,socket} ~/.local/share/systemd/user/
+systemctl daemon-reload --user
+```
+
+Enable systemd wob socket:
+
+```
+systemctl enable --now --user wob.socket
 ```
-See the wiki for useful scripts.
 
 ## License
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/buffer.c new/wob-0.12/buffer.c
--- old/wob-0.11/buffer.c       2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/buffer.c       2021-08-13 19:41:56.000000000 +0200
@@ -18,8 +18,8 @@
 {
        int shmid = -1;
        char shm_name[NAME_MAX];
-       for (unsigned char i = 0; i < UCHAR_MAX; ++i) {
-               if (snprintf(shm_name, NAME_MAX, "/wob-%hhu", i) >= NAME_MAX) {
+       for (int i = 0; i < UCHAR_MAX; ++i) {
+               if (snprintf(shm_name, NAME_MAX, "/wob-%d", i) >= NAME_MAX) {
                        break;
                }
                shmid = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0600);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/color.c new/wob-0.12/color.c
--- old/wob-0.11/color.c        2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/color.c        2021-08-13 19:41:56.000000000 +0200
@@ -7,10 +7,10 @@
 uint32_t
 wob_color_to_argb(const struct wob_color color)
 {
-       uint8_t alpha = color.alpha * UINT8_MAX;
-       uint8_t red = color.red * UINT8_MAX;
-       uint8_t green = color.green * UINT8_MAX;
-       uint8_t blue = color.blue * UINT8_MAX;
+       uint8_t alpha = (uint8_t) (color.a * UINT8_MAX);
+       uint8_t red = (uint8_t) (color.r * UINT8_MAX);
+       uint8_t green = (uint8_t) (color.g * UINT8_MAX);
+       uint8_t blue = (uint8_t) (color.b * UINT8_MAX);
 
        return (alpha << 24) + (red << 16) + (green << 8) + blue;
 }
@@ -19,10 +19,10 @@
 wob_color_premultiply_alpha(const struct wob_color color)
 {
        struct wob_color premultiplied_color = {
-               .alpha = color.alpha,
-               .red = color.red * color.alpha,
-               .green = color.green * color.alpha,
-               .blue = color.blue * color.alpha,
+               .a = color.a,
+               .r = color.r * color.a,
+               .g = color.g * color.a,
+               .b = color.b * color.a,
        };
 
        return premultiplied_color;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/include/color.h new/wob-0.12/include/color.h
--- old/wob-0.11/include/color.h        2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/include/color.h        2021-08-13 19:41:56.000000000 +0200
@@ -4,10 +4,10 @@
 #include <stdint.h>
 
 struct wob_color {
-       float alpha;
-       float red;
-       float green;
-       float blue;
+       float a;
+       float r;
+       float g;
+       float b;
 };
 
 uint32_t wob_color_to_argb(struct wob_color color);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/include/log.h new/wob-0.12/include/log.h
--- old/wob-0.11/include/log.h  2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/include/log.h  2021-08-13 19:41:56.000000000 +0200
@@ -4,28 +4,28 @@
 #include <stdbool.h>
 
 typedef enum {
-       _WOB_LOG_DEBUG = 0,
-       _WOB_LOG_INFO = 1,
-       _WOB_LOG_WARN = 2,
-       _WOB_LOG_ERROR = 3,
-} _wob_log_importance;
+       WOB_LOG_DEBUG = 0,
+       WOB_LOG_INFO = 1,
+       WOB_LOG_WARN = 2,
+       WOB_LOG_ERROR = 3,
+} wob_log_importance;
 
-void _wob_log(const _wob_log_importance importance, const char *file, const 
int line, const char *fmt, ...);
+void wob_log(wob_log_importance importance, const char *file, int line, const 
char *fmt, ...);
 
-void _wob_log_set_level(const _wob_log_importance importance);
+void wob_log_set_level(wob_log_importance importance);
 
 void wob_log_inc_verbosity(void);
 
 void wob_log_use_colors(bool use_colors);
 
-#define wob_log_debug(...) _wob_log(_WOB_LOG_DEBUG, WOB_FILE, __LINE__, 
__VA_ARGS__)
-#define wob_log_info(...) _wob_log(_WOB_LOG_INFO, WOB_FILE, __LINE__, 
__VA_ARGS__)
-#define wob_log_warn(...) _wob_log(_WOB_LOG_WARN, WOB_FILE, __LINE__, 
__VA_ARGS__)
-#define wob_log_error(...) _wob_log(_WOB_LOG_ERROR, WOB_FILE, __LINE__, 
__VA_ARGS__)
-
-#define wob_log_level_debug() _wob_log_set_level(_WOB_LOG_DEBUG);
-#define wob_log_level_info() _wob_log_set_level(_WOB_LOG_INFO);
-#define wob_log_level_warn() _wob_log_set_level(_WOB_LOG_WARN);
-#define wob_log_level_error() _wob_log_set_level(_WOB_LOG_ERROR);
+#define wob_log_debug(...) wob_log(WOB_LOG_DEBUG, WOB_FILE, __LINE__, 
__VA_ARGS__)
+#define wob_log_info(...) wob_log(WOB_LOG_INFO, WOB_FILE, __LINE__, 
__VA_ARGS__)
+#define wob_log_warn(...) wob_log(WOB_LOG_WARN, WOB_FILE, __LINE__, 
__VA_ARGS__)
+#define wob_log_error(...) wob_log(WOB_LOG_ERROR, WOB_FILE, __LINE__, 
__VA_ARGS__)
+
+#define wob_log_level_debug() wob_log_set_level(WOB_LOG_DEBUG);
+#define wob_log_level_info() wob_log_set_level(WOB_LOG_INFO);
+#define wob_log_level_warn() wob_log_set_level(WOB_LOG_WARN);
+#define wob_log_level_error() wob_log_set_level(WOB_LOG_ERROR);
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/log.c new/wob-0.12/log.c
--- old/wob-0.11/log.c  2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/log.c  2021-08-13 19:41:56.000000000 +0200
@@ -32,7 +32,7 @@
 
 #include "log.h"
 
-static _wob_log_importance min_importance_to_log = _WOB_LOG_WARN;
+static wob_log_importance min_importance_to_log = WOB_LOG_WARN;
 
 static bool use_colors = false;
 
@@ -51,7 +51,7 @@
 };
 
 void
-_wob_log(const _wob_log_importance importance, const char *file, const int 
line, const char *fmt, ...)
+wob_log(const wob_log_importance importance, const char *file, const int line, 
const char *fmt, ...)
 {
        if (importance < min_importance_to_log) {
                return;
@@ -92,7 +92,7 @@
 }
 
 void
-_wob_log_set_level(const _wob_log_importance importance)
+wob_log_set_level(const wob_log_importance importance)
 {
        min_importance_to_log = importance;
 }
@@ -106,7 +106,7 @@
 void
 wob_log_inc_verbosity(void)
 {
-       if (min_importance_to_log != _WOB_LOG_DEBUG) {
+       if (min_importance_to_log != WOB_LOG_DEBUG) {
                min_importance_to_log -= 1;
                wob_log_debug("Set log level to %s", 
verbosity_names[min_importance_to_log]);
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/main.c new/wob-0.12/main.c
--- old/wob-0.11/main.c 2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/main.c 2021-08-13 19:41:56.000000000 +0200
@@ -16,7 +16,7 @@
 #define STR(x) #x
 
 // sizeof already includes NULL byte
-#define INPUT_BUFFER_LENGTH (3 * sizeof(unsigned long) + sizeof(" #FF000000 
#FFFFFFFF #FFFFFFFF\n"))
+#define INPUT_BUFFER_LENGTH (3 * sizeof(unsigned long) + sizeof(" #000000FF 
#FFFFFFFF #FFFFFFFF\n"))
 
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
 
@@ -41,6 +41,12 @@
 #include "wlr-layer-shell-unstable-v1-client-protocol.h"
 #include "xdg-output-unstable-v1-client-protocol.h"
 
+enum wob_overflow_mode {
+       OVERFLOW_MODE_NONE,
+       OVERFLOW_MODE_WRAP,
+       OVERFLOW_MODE_NOWRAP,
+};
+
 struct wob_geom {
        unsigned long width;
        unsigned long height;
@@ -490,24 +496,28 @@
        const char *usage =
                "Usage: wob [options]\n"
                "\n"
-               "  -h, --help                 Show help message and quit.\n"
-               "  --version                  Show the version number and 
quit.\n"
-               "  -v                         Increase verbosity of messages, 
defaults to errors and warnings only\n"
-               "  -t, --timeout <ms>         Hide wob after <ms> milliseconds, 
defaults to " STR(WOB_DEFAULT_TIMEOUT) ".\n"
-               "  -m, --max <%>              Define the maximum percentage, 
defaults to " STR(WOB_DEFAULT_MAXIMUM) ". \n"
-               "  -W, --width <px>           Define bar width in pixels, 
defaults to " STR(WOB_DEFAULT_WIDTH) ". \n"
-               "  -H, --height <px>          Define bar height in pixels, 
defaults to " STR(WOB_DEFAULT_HEIGHT) ". \n"
-               "  -o, --offset <px>          Define border offset in pixels, 
defaults to " STR(WOB_DEFAULT_BORDER_OFFSET) ". \n"
-               "  -b, --border <px>          Define border size in pixels, 
defaults to " STR(WOB_DEFAULT_BORDER_SIZE) ". \n"
-               "  -p, --padding <px>         Define bar padding in pixels, 
defaults to " STR(WOB_DEFAULT_BAR_PADDING) ". \n"
-               "  -a, --anchor <s>           Define anchor point; one of 
'top', 'left', 'right', 'bottom', 'center' (default). \n"
-               "                             May be specified multiple times. 
\n"
-               "  -M, --margin <px>          Define anchor margin in pixels, 
defaults to " STR(WOB_DEFAULT_MARGIN) ". \n"
-               "  -O, --output <name>        Define output to show bar on or 
'*' for all. If ommited, focused output is chosen.\n"
-               "                             May be specified multiple 
times.\n"
-               "  --border-color <#argb>     Define border color\n"
-               "  --background-color <#argb> Define background color\n"
-               "  --bar-color <#argb>        Define bar color\n"
+               "  -h, --help                          Show help message and 
quit.\n"
+               "  --version                           Show the version number 
and quit.\n"
+               "  -v                                  Increase verbosity of 
messages, defaults to errors and warnings only\n"
+               "  -t, --timeout <ms>                  Hide wob after <ms> 
milliseconds, defaults to " STR(WOB_DEFAULT_TIMEOUT) ".\n"
+               "  -m, --max <%>                       Define the maximum 
percentage, defaults to " STR(WOB_DEFAULT_MAXIMUM) ". \n"
+               "  -W, --width <px>                    Define bar width in 
pixels, defaults to " STR(WOB_DEFAULT_WIDTH) ". \n"
+               "  -H, --height <px>                   Define bar height in 
pixels, defaults to " STR(WOB_DEFAULT_HEIGHT) ". \n"
+               "  -o, --offset <px>                   Define border offset in 
pixels, defaults to " STR(WOB_DEFAULT_BORDER_OFFSET) ". \n"
+               "  -b, --border <px>                   Define border size in 
pixels, defaults to " STR(WOB_DEFAULT_BORDER_SIZE) ". \n"
+               "  -p, --padding <px>                  Define bar padding in 
pixels, defaults to " STR(WOB_DEFAULT_BAR_PADDING) ". \n"
+               "  -a, --anchor <s>                    Define anchor point; one 
of 'top', 'left', 'right', 'bottom', 'center' (default). \n"
+               "                                      May be specified 
multiple times. \n"
+               "  -M, --margin <px>                   Define anchor margin in 
pixels, defaults to " STR(WOB_DEFAULT_MARGIN) ". \n"
+               "  -O, --output <name>                 Define output to show 
bar on or '*' for all. If ommited, focused output is chosen.\n"
+               "                                      May be specified 
multiple times.\n"
+               "  --border-color <#rgba>              Define border color\n"
+               "  --background-color <#rgba>          Define background 
color\n"
+               "  --bar-color <#rgba>                 Define bar color\n"
+               "  --overflow-mode <mode>              Change the overflow 
behavior. Valid options are `none`, `wrap` (default), and `nowrap`.\n"
+               "  --overflow-bar-color <#rgba>        Define bar color when 
overflowed\n"
+               "  --overflow-border-color <#rgba>     Define the border color 
when overflowed\n"
+               "  --overflow-background-color <#rgba> Define the background 
color when overflowed\n"
                "\n";
 
        struct wob app = {0};
@@ -515,6 +525,7 @@
 
        unsigned long maximum = WOB_DEFAULT_MAXIMUM;
        unsigned long timeout_msec = WOB_DEFAULT_TIMEOUT;
+       enum wob_overflow_mode overflow_mode = OVERFLOW_MODE_WRAP;
        struct wob_geom geom = {
                .width = WOB_DEFAULT_WIDTH,
                .height = WOB_DEFAULT_HEIGHT,
@@ -524,29 +535,17 @@
                .anchor = WOB_DEFAULT_ANCHOR,
                .margin = WOB_DEFAULT_MARGIN,
        };
+
        struct wob_colors colors = {
-               .background =
-                       (struct wob_color){
-                               .alpha = 1.0,
-                               .red = 0.0,
-                               .green = 0.0,
-                               .blue = 0.0,
-                       },
-               .bar =
-                       (struct wob_color){
-                               .alpha = 1.0,
-                               .red = 1.0,
-                               .green = 1.0,
-                               .blue = 1.0,
-                       },
-               .border =
-                       (struct wob_color){
-                               .alpha = 1.0,
-                               .red = 1.0,
-                               .green = 1.0,
-                               .blue = 1.0,
-                       },
-       };
+               .background = (struct wob_color){.a = 1.0f, .r = 0.0f, .g = 
0.0f, .b = 0.0f},
+               .bar = (struct wob_color){.a = 1.0f, .r = 1.0f, .g = 1.0f, .b = 
1.0f},
+               .border = (struct wob_color){.a = 1.0f, .r = 1.0f, .g = 1.0f, 
.b = 1.0f}};
+
+       struct wob_colors overflow_colors = {
+               .background = (struct wob_color){.a = 1.0f, .r = 0.0f, .g = 
0.0f, .b = 0.0f},
+               .bar = (struct wob_color){.a = 1.0f, .r = 1.0f, .g = 0.0f, .b = 
0.0f},
+               .border = (struct wob_color){.a = 1.0f, .r = 1.0f, .g = 1.0f, 
.b = 1.0f}};
+
        bool pledge = true;
 
        char *disable_pledge_env = getenv("WOB_DISABLE_PLEDGE");
@@ -575,8 +574,12 @@
                {"background-color", required_argument, NULL, 2},
                {"bar-color", required_argument, NULL, 3},
                {"verbose", no_argument, NULL, 'v'},
-       };
-       while ((c = getopt_long(argc, argv, "t:m:W:H:o:b:p:a:M:O:vh", 
long_options, &option_index)) != -1) {
+               {"overflow-mode", required_argument, NULL, 6},
+               {"overflow-bar-color", required_argument, NULL, 5},
+               {"overflow-background-color", required_argument, NULL, 7},
+               {"overflow-border-color", required_argument, NULL, 8}};
+
+       while ((c = getopt_long(argc, argv, "t:m:W:H:o:b:p:a:M:O:vh:f", 
long_options, &option_index)) != -1) {
                switch (c) {
                        case 1:
                                if (!wob_parse_color(optarg, &strtoul_end, 
&(colors.border))) {
@@ -695,6 +698,39 @@
                        case 'v':
                                wob_log_inc_verbosity();
                                break;
+                       case 5:
+                               if (!wob_parse_color(optarg, &strtoul_end, 
&(overflow_colors.bar))) {
+                                       wob_log_error("Overflow bar color must 
be a value between #00000000 and #FFFFFFFF.");
+                                       return EXIT_FAILURE;
+                               }
+                               break;
+                       case 6:
+                               if (strcmp(optarg, "none") == 0) {
+                                       overflow_mode = OVERFLOW_MODE_NONE;
+                               }
+                               else if (strcmp(optarg, "wrap") == 0) {
+                                       overflow_mode = OVERFLOW_MODE_WRAP; // 
this is the default
+                               }
+                               else if (strcmp(optarg, "nowrap") == 0) {
+                                       overflow_mode = OVERFLOW_MODE_NOWRAP;
+                               }
+                               else {
+                                       wob_log_error("Invalid argument for 
overflow-mode. Valid options are none, wrap, and nowrap.");
+                                       return EXIT_FAILURE;
+                               }
+                               break;
+                       case 7:
+                               if (!wob_parse_color(optarg, &strtoul_end, 
&(overflow_colors.background))) {
+                                       wob_log_error("Overflow background 
color must be a value between #00000000 and #FFFFFFFF.");
+                                       return EXIT_FAILURE;
+                               }
+                               break;
+                       case 8:
+                               if (!wob_parse_color(optarg, &strtoul_end, 
&(overflow_colors.border))) {
+                                       wob_log_error("Overflow border color 
must be a value between #00000000 and #FFFFFFFF.");
+                                       return EXIT_FAILURE;
+                               }
+                               break;
                        default:
                                fprintf(stderr, "%s", usage);
                                return EXIT_FAILURE;
@@ -739,6 +775,7 @@
        }
 
        struct wob_colors old_colors;
+       struct wob_colors effective_colors = colors;
 
        // Draw these at least once
        wob_draw_background(app.wob_geom, argb, colors.background);
@@ -810,7 +847,6 @@
                                                return EXIT_FAILURE;
                                        }
 
-                                       old_colors = colors;
                                        if (!wob_parse_input(input_buffer, 
&percentage, &colors.background, &colors.border, &colors.bar)) {
                                                wob_log_error("Received invalid 
input");
                                                if (!hidden) wob_hide(&app);
@@ -819,34 +855,54 @@
                                                return EXIT_FAILURE;
                                        }
 
+                                       old_colors = effective_colors;
                                        if (percentage > maximum) {
-                                               wob_log_error("Received value 
%ld is above defined maximum %ld", percentage, maximum);
-                                               if (!hidden) wob_hide(&app);
-                                               wob_destroy(&app);
-
-                                               return EXIT_FAILURE;
-                                       }
-
-                                       wob_log_info("Received input { value = 
%ld, bg = %#x, border = %#x, bar = %#x }", percentage, colors.background, 
colors.border, colors.bar);
+                                               switch (overflow_mode) {
+                                                       case OVERFLOW_MODE_NONE:
+                                                               
wob_log_error("Received value %ld is above defined maximum %ld", percentage, 
maximum);
+                                                               if (!hidden) 
wob_hide(&app);
+                                                               
wob_destroy(&app);
+                                                               return 
EXIT_FAILURE;
+                                                       case OVERFLOW_MODE_WRAP:
+                                                               
effective_colors = overflow_colors;
+                                                               percentage %= 
maximum;
+                                                               break;
+                                                       case 
OVERFLOW_MODE_NOWRAP:
+                                                               
effective_colors = overflow_colors;
+                                                               percentage = 
maximum;
+                                                               break;
+                                               }
+                                       }
+                                       else {
+                                               effective_colors = colors;
+                                       }
+
+                                       wob_log_info(
+                                               "Received input { value = %ld, 
bg = %#x, border = %#x, bar = %#x, overflow = %s }",
+                                               percentage,
+                                               effective_colors.background,
+                                               effective_colors.border,
+                                               effective_colors.bar,
+                                               overflow_mode == 
OVERFLOW_MODE_NONE ? "false" : "true"); // how should this be handled w/ the 
overflow colors?
 
                                        if (hidden) {
                                                wob_show(&app);
                                        }
 
                                        bool redraw_background_and_border = 
false;
-                                       if 
(wob_color_to_argb(old_colors.background) != 
wob_color_to_argb(colors.background)) {
+                                       if 
(wob_color_to_argb(old_colors.background) != 
wob_color_to_argb(effective_colors.background)) {
                                                redraw_background_and_border = 
true;
                                        }
-                                       else if 
(wob_color_to_argb(old_colors.border) != wob_color_to_argb(colors.border)) {
+                                       else if 
(wob_color_to_argb(old_colors.border) != 
wob_color_to_argb(effective_colors.border)) {
                                                redraw_background_and_border = 
true;
                                        }
 
                                        if (redraw_background_and_border) {
-                                               
wob_draw_background(app.wob_geom, argb, colors.background);
-                                               wob_draw_border(app.wob_geom, 
argb, colors.border);
+                                               
wob_draw_background(app.wob_geom, argb, effective_colors.background);
+                                               wob_draw_border(app.wob_geom, 
argb, effective_colors.border);
                                        }
 
-                                       wob_draw_percentage(app.wob_geom, argb, 
colors.bar, colors.background, percentage, maximum);
+                                       wob_draw_percentage(app.wob_geom, argb, 
effective_colors.bar, effective_colors.background, percentage, maximum);
 
                                        wob_flush(&app);
                                        hidden = false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/meson.build new/wob-0.12/meson.build
--- old/wob-0.11/meson.build    2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/meson.build    2021-08-13 19:41:56.000000000 +0200
@@ -1,7 +1,7 @@
 project(
   'wob',
   'c',
-  version: '0.11',
+  version: '0.12',
   license: 'ISC',
   default_options: ['c_std=c99']
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/parse.c new/wob-0.12/parse.c
--- old/wob-0.11/parse.c        2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/parse.c        2021-08-13 19:41:56.000000000 +0200
@@ -1,6 +1,5 @@
 #define WOB_FILE "parse.c"
 
-#include <errno.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
@@ -28,10 +27,10 @@
        }
 
        *color = (struct wob_color){
-               .alpha = parts[0] / ((float) UINT8_MAX),
-               .red = parts[1] / ((float) UINT8_MAX),
-               .green = parts[2] / ((float) UINT8_MAX),
-               .blue = parts[3] / ((float) UINT8_MAX),
+               .r = (float) parts[0] / UINT8_MAX,
+               .g = (float) parts[1] / UINT8_MAX,
+               .b = (float) parts[2] / UINT8_MAX,
+               .a = (float) parts[3] / UINT8_MAX,
        };
 
        if (str_end) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/pledge_seccomp.c 
new/wob-0.12/pledge_seccomp.c
--- old/wob-0.11/pledge_seccomp.c       2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/pledge_seccomp.c       2021-08-13 19:41:56.000000000 +0200
@@ -22,6 +22,7 @@
                SCMP_SYS(exit_group),
                SCMP_SYS(fcntl),
                SCMP_SYS(gettimeofday),
+               SCMP_SYS(munmap),
                SCMP_SYS(poll),
                SCMP_SYS(ppoll),
                SCMP_SYS(read),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/tests/wob_parse_input.c 
new/wob-0.12/tests/wob_parse_input.c
--- old/wob-0.11/tests/wob_parse_input.c        2021-02-06 16:25:12.000000000 
+0100
+++ new/wob-0.12/tests/wob_parse_input.c        2021-08-13 19:41:56.000000000 
+0200
@@ -15,14 +15,14 @@
        bool result;
 
        printf("running 1\n");
-       input = "25 #FF000000 #FFFFFFFF #FFFFFFFF\n";
+       input = "25 #000000FF #FFFFFFFF #FFFFFFFF\n";
        result = wob_parse_input(input, &percentage, &background, &border, 
&bar);
        if (!result || percentage != 25 || wob_color_to_argb(background) != 
0xFF000000 || wob_color_to_argb(border) != 0xFFFFFFFF || wob_color_to_argb(bar) 
!= 0xFFFFFFFF) {
                return EXIT_FAILURE;
        }
 
        printf("running 2\n");
-       input = "25 #FF000000\n";
+       input = "25 #000000FF\n";
        result = wob_parse_input(input, &percentage, &background, &border, 
&bar);
        if (result) {
                return EXIT_FAILURE;
@@ -36,11 +36,18 @@
        }
 
        printf("running 4\n");
-       input = "25 #FF000000 #FFFFFFFF #FFFFFFFF \n";
+       input = "25 #000000FF #FFFFFFFF #FFFFFFFF \n";
        result = wob_parse_input(input, &percentage, &background, &border, 
&bar);
        if (result) {
                return EXIT_FAILURE;
        }
 
+       printf("running 5\n");
+       input = "25 #000000FF #16a085FF #FF0000FF\n";
+       result = wob_parse_input(input, &percentage, &background, &border, 
&bar);
+       if (!result || percentage != 25 || wob_color_to_argb(background) != 
0xFF000000 || wob_color_to_argb(border) != 0xFF16a085 || wob_color_to_argb(bar) 
!= 0xFFFF0000) {
+               return EXIT_FAILURE;
+       }
+
        return EXIT_SUCCESS;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wob-0.11/wob.1.scd new/wob-0.12/wob.1.scd
--- old/wob-0.11/wob.1.scd      2021-02-06 16:25:12.000000000 +0100
+++ new/wob-0.12/wob.1.scd      2021-08-13 19:41:56.000000000 +0200
@@ -55,15 +55,27 @@
        Define output to show bar on or '\*' for all. If ommited, focused 
output is chosen.
        May be specified multiple times.
 
-*--border-color* <#AARRGGBB>
+*--border-color* <#RRGGBBAA>
        Define border color, defaults to #FFFFFFFF.
 
-*--background-color* <#AARRGGBB>
-       Define background color, defaults to #FF000000.
+*--background-color* <#RRGGBBAA>
+       Define background color, defaults to #000000FF.
 
-*--bar-color* <#AARRGGBB>
+*--bar-color* <#RRGGBBAA>
        Define bar color, defaults to #FFFFFFFF.
 
+*--overflow-mode <mode>*
+       Change the overflow mode. Valid options are `none`, `wrap`, and 
`nowrap`.
+
+*--overflow-bar-color* <#AARRGGBB>
+       Define overflow bar color, defaults to #FFFF0000
+
+*--overflow-background-color* <#AARRGGBB>
+       Define overflow background color, defaults to #FF000000
+
+*--overflow-border-color* <#AARRGGBB>
+       Define overflow border color, defaults to #FFFFFFFF     
+
 # USAGE
 
 Wob reads values to display from standart input in the following formats:
@@ -74,7 +86,7 @@
 
 <value> <#background_color> <#border_color> <#bar_color>
 
-Where <value> is number in interval from 0 to *--max* and <#\*color> is color 
in #AARRGGBB format.
+Where <value> is number in interval from 0 to *--max* and <#\*color> is color 
in #RRGGBBAA format.
 
 # ENVIRONMENT
 

++++++ wob.keyring ++++++
--- /var/tmp/diff_new_pack.Ne0y37/_old  2021-08-18 08:56:27.170936743 +0200
+++ /var/tmp/diff_new_pack.Ne0y37/_new  2021-08-18 08:56:27.174936738 +0200
@@ -19,19 +19,25 @@
 ORk+DfLuhS22ICQE+/Tz2DZropsO0v1RifTxbYSKWqpFeOx9534v1yPjc+pxFQGU
 5QjurE5/PRGd38UCcgbcM5aeE9Ek0xvWKCwN1x0K1LOrqMkrJmmP2epibpI9gfJM
 QoYx57g9ndfI0QS5+g8+q/aXoVvFRY3lnjtqeB6xFzR3oWrA12qTzoGNiAsWWwAR
-AQABwsB8BBgBCAAmAhsMFiEEXG2gJN3icXgHPqED9LQy1dZ5kOMFAl40WUkFCQeL
-doYACgkQ9LQy1dZ5kOMvtQf9Hb6ntjuajZlkLCk09pJnWktNo93csKvi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