Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yambar for openSUSE:Factory checked 
in at 2023-01-30 17:10:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yambar (Old)
 and      /work/SRC/openSUSE:Factory/.yambar.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yambar"

Mon Jan 30 17:10:34 2023 rev:6 rq:1061959 version:1.9.0+g34

Changes:
--------
--- /work/SRC/openSUSE:Factory/yambar/yambar.changes    2023-01-23 
18:31:47.944001105 +0100
+++ /work/SRC/openSUSE:Factory/.yambar.new.32243/yambar.changes 2023-01-30 
17:17:56.786790674 +0100
@@ -1,0 +2,10 @@
+Mon Jan 23 01:33:44 UTC 2023 - socvirnyl.est...@gmail.com
+
+- Update to version 1.9.0+g34:
+  * module/dwl: allow specify the name of tags
+  * CHANGELOG.md: add issue #262
+  * modules/pipewire: change type of volume from uint8 to uint16
+  * modules/pipewire: use roundf instead of ceilf for more accuracy
+  * module/river: add support for ‘layout’ events
+
+-------------------------------------------------------------------

Old:
----
  yambar-1.9.0+g28.tar.xz

New:
----
  yambar-1.9.0+g34.tar.xz

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

Other differences:
------------------
++++++ yambar.spec ++++++
--- /var/tmp/diff_new_pack.9Tt8my/_old  2023-01-30 17:17:57.202792964 +0100
+++ /var/tmp/diff_new_pack.9Tt8my/_new  2023-01-30 17:17:57.206792987 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yambar
-Version:        1.9.0+g28
+Version:        1.9.0+g34
 Release:        0
 Summary:        Modular statusbar for X11 and Wayland
 License:        MIT

++++++ _service ++++++
--- /var/tmp/diff_new_pack.9Tt8my/_old  2023-01-30 17:17:57.254793251 +0100
+++ /var/tmp/diff_new_pack.9Tt8my/_new  2023-01-30 17:17:57.258793273 +0100
@@ -3,7 +3,7 @@
     <param name="url">https://codeberg.org/dnkl/yambar.git</param>
     <param name="versionformat">@PARENT_TAG@+g@TAG_OFFSET@</param>
     <param name="scm">git</param>
-    <param name="revision">f75168796ad6f361eb35c4335918468afe7cd8c6</param>
+    <param name="revision">d1776714ed97abeedd4a977f2683c8acd403de7d</param>
     <param name="versionrewrite-pattern">(.*)</param>
     <param name="versionrewrite-replacement">\1</param>
     <param name="changesgenerate">enable</param>

++++++ yambar-1.9.0+g28.tar.xz -> yambar-1.9.0+g34.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yambar-1.9.0+g28/CHANGELOG.md 
new/yambar-1.9.0+g34/CHANGELOG.md
--- old/yambar-1.9.0+g28/CHANGELOG.md   2023-01-02 14:08:21.000000000 +0100
+++ new/yambar-1.9.0+g34/CHANGELOG.md   2023-01-21 15:50:22.000000000 +0100
@@ -13,9 +13,12 @@
 ## Unreleased
 ### Added
 
