My personal blazingly fast and efficient status bar + widgets, in case anyone finds a use for it.
gBar: GTK Bar
If you don't have the optional dependencies, some features are not available.
Clone gBar
git clone https://github.com/scorpion-26/gBar
Configure with meson
All optional dependencies enabled
meson setup build
Build and install
ninja -C build && sudo ninja -C build install
For Arch systems, gBar can be found on the AUR.
You can install it e.g.: with yay
yay -S gbar-git
If you choose the Nix/NixOS installation there are a couple of ways to do it but they all require you to have flakes enabled.
gBar.defaultPackage.x86_64-linux
to either environment.systemPackages or home.packages.gBar.homeManagerModules.x86_64-linux.default
into your home-manager imorts section. This exposes the option programs.gBar to home-manager, use it like below.# Inputs section
inputs.gBar.url = "github:scorpion-26/gBar";
...
# Inside home config
home-manager.users.user = {
...
imports = [ inputs.gBar.homeManagerModules.x86_64-linux.default ];
...
programs.gBar = {
enable = true;
config = {
Location = "L";
EnableSNI = true;
SNIIconSize = {
Discord = 26;
OBS = 23;
};
WorkspaceSymbols = [ " " " " ];
};
};
};
Open bar on monitor "DP-1"
gBar bar DP-1
Open bar on monitor 0 (Legacy way of specifying the monitor)
gBar bar 0
Open audio flyin (either on current monitor or on the specified monitor)
gBar audio [monitor]
Open microphone flyin, this is equivalent to the audio flyin
gBar mic [monitor]
Open bluetooth widget
gBar bluetooth [monitor]
Bar with default css
Audio widget with default css
Bluetooth widget with default css
Bar:
UseHyprlandIPC
is false, though workspace control relies on Hyprland)Bluetooth:
Audio Flyin:
Copy the example config (found under data/config) into ~/.config/gBar/config and modify it to your needs.
gBar utilizes a plugin system for custom widgets anyone can create without modifying the source code.
Plugins are native shared-libraries, which need to be placed inside ~/.local/lib/gBar
, /usr/lib/gBar
or /usr/local/lib/gBar
.
Inside example/ there is an example plugin setup. To build and run it, run the following commands inside the example directory:
meson setup build -Dprefix=~/.local
for the local user OR
meson setup build
for all users
ninja -C build install
gBar gBarHelloWorld
The second argument is the name of the shared library (without 'lib' and '.so').
For more examples on how to use the gBar API, you can have a look at the built-in widgets (AudioFlyin.cpp, BluetoothDevices.cpp, Bar.cpp) as they use the same API.
And lastly: Implementing it myself is fun and a great excuse to learn something new!
This project is meant to be for my personal use, though I want it to be easily used by others without bugs or a complicated setup. This means the following:
The colors are from the Dracula theme: https://draculatheme.com
First, find where the data is located for gBar. Possible locations:
echo $XDG_DATA_DIRS
Copy the scss and css files from within the data direction into ~/.config/gBar. e.g.:
mkdir ~/.config/gBar/
cp /usr/local/share/gBar/* ~/.config/gBar/
This will override the default behaviour. If you have sass installed, you can modify the scss file and then regenerate the css file accordingly. Else modify the css file directly.
If you have a custom style.[s]css, make sure that the margins/names/... are the same as the ones found in style/style.[s]css
.
If you've checked the css against upstream gBar and the issue persists, please open an issue.
Major (breaking) changes to the css:
.lock-button
section into your css.Delete /tmp/gBar__audio
//tmp/gBar__bluetooth
.
This happens, when you kill the widget before it closes properly (Automatically after a few seconds for the audio widget, or the close button for the bluetooth widget). Ctrl-C in the terminal (SIGINT) is fine though.
See Configuration for your system
Please install a Nerd Font from https://www.nerdfonts.com (I use Caskaydia Cove NF), and change style.css/style.scss accordingly (Refer to 'I want to customize the colors' for that). You will need a Nerd Font with version 2.3.0 or newer (For more details see this comment)
Some apps sometimes don't actively query for tray applications. A fix for this is to start gBar before the tray app If it still doesn't show, please open an issue with your application. The tray icons are confirmed to work with Discord, Telegram, OBS, Steam and KeePassXC
This is semi-intentional and a known bug (See #12 (comment) for an explanation). You can make it opaque by setting the background-color property of .popup in style.css/style.scss
As of bc0281c this is now fixed! For things to look properly you may want to update your css (Specifically the selectors .popup
and menu
)