Tobias Brox 13469a8847 fix(keyboard-state): fix segfault on device hotplug
The keyboard-state module crashes with SIGSEGV in libinput_device_ref
when a new input device appears in /dev/input/.

Three bugs fixed:

1. Missing NULL check: tryAddDevice() calls libinput_path_add_device()
   which returns NULL on failure, then immediately passes the result to
   libinput_device_ref() without checking.  On laptops, virtual input
   devices (power buttons, lid switch, etc.) appear and disappear in
   /dev/input/ triggering the hotplug handler; if libinput can't open
   one of these, the NULL return causes the segfault.

2. Missing cleanup on device removal: The IN_DELETE handler erased
   devices from the map without calling libinput_path_remove_device(),
   leaving dangling pointers in the libinput context.

3. Thread safety: libinput_devices_ was accessed from 3 threads
   (main/GTK, libinput_thread_, hotplug_thread_) without any mutex.

Fixes #4851

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 11:57:23 +01:00
2025-12-18 23:47:01 -06:00
2018-08-09 20:50:11 +02:00
2026-02-04 09:24:14 +01:00
2022-04-06 08:37:19 +02:00
2019-04-18 15:55:45 +02:00
2018-08-09 20:50:11 +02:00
2025-08-23 18:25:45 +02:00
2025-04-15 14:56:28 -05:00
2026-02-01 00:18:11 +00:00
2025-01-01 06:34:11 -05:00
2025-04-18 22:56:36 +02:00
2026-02-06 21:15:03 +01:00
2018-10-01 18:56:58 +02:00
2018-10-01 18:56:58 +02:00

Waybar Licence Paypal Donate
Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors.
Available in all major distributions
Waybar examples

Current features

  • Sway (Workspaces, Binding mode, Focused window name)
  • River (Mapping mode, Tags, Focused window name)
  • Hyprland (Window Icons, Workspaces, Focused window name)
  • Niri (Workspaces, Focused window name, Language)
  • DWL (Tags, Focused window name) requires dwl ipc patch
  • Tray #21
  • Local time
  • Battery
  • UPower
  • Power profiles daemon
  • Network
  • Bluetooth
  • Pulseaudio
  • Privacy Info
  • Wireplumber
  • Disk
  • Memory
  • Cpu load average
  • Temperature
  • MPD
  • Custom scripts
  • Custom image
  • Multiple output configuration
  • And many more customizations

Configuration and Styling

See the wiki for more details.

Installation

Waybar is available from a number of Linux distributions:

Packaging status

An Ubuntu PPA with more recent versions is available here.

Building from source

$ git clone https://github.com/Alexays/Waybar
$ cd Waybar
$ meson setup build
$ ninja -C build
$ ./build/waybar
# If you want to install it
$ ninja -C build install
$ waybar

Dependencies

gtkmm3
jsoncpp
libsigc++
fmt
wayland
chrono-date
spdlog
libgtk-3-dev [gtk-layer-shell]
gobject-introspection [gtk-layer-shell]
libgirepository1.0-dev [gtk-layer-shell]
libpulse [Pulseaudio module]
libnl [Network module]
libappindicator-gtk3 [Tray module]
libdbusmenu-gtk3 [Tray module]
libmpdclient [MPD module]
libsndio [sndio module]
libevdev [KeyboardState module]
xkbregistry
upower [UPower battery module]

Build dependencies

cmake
meson
scdoc
wayland-protocols

On Ubuntu, you can install all the relevant dependencies using this command (tested with 19.10 and 20.04):

sudo apt install \
  clang-tidy \
  gobject-introspection \
  libdbusmenu-gtk3-dev \
  libevdev-dev \
  libfmt-dev \
  libgirepository1.0-dev \
  libgtk-3-dev \
  libgtkmm-3.0-dev \
  libinput-dev \
  libjsoncpp-dev \
  libmpdclient-dev \
  libnl-3-dev \
  libnl-genl-3-dev \
  libpulse-dev \
  libsigc++-2.0-dev \
  libspdlog-dev \
  libwayland-dev \
  scdoc \
  upower \
  libxkbregistry-dev

On Arch, you can use this command:

pacman -S --asdeps \
  gtkmm3 \
  jsoncpp \
  libsigc++ \
  fmt \
  wayland \
  chrono-date \
  spdlog \
  gtk3 \
  gobject-introspection \
  libgirepository \
  libpulse \
  libnl \
  libappindicator-gtk3 \
  libdbusmenu-gtk3 \
  libmpdclient \
  sndio \
  libevdev \
  libxkbcommon \
  upower \
  meson \
  cmake \
  scdoc \
  wayland-protocols \
  glib2-devel

Contributions welcome!
Have fun :)
The style guidelines are Google's

Caution

Distributions of Waybar are only released on the official GitHub page.
Waybar does not have an official website. Do not trust any sites that claim to be official.

License

Waybar is licensed under the MIT license. See LICENSE for more information.

Description
Fork of https://github.com/Alexays/Waybar to work with my fork of river
Readme MIT 6.8 MiB
Languages
C++ 95%
Meson 2.5%
Python 0.7%
CSS 0.5%
C 0.5%
Other 0.8%