Giter Site home page Giter Site logo

alexays / waybar Goto Github PK

View Code? Open in Web Editor NEW
5.4K 36.0 635.0 4.2 MB

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:

License: MIT License

C++ 94.46% Meson 2.76% CSS 0.59% Python 0.77% Makefile 0.04% Dockerfile 0.46% Nix 0.37% C 0.55%
wayland wlroots sway bar statusbar gtk i3status

waybar's Introduction

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)
  • 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 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

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

License

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

waybar's People

Contributors

alebastr avatar alexays avatar anakael avatar asas1asas200 avatar chayleaf avatar erikreider avatar fuzxi avatar grantmoyer avatar jbeich avatar jordanl2 avatar jramrath avatar kennypm avatar khaneliman avatar kiridevs avatar lbartoletti avatar lukashonakv avatar marcplustwo avatar mazunki avatar michaelaquilina avatar mightyplaza avatar minijackson avatar mr-pine avatar nullobsi avatar organic-code avatar rbnis avatar syndelis avatar taminob avatar tperard avatar vaxerski avatar zjeffer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

waybar's Issues

Crash under X11 instead of error message

It should print something like: This is a wayland bar. It can't run under X11.
Currently:

 ~ >>> waybar

(waybar:3047): Gdk-CRITICAL **: 20:29:59.862: gdk_wayland_display_get_wl_display: assertion 'GDK_IS_WAYLAND_DISPLAY (display)' failed
Exception: waybar killed by signal segmentation fault (core dumped)
[tty], line 1: waybar
 ~ >>>

Libappindicator tray

Tray beta now shipped :)

Bugs I noticed:

  • Menu not correctly positioned (also Tooltips) #63
  • Support multi modules
  • With multiple apps in tray, only the last is interactive, the others cause crash

Electron apps

You need libappindicator-gtk3 (added to AUR package)
and launch apps with env XDG_CURRENT_DESKTOP=Unity slack

Avoid polling

Current modules that do not using polling:

  • Workspaces ea9a08d
  • Pulseaudio
  • Battery a423f70
  • Clock
  • Network d280f5e
  • Custom (Can only use polling)
  • Memory (Can only use polling)
  • Cpu (Can only use polling)

SIGSEGV

(gdb) bt full
#0  0x0000000000000000 in  ()
#1  0x00007ffff65373f2 in  () at /usr/lib/libgtk-3.so.0
#2  0x00007ffff65603b5 in  () at /usr/lib/libgtk-3.so.0
#3  0x00007ffff654b55d in  () at /usr/lib/libgtk-3.so.0
#4  0x00007ffff65602f0 in  () at /usr/lib/libgtk-3.so.0
#5  0x00007ffff654db2d in  () at /usr/lib/libgtk-3.so.0
#6  0x00007ffff654c905 in  () at /usr/lib/libgtk-3.so.0
#7  0x00007ffff654d6c5 in  () at /usr/lib/libgtk-3.so.0
#8  0x00007ffff654d6db in  () at /usr/lib/libgtk-3.so.0
#9  0x00007ffff654d6db in  () at /usr/lib/libgtk-3.so.0
#10 0x00007ffff654d6db in  () at /usr/lib/libgtk-3.so.0
#11 0x00007ffff654d6db in  () at /usr/lib/libgtk-3.so.0
#12 0x00007ffff6533a78 in  () at /usr/lib/libgtk-3.so.0
#13 0x00007ffff5e96a4d in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#14 0x00007ffff5ea9e40 in  () at /usr/lib/libgobject-2.0.so.0
#15 0x00007ffff5eb26f6 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#16 0x00007ffff5eb3130 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#17 0x00007ffff6119bab in  () at /usr/lib/libgdk-3.so.0
#18 0x00007ffff6104843 in  () at /usr/lib/libgdk-3.so.0
#19 0x00007ffff43c6cb3 in  () at /usr/lib/libglib-2.0.so.0
#20 0x00007ffff43c61d6 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#21 0x00007ffff43c65b1 in  () at /usr/lib/libglib-2.0.so.0
#22 0x00007ffff43c68e2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#23 0x00007ffff65ffdcf in gtk_main () at /usr/lib/libgtk-3.so.0
#24 0x000055555558b2d6 in waybar::Client::main(int, char**) (this=0x7fffffffdd50, argc=1, argv=0x7fffffffdee8) at ../src/client.cpp:82
#25 0x000055555557970b in main(int, char**) (argc=1, argv=0x7fffffffdee8) at ../src/main.cpp:22
        c = 
                {cssFile = "./resources/style.css", configFile = "./resources/config", gtk_main = <incomplete type>, gdk_display = {pCppObject_ = 0x5555556b61a0}, wlDisplay = 0x5555555ef160, registry = 0x5555556d9150, layer_shell = 0x55555571dfe0, idle_manager = 0x55555571e0f0, seat = 0x55555571ded0, bars = {_order = std::vector of length 1, capacity 1 = {std::unique_ptr<waybar::Bar> = {get() = 0x555555633e10}}}}

