2024-02-20 21:16:07 +01:00
|
|
|
---
|
|
|
|
weight: 2
|
|
|
|
title: Status bars
|
|
|
|
---
|
2023-04-18 01:41:26 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Waybar
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2023-09-05 13:39:20 +02:00
|
|
|
Waybar is a GTK status bar made specifically for wlroots compositors and
|
|
|
|
supports Hyprland by default. To use it, it's recommended to use your distro's
|
|
|
|
package.
|
2022-10-23 16:35:39 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
To start configuring, copy the configuration files from
|
|
|
|
`/etc/xdg/waybar/` into `~/.config/waybar/`. Then, in `~/.config/waybar/config`
|
|
|
|
|
|
|
|
To use the workspaces module, replace all the occurrences of `sway/workspaces`
|
2024-10-01 15:43:01 +02:00
|
|
|
with `hyprland/workspaces`. Addionally replace all occurences of `sway/mode` with `hyprland/submap`
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2022-08-13 01:47:48 +02:00
|
|
|
For more info regarding configuration, see
|
2023-09-05 13:39:20 +02:00
|
|
|
[The Waybar Wiki](https://github.com/Alexays/Waybar/wiki/Module:-Hyprland).
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### How to launch
|
2023-04-30 02:09:45 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
Type `waybar` into your terminal. In order to have Waybar launch alongside
|
|
|
|
Hyprland, add this line to your Hyprland configuration:
|
|
|
|
|
|
|
|
```ini
|
|
|
|
exec-once = waybar
|
|
|
|
```
|
|
|
|
|
|
|
|
### Waybar FAQ
|
2023-04-30 02:09:45 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
#### Waybar popups render behind the windows
|
2022-10-23 16:36:09 +02:00
|
|
|
|
|
|
|
In `~/.config/waybar/config`, make sure that you have the `layer` configuration
|
|
|
|
set to `top` and not `bottom`.
|
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
#### Active workspace doesn't show up
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Replace `#workspaces button.focused` with `#workspaces button.active` in
|
|
|
|
`~/.config/waybar/style.css`.
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
#### Scrolling through workspaces
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-04-21 16:35:48 +02:00
|
|
|
Since a lot of configuration options from `sway/workspaces` are missing,
|
2024-02-20 21:16:07 +01:00
|
|
|
you should deduce some of them by yourself. In the case of scrolling, it should
|
|
|
|
look like this:
|
2022-10-23 16:36:09 +02:00
|
|
|
|
|
|
|
```json
|
2023-09-05 13:39:20 +02:00
|
|
|
"hyprland/workspaces": {
|
2022-10-23 16:36:09 +02:00
|
|
|
"format": "{icon}",
|
|
|
|
"on-scroll-up": "hyprctl dispatch workspace e+1",
|
|
|
|
"on-scroll-down": "hyprctl dispatch workspace e-1"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### Window title is missing
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-08-04 11:49:21 +02:00
|
|
|
The prefix for the window module that provides the title is `hyprland` not `wlr`.
|
|
|
|
In your Waybar config, insert this module:
|
2023-05-23 14:08:20 +02:00
|
|
|
|
|
|
|
```json
|
|
|
|
"modules-center": ["hyprland/window"],
|
|
|
|
```
|
2024-02-20 21:16:07 +01:00
|
|
|
|
2024-08-04 11:49:21 +02:00
|
|
|
If you are using multiple monitors, you may want to insert the following option:
|
2024-02-20 21:16:07 +01:00
|
|
|
|
2023-05-23 14:08:20 +02:00
|
|
|
```json
|
|
|
|
"hyprland/window": {
|
|
|
|
"separate-outputs": true
|
|
|
|
},
|
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Eww
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
[Eww](https://github.com/elkowar/eww) (ElKowar's Wacky Widgets) is a widget
|
|
|
|
system made in Rust + GTK, which lets allows the creation of custom widgets
|
|
|
|
similarly to AwesomeWM. The key difference is that it is independent of window
|
|
|
|
manager/compositor.
|
2024-06-25 21:17:51 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
Install Eww either using your distro's package manager, by searching
|
|
|
|
`eww-wayland`, or by manually compiling. In the latter case, you can follow the
|
2022-08-13 18:25:43 +02:00
|
|
|
[instructions](https://elkowar.github.io/eww).
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### Configuration
|
2022-08-12 20:46:36 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
There are a few examples listed in the [Readme](https://github.com/elkowar/eww).
|
|
|
|
It's also highly recommended to read through the
|
2022-08-12 20:46:36 +02:00
|
|
|
[Configuration options](https://elkowar.github.io/eww/configuration.html).
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
{{< callout >}}
|
|
|
|
|
2022-08-13 18:25:43 +02:00
|
|
|
Read
|
|
|
|
[the Wayland section](https://elkowar.github.io/eww/configuration.html#wayland)
|
2024-07-31 00:00:24 +02:00
|
|
|
carefully, otherwise Eww won't work on Hyprland.
|
2024-02-20 21:16:07 +01:00
|
|
|
|
|
|
|
{{< /callout >}}
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2022-12-17 23:43:14 +01:00
|
|
|
Here are some example widgets that might be useful for Hyprland:
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary>Workspaces widget</summary>
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
This widget displays a list of workspaces 1-10. Each workspace can be clicked on
|
|
|
|
to jump to it, and scrolling over the widget cycles through them. It supports
|
|
|
|
different styles for the current workspace, occupied workspaces, and empty
|
|
|
|
workspaces. It requires [bash](https://linux.die.net/man/1/bash),
|
|
|
|
[awk](https://linux.die.net/man/1/awk),
|
|
|
|
[stdbuf](https://linux.die.net/man/1/stdbuf),
|
|
|
|
[grep](https://linux.die.net/man/1/grep),
|
|
|
|
[seq](https://linux.die.net/man/1/seq),
|
|
|
|
[socat](https://linux.die.net/man/1/socat),
|
|
|
|
[jq](https://stedolan.github.io/jq/), and [Python 3](https://www.python.org/).
|
2022-12-17 23:43:14 +01:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### `~/.config/eww.yuck`
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
```lisp
|
|
|
|
...
|
|
|
|
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
|
|
|
(deflisten current_workspace :initial "1" "bash ~/.config/eww/scripts/get-active-workspace")
|
|
|
|
(defwidget workspaces []
|
|
|
|
(eventbox :onscroll "bash ~/.config/eww/scripts/change-active-workspace {} ${current_workspace}" :class "workspaces-widget"
|
|
|
|
(box :space-evenly true
|
2023-03-04 15:49:21 +01:00
|
|
|
(label :text "${workspaces}${current_workspace}" :visible false)
|
2022-12-17 23:43:14 +01:00
|
|
|
(for workspace in workspaces
|
|
|
|
(eventbox :onclick "hyprctl dispatch workspace ${workspace.id}"
|
2024-09-14 13:22:59 +02:00
|
|
|
(box :class "workspace-entry ${workspace.windows > 0 ? "occupied" : "empty"}"
|
|
|
|
(label :text "${workspace.id}" :class "workspace-entry ${workspace.id == current_workspace ? "current" : ""}" )
|
2022-12-17 23:43:14 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### `~/.config/eww/scripts/change-active-workspace`
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
```sh
|
2024-03-08 00:38:37 +01:00
|
|
|
#!/usr/bin/env bash
|
2022-12-17 23:43:14 +01:00
|
|
|
function clamp {
|
|
|
|
min=$1
|
|
|
|
max=$2
|
|
|
|
val=$3
|
|
|
|
python -c "print(max($min, min($val, $max)))"
|
|
|
|
}
|
|
|
|
|
|
|
|
direction=$1
|
|
|
|
current=$2
|
|
|
|
if test "$direction" = "down"
|
|
|
|
then
|
|
|
|
target=$(clamp 1 10 $(($current+1)))
|
|
|
|
echo "jumping to $target"
|
|
|
|
hyprctl dispatch workspace $target
|
|
|
|
elif test "$direction" = "up"
|
|
|
|
then
|
|
|
|
target=$(clamp 1 10 $(($current-1)))
|
|
|
|
echo "jumping to $target"
|
|
|
|
hyprctl dispatch workspace $target
|
|
|
|
fi
|
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### `~/.config/eww/scripts/get-active-workspace`
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
```sh
|
2023-05-18 17:31:58 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
|
|
|
|
|
2024-04-28 23:25:40 +02:00
|
|
|
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
|
2023-05-18 17:31:58 +02:00
|
|
|
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
|
2022-12-17 23:43:14 +01:00
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### `~/.config/eww/scripts/get-workspaces`
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
```sh
|
2024-03-08 00:38:37 +01:00
|
|
|
#!/usr/bin/env bash
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
spaces (){
|
|
|
|
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
|
|
|
|
seq 1 10 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
|
|
|
|
}
|
|
|
|
|
|
|
|
spaces
|
2024-04-28 23:25:40 +02:00
|
|
|
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
2022-12-17 23:43:14 +01:00
|
|
|
spaces
|
|
|
|
done
|
|
|
|
```
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary>Active window title widget</summary>
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
This widget simply displays the title of the active window. It requires
|
|
|
|
[awk](https://linux.die.net/man/1/awk),
|
|
|
|
[stdbuf](https://linux.die.net/man/1/stdbuf),
|
|
|
|
[socat](https://linux.die.net/man/1/socat), and
|
|
|
|
[jq](https://stedolan.github.io/jq/).
|
2022-12-17 23:43:14 +01:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### `~/.config/eww/eww.yuck`
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
```lisp
|
|
|
|
...
|
2023-04-23 22:20:55 +02:00
|
|
|
(deflisten window :initial "..." "sh ~/.config/eww/scripts/get-window-title")
|
2022-12-17 23:43:14 +01:00
|
|
|
(defwidget window_w []
|
|
|
|
(box
|
|
|
|
(label :text "${window}"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### `~/.config/eww/scripts/get-window-title`
|
2022-12-17 23:43:14 +01:00
|
|
|
|
|
|
|
```sh
|
2023-04-23 22:20:55 +02:00
|
|
|
#!/bin/sh
|
2022-12-17 23:43:14 +01:00
|
|
|
hyprctl activewindow -j | jq --raw-output .title
|
2024-04-28 23:25:40 +02:00
|
|
|
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}'
|
2022-12-17 23:43:14 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
## Hybrid
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
Like Waybar, [Hybrid](https://github.com/vars1ty/HybridBar) is a GTK status bar
|
2024-04-21 16:35:48 +02:00
|
|
|
mainly focused on wlroots compositors.
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
It can be installed using the `hybrid-bar` package from the AUR.
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### Configuration
|
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
The configuration is done through JSON. More information is available
|
2024-02-20 21:16:07 +01:00
|
|
|
[here](https://github.com/vars1ty/HybridBar).
|
2022-10-23 16:36:09 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
### How to launch
|
2022-11-26 14:36:21 +01:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
After configuring HybridBar, it can be launched by typing `hybrid-bar` into a
|
|
|
|
terminal. It is also possible to set it to launch at startup. To do this, add
|
|
|
|
this line to `hyprland.conf`:
|
|
|
|
|
|
|
|
```ini
|
|
|
|
exec-once = hybrid-bar
|
|
|
|
```
|
2023-04-30 02:09:45 +02:00
|
|
|
|
2024-02-20 21:16:07 +01:00
|
|
|
#### Blur
|
2023-04-30 02:09:45 +02:00
|
|
|
|
2024-07-31 00:00:24 +02:00
|
|
|
To activate blur, set `blurls = NAMESPACE` in your Hyprland configuration, where
|
2024-02-20 21:16:07 +01:00
|
|
|
`NAMESPACE` is the gtk-layer-shell namespace of your HybridBar. The default
|
|
|
|
namespace is `gtk-layer-shell` and can be changed in the HybridBar configuration
|
|
|
|
at
|
2022-11-26 14:36:21 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"hybrid" {
|
|
|
|
"namespace": "namespace name"
|
|
|
|
}
|
|
|
|
}
|
2023-03-04 15:49:21 +01:00
|
|
|
```
|