Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1027069: waybar: improve its .service file?

164 views
Skip to first unread message

Patrice Duroux

unread,
Dec 27, 2022, 9:20:03 AM12/27/22
to
Package: waybar
Version: 0.9.16-1
Severity: wishlist

Dear Maintainer,

Could it be possible by improving the .service file to not start its service
when the graphical session is not a sway/wlroots based one?

It would avoid to have multiple messages like the following:
déc. 27 14:40:08 kos-moceratops systemd[2258]: waybar.service: Scheduled
restart job, restart counter is at 4.
déc. 27 14:40:08 kos-moceratops systemd[2258]: Stopped Highly customizable
Wayland bar for Sway and Wlroots based compositors..
déc. 27 14:40:08 kos-moceratops systemd[2258]: Started Highly customizable
Wayland bar for Sway and Wlroots based compositors..
déc. 27 14:40:08 kos-moceratops waybar[3656]: [2022-12-27 14:40:08.898] [info]
Using configuration file /etc/xdg/waybar/config
déc. 27 14:40:08 kos-moceratops waybar[3656]: [2022-12-27 14:40:08.898] [info]
Using CSS file /etc/xdg/waybar/style.css
déc. 27 14:40:08 kos-moceratops waybar[3656]: [2022-12-27 14:40:08.903] [error]
Failed to acquire required resources.
déc. 27 14:40:08 kos-moceratops systemd[2258]: waybar.service: Main process
exited, code=exited, status=1/FAILURE
déc. 27 14:40:08 kos-moceratops systemd[2258]: waybar.service: Failed with
result 'exit-code'.
déc. 27 14:40:09 kos-moceratops systemd[2258]: waybar.service: Scheduled
restart job, restart counter is at 5.
déc. 27 14:40:09 kos-moceratops systemd[2258]: Stopped Highly customizable
Wayland bar for Sway and Wlroots based compositors..
déc. 27 14:40:09 kos-moceratops systemd[2258]: waybar.service: Start request
repeated too quickly.
déc. 27 14:40:09 kos-moceratops systemd[2258]: waybar.service: Failed with
result 'exit-code'.
déc. 27 14:40:09 kos-moceratops systemd[2258]: Failed to start Highly
customizable Wayland bar for Sway and Wlroots based compositors..

And so 'systemctl --user status' reports 'State: degraded' probably due to
that.

I know that I can mask it in my own graphical session (GNOME).

Lastly, I don't know if this could be possible because I did not check how
other desktop session .service files
deal to avoid such cross-desktop "pollution". Or if it's really useful.

Regards,
Patrice


-- System Information:
Debian Release: bookworm/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-0-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages waybar depends on:
ii init-system-helpers 1.65.2
ii libatkmm-1.6-1v5 2.28.3-1
ii libc6 2.36-7
ii libcairomm-1.0-1v5 1.14.4-2
ii libdbusmenu-gtk3-4 18.10.20180917~bzr492+repack1-3
ii libevdev2 1.13.0+dfsg-1
ii libfmt9 9.1.0+ds1-2
ii libgcc-s1 12.2.0-11
ii libglib2.0-0 2.74.3-1
ii libglibmm-2.4-1v5 2.66.5-2
ii libgtk-3-0 3.24.35-3
ii libgtk-layer-shell0 0.8.0-1
ii libgtkmm-3.0-1v5 3.24.7-1
ii libinput10 1.22.0-1
ii libjack-jackd2-0 [libjack-0.125] 1.9.21~dfsg-1
ii libjsoncpp25 1.9.5-4
ii libmpdclient2 2.20-1+b1
ii libnl-3-200 3.7.0-0.2+b1
ii libnl-genl-3-200 3.7.0-0.2+b1
ii libpulse0 16.1+dfsg1-2+b1
ii libsigc++-2.0-0v5 2.10.8-1
ii libsndio7.0 1.9.0-0.3+b1
ii libspdlog1.10 [libspdlog1.10-fmt9] 1:1.10.0+ds-0.4
ii libstdc++6 12.2.0-11
ii libudev1 252.4-1
ii libupower-glib3 0.99.20-2
ii libwayland-client0 1.21.0-1
ii libxkbregistry0 1.4.1-1