Is there any way to have icons with different colors than text?

I've checked already with the GTK inspector to see if the icon is wrapped in a tag that I can reference using CSS, but the icon (fontawesome) is in the same level as the text.

Tried as well to wrap the icon using a tag but I got the tag rendered as a text.

I think it would be great to custom wrap elements in tags (I dont know how difficult is with the current implementation) for a finer css styling

I can imagine something like

<button>
<span class = "index">{index}</span>
<span class = "icon">{icon}</span>
<span class = "name"></span>
</button>

btw I really love the project and styling with css is supergreat!

PulseAudio volume does not correspond to pavucontrol

I have sway config set to increment/decrement volume by 5%, and pavucontrol reflects this.
Waybar's audio display module seems to usually show 4% increments however.

Just a little annoyance, bugs me quite a bit.
I'll look and try to fix it, just been a while since I did C, and never really touched C++.

SIGABRT on startup

(gdb) bt full
#0  0x00007f375814fb5f in raise () at /usr/lib/libc.so.6
#1  0x00007f375813a452 in abort () at /usr/lib/libc.so.6
#2  0x00007f375864d71c in pa_signal_init () at /usr/lib/libpulse.so.0
#3  0x0000558fb175a599 in waybar::modules::Pulseaudio::Pulseaudio(Json::Value) (this=0x558fb3178800, config=...) at ../src/modules/pulseaudio.cpp:13
#4  0x0000558fb175e5ae in waybar::Factory::makeModule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (this=0x7ffebbe5f710, name="pulseaudio")
    at ../src/factory.cpp:22
