dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

[BUG] Waybar is started twice at login (autostart.lua + ml4w-wallpaper reload)

Open M1kele81 opened this issue 3 weeks ago • 2 comments

Describe the bug

On every login Waybar is started twice. The first instance shows up with the previous colors and some modules not ready yet. It is then killed and a second instance is started a moment later, so the bar visibly disappears and comes back.

There are two launches:

  1. dotfiles/.config/hypr/conf/autostart.lua starts Waybar directly:
    -- Start waybar
    hl.exec_cmd(HOME .. "/.config/waybar/launch.sh")
    
  2. A few seconds later ml4w-autostart runs ml4w-wallpaper "<cache>" --skip-wallpaper, which calls run_matugen and then reload_waybar. That function does killall waybar and runs launch.sh again.

Looking at the history, this looks like an overlap between two changes made two days apart:

  • c470e824 (Jun 23) added the Waybar launch to autostart.lua. At that point ml4w-wallpaper was skipped entirely when the awww cache existed, so the bar had to be started from somewhere else.
  • a4a1bebd (Jun 25) changed ml4w-autostart to always run ml4w-wallpaper ... --skip-wallpaper for theming. Since then Waybar is also (re)started by reload_waybar, so the launch in autostart.lua is redundant.
  • 0d676f10 (Jul 14) changed reload_waybar from pkill -SIGUSR2 waybar to killall waybar, which makes the restart visible as a flicker.

The issue is present from 2.14.0 up to 2.17.

Steps to reproduce

  1. Use Waybar as the status bar (~/.config/ml4w/settings/statusbar = waybar) with the default autostart.
  2. Make sure the awww cache exists (any normal login after the first one).
  3. Log in to Hyprland.
  4. Waybar appears, disappears for a moment and then appears again. The autostart log in ~/.local/state/ml4w-os-hyprland/ shows Waybar is currently running. followed by Waybar restarted.

Expected behavior

Waybar should start only once at login, already themed by matugen.

A possible fix is to drop the launch from autostart.lua and let ml4w-wallpaper start Waybar after matugen. Another option is to keep it there and have reload_waybar skip the kill and relaunch when it is called from ml4w-autostart.

Distribution

Arch Linux

Additional context

ML4W dotfiles 2.17 (stable), Hyprland with Lua config, wallpaper-app = quickshell. The installed files are identical to the ones in the repo (no local changes).

M1kele81 avatar Nov 10 '26 18:11 M1kele81

The issue should be fixed in the Rolling Release for 2.17.1. Do you have a chance to test it?

mylinuxforwork avatar Nov 12 '26 10:11 mylinuxforwork

Thanks for the quick fix!

I don’t have much time right now to test the Rolling Release, but I’ll install 2.17.1 as soon as the stable release is out, on both my ThinkPad X1 and my Lenovo M70q, and I’ll report back here whether Waybar starts only once at login.

One more thing, if you don’t mind a bit of feedback: I noticed you’re planning to move from Waybar to Quickshell at some point. I’m a big fan of the Waybar themes, especially ML4W Minimal, mostly for aesthetic reasons. It’s just personal taste, but the current Quickshell bar feels a bit too bulky for me compared to the Minimal one. If Waybar is eventually dropped, it would be great to have a Quickshell variant with a similar slim, minimal look.

Thanks again for all the work you put into these dotfiles!

M1kele81 avatar Nov 12 '26 10:11 M1kele81