-* field width tag format option ([#246][246])
+* Field width tag format option ([#246][246])
+* river: support for ‘layout’ events.
+* dwl: support for specifying name of tags ([#256][256])
 
 [246]: https://codeberg.org/dnkl/yambar/issues/246
+[256]: https://codeberg.org/dnkl/yambar/pulls/256
 
 
 ### Changed
@@ -41,11 +44,13 @@
 * dwl module reporting only the last part of the title ([#251][251])
 * i3/sway: regression; persistent workspaces shown twice
   ([#253][253]).
+* pipewire: use roundf instead of ceilf for more accuracy ([#262][262])
 
 [239]: https://codeberg.org/dnkl/yambar/issues/239
 [241]: https://codeberg.org/dnkl/yambar/issues/241
 [251]: https://codeberg.org/dnkl/yambar/pulls/251
 [253]: https://codeberg.org/dnkl/yambar/issues/253
+[262]: https://codeberg.org/dnkl/yambar/issues/262
 
 
 ### Security
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yambar-1.9.0+g28/doc/yambar-modules-dwl.5.scd 
new/yambar-1.9.0+g34/doc/yambar-modules-dwl.5.scd
--- old/yambar-1.9.0+g28/doc/yambar-modules-dwl.5.scd   2023-01-02 
14:08:21.000000000 +0100
+++ new/yambar-1.9.0+g34/doc/yambar-modules-dwl.5.scd   2023-01-21 
15:50:22.000000000 +0100
@@ -7,7 +7,7 @@
 
 This module provides a map of each tags present in dwl.
 
-Each tags has its _id_, its status (_selected_, _empty_, _urgent_)
+Each tags has its _id_, its _name_, its status (_selected_, _empty_, _urgent_)
 and the global data like _title_, _fullscreen_, _floating_,
 _selmon_, and _layout_). The tags start a 1. For needs where
 you only want information about the global data and not the _tags_,
@@ -29,6 +29,9 @@
 |  id
 :  int
 :  Dwl tag id.
+|  name
+:  string
+:  The name of the tag (defaults to _id_ if not set).
 |  selected
 :  bool
 :  True if the tag is currently selected.
@@ -64,6 +67,10 @@
 :  int
 :  yes
 :  The number of defined tags in the dwl `config.def.h`.
+|  name-of-tags
+:  list
+:  false
+:  The name of the tags (must have the same length that _number-of-tags_).
 |  dwl-info-filename
 :  string
 :  yes
@@ -77,16 +84,18 @@
     - dwl:
         number-of-tags: 9
         dwl-info-filename: "/home/ogromny/dwl_info"
+        name-of-tags: [ , , , , , , , ,  ]
         content:
           list:
             items:
               - map:
                   conditions:
-                    selected: {string: {text: "-> {id}"}}
-                    ~empty: {string: {text: "{id}"}}
-                    urgent: {string: {text: "=> {id} <="}}
                     # default tag
                     id == 0: {string: {text: "{layout} {title}"}}
+
+                    selected: {string: {text: "-> {name}"}}
+                    ~empty: {string: {text: "{name}"}}
+                    urgent: {string: {text: "=> {name} <="}}
 ```
 
 # SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yambar-1.9.0+g28/doc/yambar-modules-river.5.scd 
new/yambar-1.9.0+g34/doc/yambar-modules-river.5.scd
--- old/yambar-1.9.0+g28/doc/yambar-modules-river.5.scd 2023-01-02 
14:08:21.000000000 +0100
+++ new/yambar-1.9.0+g34/doc/yambar-modules-river.5.scd 2023-01-21 
15:50:22.000000000 +0100
@@ -54,14 +54,16 @@
 :< *Description*
 |  seat
 :  string
-:  The name of the seat (*title* particle only, see CONFIGURATION)
+:  The name of the seat.
 |  title
 :  string
-:  The seat's focused view's title (*title* particle only, see CONFIGURATION)
+:  The seat's focused view's title.
 |  mode
 :  string
-:  The seat's current mode (entered with e.g. *riverctl enter-mode foobar*)
-
+:  The seat's current mode (entered with e.g. *riverctl enter-mode foobar*).
+|  layout
+:  string
+:  Current layout of the output currently focused by the seat.
 
 # CONFIGURATION
 
@@ -90,7 +92,7 @@
 bar:
   left:
     - river:
-        title: {string: { text: "{seat} - {title} ({mode})" }}
+        title: {string: { text: "{seat} - {title} ({layout}/{mode})" }}
         content:
           map:
             conditions:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yambar-1.9.0+g28/external/river-status-unstable-v1.xml 
new/yambar-1.9.0+g34/external/river-status-unstable-v1.xml
--- old/yambar-1.9.0+g28/external/river-status-unstable-v1.xml  2023-01-02 
14:08:21.000000000 +0100
+++ new/yambar-1.9.0+g34/external/river-status-unstable-v1.xml  2023-01-21 
15:50:22.000000000 +0100
@@ -16,7 +16,7 @@
     OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   </copyright>
 
-  <interface name="zriver_status_manager_v1" version="3">
+  <interface name="zriver_status_manager_v1" version="4">
     <description summary="manage river status objects">
       A global factory for objects that receive status information specific
       to river. It could be used to implement, for example, a status bar.
@@ -47,7 +47,7 @@
     </request>
   </interface>
 
-  <interface name="zriver_output_status_v1" version="2">
+  <interface name="zriver_output_status_v1" version="4">
     <description summary="track output tags and focus">
       This interface allows clients to receive information about the current
       windowing state of an output.
@@ -83,6 +83,21 @@
       </description>
       <arg name="tags" type="uint" summary="32-bit bitfield"/>
     </event>
+
+    <event name="layout_name" since="4">
+      <description summary="name of the layout">
+        Sent once on binding the interface should a layout name exist and again
+        whenever the name changes.
+      </description>
+      <arg name="name" type="string" summary="layout name"/>
+    </event>
+
+    <event name="layout_name_clear" since="4">
+      <description summary="name of the layout">
+        Sent when the current layout name has been removed without a new one
+        being set, for example when the active layout generator disconnects.
+      </description>
+    </event>
   </interface>
 
   <interface name="zriver_seat_status_v1" version="3">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yambar-1.9.0+g28/modules/dwl.c 
new/yambar-1.9.0+g34/modules/dwl.c
--- old/yambar-1.9.0+g28/modules/dwl.c  2023-01-02 14:08:21.000000000 +0100
+++ new/yambar-1.9.0+g34/modules/dwl.c  2023-01-21 15:50:22.000000000 +0100
@@ -18,6 +18,7 @@
 
 struct dwl_tag {
     int id;
+    char *name;
     bool selected;
     bool empty;
     bool urgent;
@@ -52,12 +53,19 @@
 };
 
 static void
+free_dwl_tag(struct dwl_tag *tag)
+{
+    free(tag->name);
+    free(tag);
+}
+
+static void
 destroy(struct module *module)
 {
     struct private *private = module->private;
     private->label->destroy(private->label);
 
-    tll_free_and_free(private->tags, free);
+    tll_free_and_free(private->tags, free_dwl_tag);
     free(private->dwl_info_filename);
     free(private->title);
     free(private->layout);
@@ -91,11 +99,12 @@
                 tag_new_bool(module, "selmon", private->selmon),
                 tag_new_string(module, "layout", private->layout),
                 tag_new_int(module, "id", it->item->id),
+                tag_new_string(module, "name", it->item->name),
                 tag_new_bool(module, "selected", it->item->selected),
                 tag_new_bool(module, "empty", it->item->empty),
                 tag_new_bool(module, "urgent", it->item->urgent),
             },
-            .count = 9,
+            .count = 10,
         };
         exposable[i++] = private->label->instantiate(private->label, &tags);
         tag_set_destroy(&tags);
@@ -110,11 +119,12 @@
             tag_new_bool(module, "selmon", private->selmon),
             tag_new_string(module, "layout", private->layout),
             tag_new_int(module, "id", 0),
+            tag_new_string(module, "name", "0"),
             tag_new_bool(module, "selected", false),
             tag_new_bool(module, "empty", true),
             tag_new_bool(module, "urgent", false),
         },
-        .count = 9,
+        .count = 10,
     };
     exposable[i++] = private->label->instantiate(private->label, &tags);
     tag_set_destroy(&tags);
@@ -124,7 +134,7 @@
 }
 
 static struct dwl_tag *
-dwl_tag_find_or_create(struct private *private, uint32_t id)
+dwl_tag_from_id(struct private *private, uint32_t id)
 {
     tll_foreach(private->tags, it)
     {
@@ -132,11 +142,8 @@
             return it->item;
     }
 
-    /* No need to order the tag, `print_status` from dwl already orders tags */
-    struct dwl_tag *dwl_tag = calloc(1, sizeof(struct dwl_tag));
-    dwl_tag->id = id;
-    tll_push_back(private->tags, dwl_tag);
-    return dwl_tag;
+    assert(false); /* unreachable */
+    return NULL;
 }
 
 static void
@@ -219,7 +226,7 @@
                     for (size_t id = 1; id <= private->number_of_tags; ++id) {
                         uint32_t mask = 1 << (id - 1);
 
-                        struct dwl_tag *dwl_tag = 
dwl_tag_find_or_create(private, id);
+                        struct dwl_tag *dwl_tag = dwl_tag_from_id(private, id);
                         dwl_tag->selected = mask & selected;
                         dwl_tag->empty = !(mask & occupied);
                         dwl_tag->urgent = mask & urgent;
@@ -420,13 +427,30 @@
 }
 
 static struct module *
-dwl_new(struct particle *label, int number_of_tags, char const 
*dwl_info_filename)
+dwl_new(struct particle *label, int number_of_tags,
+        struct yml_node const *name_of_tags, char const *dwl_info_filename)
 {
     struct private *private = calloc(1, sizeof(struct private));
     private->label = label;
     private->number_of_tags = number_of_tags;
     private->dwl_info_filename = strdup(dwl_info_filename);
 
+    struct yml_list_iter list = {0};
+    if (name_of_tags)
+        list = yml_list_iter(name_of_tags);
+
+    for (int i = 1; i <= number_of_tags; i++) {
+        struct dwl_tag *dwl_tag = calloc(1, sizeof(struct dwl_tag));
+        dwl_tag->id = i;
+        if (list.node) {
+            dwl_tag->name = strdup(yml_value_as_string(list.node));
+            yml_list_next(&list);
+        } else if (asprintf(&dwl_tag->name, "%d", i) < 0) {
+            LOG_ERRNO("asprintf");
+        }
+        tll_push_back(private->tags, dwl_tag);
+    }
+
     struct module *module = module_common_new();
     module->private = private;
     module->run = &run;
@@ -442,10 +466,21 @@
 {
     struct yml_node const *content = yml_get_value(node, "content");
     struct yml_node const *number_of_tags = yml_get_value(node, 
"number-of-tags");
+    struct yml_node const *name_of_tags = yml_get_value(node, "name-of-tags");
     struct yml_node const *dwl_info_filename = yml_get_value(node, 
"dwl-info-filename");
 
     return dwl_new(conf_to_particle(content, inherited), 
yml_value_as_int(number_of_tags),
-                   yml_value_as_string(dwl_info_filename));
+                   name_of_tags, yml_value_as_string(dwl_info_filename));
+}
+
+static bool
+verify_names(keychain_t *keychain, const struct yml_node *node)
+{
+    if (!yml_is_list(node)) {
+        LOG_ERR("%s: %s is not a list", conf_err_prefix(keychain, node), 
yml_value_as_string(node));
+        return false;
+    }
+    return conf_verify_list(keychain, node, &conf_verify_string);
 }
 
 static bool
@@ -454,6 +489,7 @@
 
     static struct attr_info const attrs[] = {
         {"number-of-tags", true, &conf_verify_unsigned},
+        {"name-of-tags", false, &verify_names},
         {"dwl-info-filename", true, &conf_verify_string},
         MODULE_COMMON_ATTRS,
     };
@@ -463,10 +499,19 @@
 
     /* No need to check whether is `number_of_tags` is a int
      * because `conf_verify_unsigned` already did it */
-    struct yml_node const *key = yml_get_key(node, "number-of-tags");
+    struct yml_node const *ntags_key = yml_get_key(node, "number-of-tags");
     struct yml_node const *value = yml_get_value(node, "number-of-tags");
-    if (yml_value_as_int(value) == 0) {
-        LOG_ERR("%s: %s must not be 0", conf_err_prefix(keychain, key), 
yml_value_as_string(key));
+    int number_of_tags = yml_value_as_int(value);
+    if (number_of_tags == 0) {
+        LOG_ERR("%s: %s must not be 0", conf_err_prefix(keychain, ntags_key), 
yml_value_as_string(ntags_key));
+        return false;
+    }
+
+    struct yml_node const *key = yml_get_key(node, "name-of-tags");
+    value = yml_get_value(node, "name-of-tags");
+    if (value && yml_list_length(value) != number_of_tags) {
+        LOG_ERR("%s: %s must have the same number of elements that %s", 
conf_err_prefix(keychain, key),
+                yml_value_as_string(key), yml_value_as_string(ntags_key));
         return false;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yambar-1.9.0+g28/modules/pipewire.c 
new/yambar-1.9.0+g34/modules/pipewire.c
--- old/yambar-1.9.0+g28/modules/pipewire.c     2023-01-02 14:08:21.000000000 
+0100
+++ new/yambar-1.9.0+g34/modules/pipewire.c     2023-01-21 15:50:22.000000000 
+0100
@@ -35,8 +35,8 @@
 
     /* informations */
     bool muted;
-    uint8_t linear_volume; /* classic volume */
-    uint8_t cubic_volume;  /* volume a la pulseaudio */
+    uint16_t linear_volume; /* classic volume */
+    uint16_t cubic_volume;  /* volume a la pulseaudio */
     char *name;
     char *description;
     char *form_factor; /* headset, headphone, speaker, ..., can be null */
@@ -478,8 +478,8 @@
                 total += values[i];
 
             float base_volume = total / n_values;
-            output_informations->linear_volume = ceilf(base_volume * 100);
-            output_informations->cubic_volume = ceilf(cbrtf(base_volume) * 
100);
+            output_informations->linear_volume = roundf(base_volume * 100);
+            output_informations->cubic_volume = roundf(cbrtf(base_volume) * 
100);
         }
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yambar-1.9.0+g28/modules/river.c 
new/yambar-1.9.0+g34/modules/river.c
--- old/yambar-1.9.0+g28/modules/river.c        2023-01-02 14:08:21.000000000 
+0100
+++ new/yambar-1.9.0+g34/modules/river.c        2023-01-21 15:50:22.000000000 
+0100
@@ -32,6 +32,9 @@
     uint32_t occupied;
     uint32_t focused;
     uint32_t urgent;
+
+    /* Layout */
+    char *layout;
 };
 
 struct seat {
@@ -154,14 +157,19 @@
         size_t i = 32;
         tll_foreach(m->seats, it) {
             const struct seat *seat = &it->item;
+            const char *layout =
+                seat->output != NULL && seat->output->layout != NULL
+                ? seat->output->layout
+                : "";
 
             struct tag_set tags = {
                 .tags = (struct tag *[]){
                     tag_new_string(mod, "seat", seat->name),
                     tag_new_string(mod, "title", seat->title),
                     tag_new_string(mod, "mode", seat->mode),
+                    tag_new_string(mod, "layout", layout),
                 },
-                .count = 3,
+                .count = 4,
             };
 
             tag_parts[i++] = m->title->instantiate(m->title, &tags);
@@ -193,6 +201,7 @@
             seat->output = NULL;
     }
     free(output->name);
+    free(output->layout);
     if (output->status != NULL)
         zriver_output_status_v1_destroy(output->status);
     if (output->xdg_output != NULL)
@@ -270,11 +279,53 @@
     mod->bar->refresh(mod->bar);
 }
 
+#if defined(ZRIVER_OUTPUT_STATUS_V1_LAYOUT_NAME_SINCE_VERSION)
+static void
+layout_name(void *data,
+            struct zriver_output_status_v1 *zriver_output_status_v1,
+            const char *name)
+{
+    struct output *output = data;
+    struct module *mod = output->m->mod;
+
+    mtx_lock(&mod->lock);
+    {
+        free(output->layout);
+        output->layout = name != NULL ? strdup(name) : NULL;
+    }
+    mtx_unlock(&mod->lock);
+    mod->bar->refresh(mod->bar);
+}
+#endif
+
+#if defined(ZRIVER_OUTPUT_STATUS_V1_LAYOUT_NAME_CLEAR_SINCE_VERSION)
+static void
+layout_name_clear(void *data,
+                                 struct zriver_output_status_v1 
*zriver_output_status_v1)
+{
+    struct output *output = data;
+    struct module *mod = output->m->mod;
+
+    mtx_lock(&mod->lock);
+    {
+        free(output->layout);
+        output->layout = NULL;
+    }
+    mtx_unlock(&mod->lock);
+    mod->bar->refresh(mod->bar);
+}
+#endif
 
 static const struct zriver_output_status_v1_listener 
river_status_output_listener = {
     .focused_tags = &focused_tags,
     .view_tags = &view_tags,
     .urgent_tags = &urgent_tags,
+#if defined(ZRIVER_OUTPUT_STATUS_V1_LAYOUT_NAME_SINCE_VERSION)
+    .layout_name = &layout_name,
+#endif
+#if defined(ZRIVER_OUTPUT_STATUS_V1_LAYOUT_NAME_CLEAR_SINCE_VERSION)
+    .layout_name_clear = &layout_name_clear,
+#endif
 };
 
 static void
@@ -599,7 +650,7 @@
             return;
 
         m->status_manager = wl_registry_bind(
-            registry, name, &zriver_status_manager_v1_interface, min(version, 
3));
+            registry, name, &zriver_status_manager_v1_interface, min(version, 
4));
 
         mtx_lock(&m->mod->lock);
         tll_foreach(m->outputs, it)

Reply via email to