#5  0x0000558fb173e3bc in waybar::Bar::_setupWidgets() (this=0x558fb31da700) at ../src/bar.cpp:181
        module = @0x558fb3114600: {_vptr.IModule = 0x558fb1793ac8 <vtable for waybar::modules::Network+16>}
        name = 
          {static null = @0x7f375a95a040, static nullRef = @0x7f375a95a040, static minLargestInt = -9223372036854775808, static maxLargestInt = 9223372036854775807, static maxLargestUInt = 18446744073709551615, static minInt = -2147483648, static maxInt = 2147483647, static maxUInt = 4294967295, static minInt64 = -9223372036854775808, static maxInt64 = 9223372036854775807, static maxUInt64 = 18446744073709551615, value_ = {int_ = 94075674253840, uint_ = 94075674253840, real_ = 4.6479558758174189e-310, bool_ = 16, string_ = 0x558fb3255a10 "\n", map_ = 0x558fb3255a10}, type_ = Json::stringValue, allocated_ = 1, comments_ = 0x0, start_ = 78, limit_ = 90}
        __for_range = 
          @0x558fb3282cc0: {static null = @0x7f375a95a040, static nullRef = @0x7f375a95a040, static minLargestInt = -9223372036854775808, static maxLargestInt = 9223372036854775807, static maxLargestUInt = 18446744073709551615, static minInt = -2147483648, static maxInt = 2147483647, static maxUInt = 4294967295, static minInt64 = -9223372036854775808, static maxInt64 = 9223372036854775807, static maxUInt64 = 18446744073709551615, value_ = {int_ = 94075674379248, uint_ = 94075674379248, real_ = 4.6479558820133974e-310, bool_ = 240, string_ = 0x558fb32743f0 "\220\234\022\263\217U", map_ = 0x558fb32743f0}, type_ = Json::arrayValue, allocated_ = 0, comments_ = 0x0, start_ = 77, limit_ = 139}
        __for_begin = Python Exception <class 'gdb.error'> No type named std::_Rb_tree_node<std::pair<Json::Value::CZString const, Json::Value>>.: 
{<Json::ValueIteratorBase> = {current_ = {_M_node = 0x558fb31f4510}, isNull_ = false}, <No data fields>}
        __for_end = Python Exception <class 'gdb.error'> No type named std::_Rb_tree_node<std::pair<Json::Value::CZString const, Json::Value>>.: 
{<Json::ValueIteratorBase> = {current_ = {_M_node = 0x558fb32743f8}, isNull_ = false}, <No data fields>}
        left = @0x558fb3286600: <incomplete type>
        center = @0x558fb3258d10: <incomplete type>
        right = @0x558fb3114760: <incomplete type>
        box1 = @0x558fb3206e30: <incomplete type>
        factory = 
            {_bar = @0x558fb31da700, _config = {static null = @0x7f375a95a040, static nullRef = @0x7f375a95a040, static minLargestInt = -9223372036854775808, static maxLargestInt = 9223372036854775807, static maxLargestUInt = 18446744073709551615, static minInt = -2147483648, static maxInt = 2147483647, static maxUInt = 4294967295, static minInt64 = -9223372036854775808, static maxInt64 = 9223372036854775807, static maxUInt64 = 18446744073709551615, value_ = {int_ = 94075675918272, uint_ = 94075675918272, real_ = 4.647955958051286e-310, bool_ = 192, string_ = 0x558fb33ebfc0 "0k-X7\177", map_ = 0x558fb33ebfc0}, type_ = Json::objectValue, allocated_ = 0, comments_ = 0x0, start_ = 0, limit_ = 588}}
#6  0x0000558fb173d2cf in waybar::Bar::Bar(waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> >&&) (this=0x558fb31da700, client=..., p_output=...)
    at ../src/bar.cpp:26
        positionBottom = false
        gdkWindow = 0x558fb175cf16 <std::vector<std::unique_ptr<waybar::Bar, std::default_delete<waybar::Bar> >, std::allocator<std::unique_ptr<waybar::Bar, std::default_delete<waybar::Bar> > > >::back()+76>
        outputListener = 
    {geometry = 0x558fb173d540 <waybar::Bar::_handleGeometry(void*, wl_output*, int, int, int, int, int, char const*, char const*, int)>, mode = 0x558fb173d55e <waybar::Bar::_handleMode(void*, wl_output*, unsigned int, int, int, int)>, done = 0x558fb173d598 <waybar::Bar::_handleDone(void*, wl_output*)>, scale = 0x558fb173d5a8 <waybar::Bar::_handleScale(void*, wl_output*, int)>}
        layerSurfaceListener = 
    {configure = 0x558fb173d5ba <waybar::Bar::_layerSurfaceHandleConfigure(void*, zwlr_layer_surface_v1*, unsigned int, unsigned int, unsigned int)>, closed = 0x558fb173d70e <waybar::Bar::_layerSurfaceHandleClosed(void*, zwlr_layer_surface_v1*)>}
#7  0x0000558fb175c626 in std::make_unique<waybar::Bar, waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> > >(waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> >&&) (__args#0=..., __args#1=...) at /usr/include/c++/8.2.0/bits/unique_ptr.h:831
#8  0x0000558fb175c346 in waybar::util::ptr_vec<waybar::Bar>::emplace_back<waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> > >(waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> >&&) (this=0x7ffebbe5fe38, args#0=..., args#1=...) at ../include/util/ptr_vec.hpp:174
#9  0x0000558fb175be02 in waybar::Client::_handle_global(void*, wl_registry*, unsigned int, char const*, unsigned int) (data=0x7ffebbe5fdb0, registry=0x558fb31ba2a0, name=23, interface=0x558fb31baa90 "wl_output", version=3) at ../src/client.cpp:52
        output = std::unique_ptr<wl_output *> = {get() = 0x0}
        o = 0x7ffebbe5fdb0