waybar recommends no packages.

Versions of packages waybar suggests:
ii fonts-font-awesome 5.0.10+really4.7.0~dfsg-4.1
ii libayatana-appindicator3-1 [libappindicator3-1 0.5.91-1
]
ii sway 1.7-6

-- no debconf information

Guido Günther

unread,
Jan 2, 2023, 9:00:04 AM1/2/23
to
Hi,
On Mon, Jan 02, 2023 at 12:34:09PM +0100, Birger Schacht wrote:
> Hi,
>
> I asked in the wlroots IRC channel and got the information that it is not
> possible to find out if a program is starting in a wlroots based compositor.
> I thought maybe an environment variable that usable with systemd's
> `ConditionEnvironment` could exist, but apparently thats not the case.
> But I'm open to suggestions how to fix that.

The error is triggered by

```
wl_display_roundtrip(wl_display);
if (layer_shell == nullptr || xdg_output_manager == nullptr) {
throw std::runtime_error("Failed to acquire required resources.");
}
```

so

weston-info 2>/dev/null | grep -E "interface: 'zwlr_layer_shell"

should get you pretty close. This will break once waybar switches to
ext-layer-shell so maybe

weston-info 2>/dev/null | grep -E "interface: 'z(wlr|ext)_layer_shell"

works better.

Cheers,
-- Guido

>
> cheers,
> Birger
>
>

Birger Schacht

unread,
Jan 2, 2023, 9:20:04 AM1/2/23
to
Hi,

On 1/2/23 14:49, Guido Günther wrote:
> Hi,
[...]
>
> The error is triggered by
>
> ```
> wl_display_roundtrip(wl_display);
> if (layer_shell == nullptr || xdg_output_manager == nullptr) {
> throw std::runtime_error("Failed to acquire required resources.");
> }
> ```
>
> so
>
> weston-info 2>/dev/null | grep -E "interface: 'zwlr_layer_shell"
>
> should get you pretty close. This will break once waybar switches to
> ext-layer-shell so maybe
>
> weston-info 2>/dev/null | grep -E "interface: 'z(wlr|ext)_layer_shell"
>
> works better.

Ah, thats nice! I also thought of simply writing a
`am_i_in_a_wlroots_compositor` program, but I fail to find out how I
would use that in a systemd service file so that the service does not
try to restart if the condition is not met.

cheers,
Birger

Patrice Duroux

unread,
Jan 2, 2023, 10:10:04 AM1/2/23
to
Hi,

Is there nothing to propose in the line of freedesktop.org?
(based for instance on any XDG_CURRENT_DESKTOP or DESKTOP_SESSION envvar)
I am not aware about how weston/sway based desktops are currently
integrated with the others (GNOME, KDE, etc).
Does-it exist a Debian team that would coordinate and may have
suggestions / recommendations for that?

Note also that using sid:
$ weston-info

*** Please use wayland-info instead
*** weston-info is deprecated and will be removed in a future version
<cut>

And I think that wayland-info is part of wayland-utils(1) that is not
yet packaged, isn't it?

Many thanks,
Patrice

(1) https://wayland.freedesktop.org/releases.html

Diederik de Haas

unread,
Oct 20, 2023, 6:00:05 AM10/20/23
to
On 2 Jan 2023 15:59:50 +0100 Patrice Duroux <patrice...@gmail.com> wrote:
> Note also that using sid:
> $ weston-info
>
> *** Please use wayland-info instead
> *** weston-info is deprecated and will be removed in a future version
> <cut>
>
> And I think that wayland-info is part of wayland-utils(1) that is not
> yet packaged, isn't it?

Note that in Trixie/Sid, `weston-info` is no longer available as it has been
removed from the `weston` package.
The `wayland-utils` package with the `wayland-info` package is available since
Bookworm (looks like they were just in time).
signature.asc

Vladimir K

unread,
Dec 7, 2023, 4:50:04 PM12/7/23
to
One can repurpose sysetmd XDG Autostart filter:

Either exlusive method:

ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "" "GNOME:KDE"

Or inclusive:

ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "wlroots:sway:Wayfire:labwc" ""
0 new messages