#10 0x00007f3757f131c8 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#11 0x00007f3757f12c2a in ffi_call () at /usr/lib/libffi.so.6
#12 0x00007f375ab6af9f in  () at /usr/lib/libwayland-client.so.0
#13 0x00007f375ab6770a in  () at /usr/lib/libwayland-client.so.0
#14 0x00007f375ab68c5c in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#15 0x00007f375ab690ac in wl_display_roundtrip_queue () at /usr/lib/libwayland-client.so.0
#16 0x0000558fb175bf34 in waybar::Client::bind_interfaces() (this=0x7ffebbe5fdb0) at ../src/client.cpp:76
        registry_listener = 
    {global = 0x558fb175bd0e <waybar::Client::_handle_global(void*, wl_registry*, unsigned int, char const*, unsigned int)>, global_remove = 0x558fb175bed0 <waybar::Client::_handle_global_remove(void*, wl_registry*, unsigned int)>}
#17 0x0000558fb175bf57 in waybar::Client::main(int, char**) (this=0x7ffebbe5fdb0, argc=1, argv=0x7ffebbe5ff58) at ../src/client.cpp:81
#18 0x0000558fb173c13f in main(int, char**) (argc=1, argv=0x7ffebbe5ff58) at ../src/main.cpp:22
        c = 
                {height = 30, cssFile = "./resources/style.css", configFile = "./resources/config", gtk_main = <incomplete type>, gdk_display = {pCppObject_ = 0x558fb3198440}, wlDisplay = 0x558fb30d2090, registry = 0x558fb31ba2a0, layer_shell = 0x558fb31ff430, idle_manager = 0x558fb31ff540, seat = 0x558fb31ff320, bars = {_order = std::vector of length 1, capacity 1 = {std::unique_ptr<waybar::Bar> = {get() = 0x558fb30f2710}}}}

Huge tray icons

Thanks for this great bar for sway, I really enjoy using it, much more than polybar...
I have problem with non electron apps showing in tray they are huge:

waybar-02

Combined electron and normal tray icon:

waybar-04

Only electron tray icon:

waybar-03

And full photo, using your latest commit: 07d8dfb with added tray space...

waybar-01

If you can do something with it, it would be great. I've used nitrokey-app and lxqt-powermanagement for normal tray icons.

And if you plan a mpd integration, not sure how much people use it, polybar was having it. Currently I've hacked it up to behave as it looked in polybar...

Use ZWLR_LAYER_SHELL_LAYER_BOTTOM

If you put this in the top layer, it will render on top of floating windows, dmenu, etc. swaybar goes in the bottom layer instead.

Disable hover/prelight effect on workspace buttons by default

There's some default GTK CSS for the hover effect which I personally find unappealing, and I think many would concur. I've mitigated it by adding this rule:

#workspaces button:hover {
  box-shadow: inherit;
  text-shadow: inherit;
}

Maybe this could be done out of the box? Alternatively, prelight could be disabled altogether, but I think some may want to have hover effects.

Spotify Script Example

Hi,

I was wondering if you could add your script for Spotify somewhere on the project? Whether it be on wiki or included in the files with config/css, that is up to your discretion. I just wanted a sample to look at how custom modules worked in Waybar. Thanks!

Issue with long window titles

I have my center module set to sway/window but when the title reaches a certain length, it shifts my right modules further right and off the screen. Can this be fixed with CSS or is this just a bug?

Thanks!

Cannot Build Due to Linking Error with `libfmt`

Hi there. Just built Waybar for the first time. After the build is finished and installed, waybar refuses to start with this very specific and therefore un-Googleable error:

waybar: symbol lookup error: waybar: undefined symbol: _ZN3fmt2v58internal10basic_dataIvE23ZERO_OR_POWERS_OF_10_32E

I presume that this is because of a linking issue with libfmt; any idea as to what is wrong here?

Module battery doesn't update

Hi,

All of my modules are working except the module battery ( He's just update once ).

Here is my config

{
	"layer": "top",
	"height": 36,
	"modules-left": [
		"sway/workspaces"
	],
	"modules-center": [
		"sway/window"
	],
	"modules-right": [
		"network",
		"pulseaudio",
		"battery",
		"clock"
	],
	"sway/workspaces": {
		// todo
	},
	"sway-window": {
		"max-length": 80
	},
	"network": {
		"format-wifi": "{essid} ({ifname}) ",
		"format-ethernet": "{essid} (ifname) ",
		"format-disconnected": "睊"
	},
	"pulseaudio": {
		"format": "{volume}% ",
		"format-muted": "婢"
	},
	"battery": {
		"format": "{capacity}% {icon}",
		"format-icons": ["", "", "", "", ""]
	},
	"clock": {
 		"format-alt": "{:%d/%m/%Y}"
	}
}

Crash when started under Wayfire

os: Arch Linux
version: r118.0dba3abc-2 (Arch package version - can't get version with --version flag either under X, or Wayfire)
output:

 ~ >>> waybar
terminate called after throwing an instance of 'std::system_error'
  what():  Invalid argument
Exception: waybar killed by signal aborted (core dumped)
[tty], line 1: waybar
 ~ >>> 

It works fine on the same system when started under sway.

Abnormal CPU usage of the CPU module

For some reason, even with a 30 second interval, the CPU module makes Waybar consume a lot of cycles (~75% of a core). As soon as I disable it and restart Waybar, it remains idle. I also have the RAM module enabled, but no problems there. Persists between reboots.

Electron-based apps' tray icons aren't showing up

Tested Slack, Caprine, Discord and Keybase, no tray icon. Tried with XDG_CURRENT_DESKTOP=Unity, as suggested in several places, to force AppIndicators, but that doesn't help.

Just in case, my setup is right, I can see Telegram's tray.

add {index} in workspace modules

As far as I've seen, I can show in my workspace area the name of the workspace and icon.
Would it be possible to add {index}?

Usage with i3/sway ?

Configuring Sway or presumably i3 using the following seems to execute the bar correctly, but causes the default task switcher bar to be drawn regardless. Your documentation doesn't explain how to mitigate this

bar {
   status_command waybar
}

Segmentation Fault with enabled pulseaudio module

When I run waybar with enabled pulseaudio module, I get instant segfault.
I rebuilt waybar with debug symbols, ran it with gdb and got this traceback:

#0  0x000055555559f1a2 in waybar::modules::Pulseaudio::sinkInfoCb (i=0x7fffe27fb680, data=0x5555556f2290) at ../waybar-9999/src/modules/pulseaudio.cpp:92
#1  0x00007ffff6d42efb in ?? () from /usr/lib64/libpulse.so.0
#2  0x00007ffff4ad8c11 in ?? () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#3  0x00007ffff4ad8f63 in pa_pdispatch_run () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#4  0x00007ffff6d3847e in ?? () from /usr/lib64/libpulse.so.0
#5  0x00007ffff4adb9cf in ?? () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#6  0x00007ffff4ade44b in ?? () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#7  0x00007ffff4ade7e9 in ?? () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#8  0x00007ffff4adf04f in ?? () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#9  0x00007ffff6d4c360 in pa_mainloop_dispatch () from /usr/lib64/libpulse.so.0
#10 0x00007ffff6d4c72e in pa_mainloop_iterate () from /usr/lib64/libpulse.so.0
#11 0x00007ffff6d4c7b0 in pa_mainloop_run () from /usr/lib64/libpulse.so.0
#12 0x00007ffff6d5a096 in ?? () from /usr/lib64/libpulse.so.0
#13 0x00007ffff4aee7a8 in ?? () from /usr/lib64/pulseaudio/libpulsecommon-12.2.so
#14 0x00007ffff655396a in start_thread () from /lib64/libpthread.so.0
#15 0x00007ffff6287d3f in clone () from /lib64/libc.so.6

Support for multiple batterys

some devices have more than one battery, eg. some lenovo devices.
so it would be pretty cool to have support for displaying more than one battery.

Handle continuous scripts

hey,
the rendering and of the bar stops when a custom module doesn't exit after output (eg continuous output).

feature request - click, scroll events

this seems like something that would be incredibly useful, especially if configured. launch pavucontrol when clicking the pulseaudio module for example would be quite helpful to me personally.

I would be more than happy to assist with development / reworking if you could give me a bit of guidance as to where you would like this implemented.

Update README

Need:

  • Introduction
  • Examples
  • Getting started
  • Dependencies
  • Configuration

Waybar not showing up

I currently tried to run waybar under sway, and nothing showed up. It don't work neither from the terminal nor the swaybar_command waybar Any thoughts on why it's not working?

Arch Linux up-to-date kernel 4.18.6
sway 0.15.2-4-g6add71f6
waybar r128.28c65c64

SIGSEGV when interfacing with xdg

What:

When trying to run waybar it halts to a segmentation fault, this is gdb's output:

(gdb) bt full
#0  0x00007ffff7d52ee4 in wl_proxy_marshal_constructor () at /usr/lib/libwayland-client.so.0
#1  0x000055555559166d in zxdg_output_manager_v1_get_xdg_output(zxdg_output_manager_v1*, wl_output*) (zxdg_output_manager_v1=0x8, output=0x555555726d80) at waybar@exe/xdg-output-unstable-v1-client-protocol.h:175
        id = 0x555555601e68
#2  0x00005555555917d2 in waybar::Bar::Bar(waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> >&&) (this=0x555555601e00, client=..., p_output=...) at ../src/bar.cpp:18
        positionBottom = false
        layerTop = false
        layerSurfaceListener = {configure = 0x555555591c54 <waybar::Bar::_layerSurfaceHandleConfigure(void*, zwlr_layer_surface_v1*, unsigned int, unsigned int, unsigned int)>, closed = 0x555555591e0a <waybar::Bar::_layerSurfaceHandleClosed(void*, zwlr_layer_surface_v1*)>}
        gdkWindow = 0x7fffffffdc50
        xdgOutputListener = 
    {logical_position = 0x555555591bce <waybar::Bar::_handleLogicalPosition(void*, zxdg_output_v1*, int, int)>, logical_size = 0x555555591be4 <waybar::Bar::_handleLogicalSize(void*, zxdg_output_v1*, int, int)>, done = 0x555555591bfa <waybar::Bar::_handleDone(void*, zxdg_output_v1*)>, name = 0x555555591c0a <waybar::Bar::_handleName(void*, zxdg_output_v1*, char const*)>, description = 0x555555591c40 <waybar::Bar::_handleDescription(void*, zxdg_output_v1*, char const*)>}
#3  0x000055555558eca2 in std::make_unique<waybar::Bar, waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> > >(waybar::Client&, std::unique_ptr<wl_output*, std::default_delete<wl_output*> >&&) (__args#0=..., __args#1=...)
    at /usr/include/c++/8.2.0/bits/unique_ptr.h:831
#4  0x000055555558e686 in waybar::Client::_handle_global(void*, wl_registry*, unsigned int, char const*, unsigned int) (data=0x7fffffffe100, registry=0x5555556e1fe0, name=12, interface=0x5555556e22b0 "wl_output", version=2) at ../src/client.cpp:52
        output = std::unique_ptr<wl_output *> = {get() = 0x0}
        o = 0x7fffffffe100
#5  0x00007ffff50fe1c8 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#6  0x00007ffff50fdc2a in ffi_call () at /usr/lib/libffi.so.6
#7  0x00007ffff7d55f9f in  () at /usr/lib/libwayland-client.so.0
#8  0x00007ffff7d5270a in  () at /usr/lib/libwayland-client.so.0
#9  0x00007ffff7d53c5c in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#10 0x00007ffff7d540ac in wl_display_roundtrip_queue () at /usr/lib/libwayland-client.so.0
#11 0x000055555558e7e8 in waybar::Client::bind_interfaces() (this=0x7fffffffe100) at ../src/client.cpp:78
        registry_listener = {global = 0x55555558e58a <waybar::Client::_handle_global(void*, wl_registry*, unsigned int, char const*, unsigned int)>, global_remove = 0x55555558e784 <waybar::Client::_handle_global_remove(void*, wl_registry*, unsigned int)>}
#12 0x000055555558e80b in waybar::Client::main(int, char**) (this=0x7fffffffe100, argc=1, argv=0x7fffffffe298) at ../src/client.cpp:83
#13 0x0000555555594647 in main(int, char**) (argc=1, argv=0x7fffffffe298) at ../src/main.cpp:20
        c = 
          {cssFile = "/home/bernardo/.config/waybar/style.css", configFile = "/home/bernardo/.config/waybar/config", gtk_main = <incomplete type>, gdk_display = {pCppObject_ = 0x5555556bea10}, wlDisplay = 0x5555555fa160, registry = 0x5555556e1fe0, layer_shell = 0x555555594831 <_GLOBAL__sub_I_main()+19>, xdg_output_manager = 0x8, seat = 0x555555726e90, bars = std::vector of length 0, capacity 0}

Why:

I got no idea and would love to try to solve this on my own if I knew at least how to do half of this wayland and xdg wisardry.

How:

I installed wlroots-git package on AUR and then compiled as told:

meson build
ninja -C build

meson output:

The Meson build system
Version: 0.47.1
Source dir: /home/bernardo/workspace/Waybar
Build dir: /home/bernardo/workspace/Waybar/build
Build type: native build
Project name: waybar
Project version: 0.0.2
Native C compiler: cc (gcc 8.2.0 "cc (GCC) 8.2.0")
Native C++ compiler: c++ (gcc 8.2.0 "c++ (GCC) 8.2.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Dependency threads found: YES
Found pkg-config: /usr/bin/pkg-config (1.5.3)
Native dependency libinput found: YES 1.11.3
Looking for a fallback subproject for the dependency fmt
Using fmtlib from cache.
Using fmt-4.1.0-1-wrap.zip from cache.

|
|Executing subproject fmtlib 
|
|Project name: fmt
|Project version: 4.1.0
|Native C++ compiler: c++ (gcc 8.2.0 "c++ (GCC) 8.2.0")
|Build targets in project: 1
|
|Subproject fmtlib finished.
Dependency fmt from subproject subprojects/fmtlib found: YES
Native dependency wayland-client found: YES 1.15.0
Native dependency wayland-cursor found: YES 1.15.0
Native dependency wayland-protocols found: YES 1.15
Native dependency wlroots found: YES 0.0.1
Native dependency gtkmm-3.0 found: YES 3.22.2
Native dependency jsoncpp found: YES 1.8.4
Native dependency sigc++-2.0 found: YES 2.10.0
Native dependency libnl-3.0 found: YES 3.4.0
Native dependency libnl-genl-3.0 found: YES 3.4.0
Native dependency libpulse found: YES 12.2
Program wayland-scanner found: YES (/usr/bin/wayland-scanner)
Build targets in project: 3
Found ninja-1.8.2 at /usr/bin/ninja

SIGFPE on startup

Just built from source using the default config and gave it a run:

(gdb) bt full
#0  0x00005566cf88b4ff in waybar::modules::Battery::update() (this=0x5566cfeba460) at ../src/modules/battery.cpp:46
        total = 0
        charging = false
        format = "{}% "
#1  0x00005566cf88aa91 in waybar::modules::Battery::<lambda()>::operator()(void) const (__closure=0x5566cfedf7a0) at ../src/modules/battery.cpp:20
        this = 0x5566cfeba460
#2  0x00005566cf88b974 in std::_Function_handler<void(), waybar::modules::Battery::Battery(Json::Value)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/8.2.0/bits/std_function.h:297
#3  0x00005566cf88d88e in std::function<void ()>::operator()() const (this=0x5566cfedf7a0) at /usr/include/c++/8.2.0/bits/std_function.h:687
#4  0x00005566cf88c7eb in waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}::operator()() const (__closure=0x5566cfedf798) at ../include/util/chrono.hpp:48
        func = 
          {<std::_Maybe_unary_or_binary_function<void>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x5566cfeba460, _M_const_object = 0x5566cfeba460, _M_function_pointer = 0x5566cfeba460, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x5566cfeba460, this adjustment 140723131598032}, _M_pod_data = "`\244\353\317fU\000\000\320DE\250\374\177\000"}, _M_manager = 0x5566cf88b977 <std::_Function_base::_Base_manager<waybar::modules::Battery::Battery(Json::Value)::<lambda()> >::_M_manager(std::_Any_data &, const std::_Any_data &, std::_Manager_operation)>}, _M_invoker = 0x5566cf88b954 <std::_Function_handler<void(), waybar::modules::Battery::Battery(Json::Value)::<lambda()> >::_M_invoke(const std::_Any_data &)>}
        this = 0x5566cfeba480
#5  0x00005566cf88eb01 in std::__invoke_impl<void, waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}>(std::__invoke_other, waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}&&) (__f=...) at /usr/include/c++/8.2.0/bits/invoke.h:60
#6  0x00005566cf88d94b in std::__invoke<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}>(std::__invoke_result&&, (waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/8.2.0/bits/invoke.h:95
#7  0x00005566cf8911b2 in std::thread::_Invoker<std::tuple<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x5566cfedf798) at /usr/include/c++/8.2.0/thread:234
#8  0x00005566cf891188 in std::thread::_Invoker<std::tuple<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}> >::operator()() (this=0x5566cfedf798)
    at /usr/include/c++/8.2.0/thread:243
#9  0x00005566cf89116c in std::thread::_State_impl<std::thread::_Invoker<std::tuple<waybar::util::SleeperThread::operator=(std::function<void ()>)::{lambda()#1}> > >::_M_run() (this=0x5566cfedf790) at /usr/include/c++/8.2.0/thread:186
#10 0x00007f08aa739043 in execute_native_thread_routine (__p=0x5566cfedf790) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
        __t = std::unique_ptr<std::thread::_State> = {get() = 0x5566cfedf790}
#11 0x00007f08aa4c4a8d in start_thread () at /usr/lib/libpthread.so.0
#12 0x00007f08aa3f4823 in clone () at /usr/lib/libc.so.6

Note, I don't have a battery.

Feature request: keyboard layout

Would be really nice to have the module showing current keyboard layout. Or maybe a help to write the custom module script with this capability.

Configuration of bar width

HI,

I am using sway 1.0. My monitor's default resolution is 2560x1440. I force the TTY resolution to 1920x1080 by using kernel parameter like "video=HDMI-A-1:1920x1080" as recommended in sway Archwiki . Thus I am able to set the new resolution in sway's config. Command `swaymsg -t outputs' shows the current mode is 1920x1080 and there are 2 modes available.

When I run the waybar, I ended up with width of 2560. Not the width of my current resolution that I set. Thus some part of the bar is not visible.

Waybar output is like:
Bar width configured: 1920
Bar width configured: 2560
New height: 30
New height: 30

Can I get around this?

Thanks.

Waybar intersects Sway workspace by a few pixels.

There seems to be a slight overlap between waybar and the sway workspace. I think it's most apparent in the spacing from the top of the screen with the b in genbyte as seen in the screenshots below. I don't know if this is an issue with my configuration, with sway, or with waybar. Here are my config files for sway and waybar at the time of the screenshot.
2018-10-24-132937
2018-10-24-135301

add {index} in workspace modules

As far as I've seen, I can show in my workspace area the name of the workspace and icon.
Would it be possible to add {index}?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.