You are not logged in.

#1 2024-04-02 17:19:09

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,646

waybar, swaybar, polybar

I have been 'practicing' for Conky smile  ,the weather in

polybar (dk)

458241678_polybar.png

swaybar (sway)

458241947_swaybar.png

waybar (labwc)

458242140_waybar.png

Offline

#2 2024-04-02 17:47:18

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 1,271
Website

Re: waybar, swaybar, polybar

1rst i think needs a better font alignment.

2nd, 3rd are better centered.

Overall nice setup unklar. Perhaps you know or not, but have a look on nerd-fonts.
Something may adjust better font.


Tumbleweed (Server) | KDE Plasma (Wayland)

Offline

#3 2024-04-03 09:11:35

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,646

Re: waybar, swaybar, polybar

Nili wrote:

1rst i think needs a better font alignment.

2nd, 3rd are better centered.

Overall nice setup unklar. Perhaps you know or not, but have a look on nerd-fonts.
Something may adjust better font.

@Nili, thank you very much for your advice and constructive criticism.  smile

For me, polybar is probably the most unruly bar of the three.
It did not accept fonts-symbola. Only when I found these hints and tested a Conky with this font did the system finally display it in the bar.

Last edited by unklar (2024-04-03 09:13:35)

Offline

#4 2024-04-03 13:09:21

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: waybar, swaybar, polybar

NICE stuff there unklar.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#5 2024-04-04 06:42:26

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 1,271
Website

Re: waybar, swaybar, polybar

unklar wrote:

@Nili, thank you very much for your advice and constructive criticism.  smile

For me, polybar is probably the most unruly bar of the three.
It did not accept fonts-symbola. Only when I found these hints and tested a Conky with this font did the system finally display it in the bar.

Anytime, from my experience with bars each one has his quirks.
Been long enough around to have used from pypanel, bmpanel, dzen2, conky-cli,tint2 to polybar, lemonbar etc...

A decade ago it was a little more difficult with bars due to the lack possibilities the code offered, or sufficient information.
Currently i see it as a better time, out there are more colors, more variants and more diversity.

Whatever you're achieving, i hope you find yourself and feel good.


Tumbleweed (Server) | KDE Plasma (Wayland)

Offline

#6 2024-04-04 12:51:53

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,646

Re: waybar, swaybar, polybar

Sector11 wrote:

NICE stuff there unklar.

Thank you, my friend.

I have now made further attempts. I have installed the nerd-fonts as suggested by @Nili. It just seems to me that I didn't get the right package, because the glyphs are missing.

Anyway, that was openweathermap
458751334_2024-04-03-openweather.png
with the known error that they are wrong for my location.

wttr.in, from chubin, needs json for the format, as you know. Output is just 'symbola' above, or just a suitable different font. My (your) favorite font 'monofur', without glyphs and I will stick with that.
458752021_2024-04-03-185510_315x40_scrot.png


Here are the essentials of my configuration (if I've forgotten something, go ahead, I'll supply it wink )
Part of the config.ini of polybar

...
font-0 = "monospace:size=9"
font-1 = "monofur:size=12"
font-2 = "Weather Icons:style=Regular:size=12"
;font-3 = "Noto Color Emoji:style=Regular:size=12"
font-4 = "Symbola:style=Regular:size=12"

modules-left = xworkspaces xwindow
modules-center = weather openweathermap-full
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

[module/weather]
type = custom/script
interval = 600
;return-type = json -->format2
exec = curl -s https://wttr.in/Lichtenstein_sachsen?format=+%C+%t+%w+%P+%h
exec-if = ping wttr.in -c1
label-font = 3 

;[module/weather]
;type = custom/script
;exec = ~/.config/polybar/polybar-forecast/config.toml
;exec-if = ping openweathermap.org -c 1
;interval = 600
;label-font = 3

;[module/openweathermap-full]
;type = custom/script
;exec = ~/.config/polybar/polybar-scripts/openweathermap-full.sh
;exec-if = ping openweathermap.org -c 1
;interval = 600
;label-font = 3

...

Edit: @Nili, thanks!

Last edited by unklar (2024-04-04 13:05:04)

Offline

#7 2024-04-04 13:54:22

altman
Member
From: Canada
Registered: 2015-10-24
Posts: 619

Re: waybar, swaybar, polybar

unklar wrote:
Sector11 wrote:

NICE stuff there unklar.

Thank you, my friend.

I have now made further attempts. I have installed the nerd-fonts as suggested by @Nili. It just seems to me that I didn't get the right package, because the glyphs are missing.

Anyway, that was openweathermap
https://t94.pixhost.to/thumbs/902/458751334_2024-04-03-openweather.png
with the known error that they are wrong for my location.

wttr.in, from chubin, needs json for the format, as you know. Output is just 'symbola' above, or just a suitable different font. My (your) favorite font 'monofur', without glyphs and I will stick with that.
https://t94.pixhost.to/thumbs/902/458752021_2024-04-03-185510_315x40_scrot.png


Here are the essentials of my configuration (if I've forgotten something, go ahead, I'll supply it wink )
Part of the config.ini of polybar

...
font-0 = "monospace:size=9"
font-1 = "monofur:size=12"
font-2 = "Weather Icons:style=Regular:size=12"
;font-3 = "Noto Color Emoji:style=Regular:size=12"
font-4 = "Symbola:style=Regular:size=12"

modules-left = xworkspaces xwindow
modules-center = weather openweathermap-full
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

[module/weather]
type = custom/script
interval = 600
;return-type = json -->format2
exec = curl -s https://wttr.in/Lichtenstein_sachsen?format=+%C+%t+%w+%P+%h
exec-if = ping wttr.in -c1
label-font = 3 

;[module/weather]
;type = custom/script
;exec = ~/.config/polybar/polybar-forecast/config.toml
;exec-if = ping openweathermap.org -c 1
;interval = 600
;label-font = 3

;[module/openweathermap-full]
;type = custom/script
;exec = ~/.config/polybar/polybar-scripts/openweathermap-full.sh
;exec-if = ping openweathermap.org -c 1
;interval = 600
;label-font = 3

...

Edit: @Nili, thanks!

Top work @unklar


My Linux installs are as in my music; it s on Metal

Offline

#8 2024-04-04 14:28:27

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,646

Re: waybar, swaybar, polybar

altman wrote:

Top work @unklar

+1  wink

-------------------
Of course, I don't want to withhold the other two bars from those who are interested.

My experience with the swaybar is to configure the weather outside the config of the bar. This makes everything easier.
458764411_scrn-2024-04-04-15-47-57.png

458764471_scrn-2024-04-04-15-40-51.png

An 'autostart' in which the weather is started:

exec systemctl --user import-environment DISPLAY XAUTHORITY
exec_always ~/.config/sway/weather.sh &
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
exec xrdb -load ~/.Xresources

a 'status.sh' script, which I have adapted to wttr.in and its glyphs:

# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

# Produces "21 days", for example
uptime_formatted=$(uptime | cut -d ',' -f1  | cut -d ' ' -f4,5)

# The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
# like 2018-10-06 and the time (e.g., 14:01)
date_formatted=$(date "+%a %F %H:%M:%S")

# Get the Linux version but remove the "-1-ARCH" part
linux_version=$(uname -r | cut -d '-' -f1)

# cut  -d '-' -f2  cut -c17-27
weather_formatted=$(cat /tmp/weather | cut -c2-44)

# Emojis and characters for the status bar
# ? ? ? ? ⚡ ? \| ????????
echo $uptime_formatted ↑ $linux_version ? $weather_formatted ? $date_formatted

and, the weather script itself:

#!/bin/bash

while true
do
	# Get output silently, remove unwanted lines, reformat, output to temp file
	curl -s 'wttr.in/lichtenstein_sachsen?format=+%c+%t+%w+%P+%h+%m' > /tmp/weather
	sleep 600
done

The config of swaybar must then contain, among other things:

# Autostart

include autostart
include status.sh
include variables
include /etc/sway/config.d/*

# Variables
set $mod Mod4
set $term foot
set $menu fuzzel ~/.config/fuzzel/fuzzel.ini
set $screenshot grim ~/Bilder/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $screenclip slurp | grim -g - ~/Bilder/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $background ~/wallpapers/glowing_worldmap_blue.jpg

set $gnome-schema org.gnome.desktop.interface

exec_always {
    gsettings set $gnome-schema gtk-theme 'BL-Lithium'
    gsettings set $gnome-schema icon-theme 'Obsidian-Gray'
    gsettings set $gnome-schema cursor-theme 'DMZ-White'
    gsettings set $gnome-schema font-name 'monospace'
}


### Input configuration
 input * xkb_layout "de"
 input * xkb_variant "nodeadkeys"
 input "MANUFACTURER1 Keyboard" xkb_model "pc105"

# Output configuration
output HDMI-A-1 resolution 1920x1080 position 1920,0
output * bg $background fill
...

ps: the glyphs of wttr.in (moon phases) are unfortunately not displayed correctly here in the code. Also affects Tux battery etc.)

Offline

#9 2024-04-04 14:33:22

altman
Member
From: Canada
Registered: 2015-10-24
Posts: 619

Re: waybar, swaybar, polybar

unklar wrote:
altman wrote:

Top work @unklar

+1  wink

-------------------
Of course, I don't want to withhold the other two bars from those who are interested.

My experience with the swaybar is to configure the weather outside the config of the bar. This makes everything easier.
https://t94.pixhost.to/thumbs/904/458764411_scrn-2024-04-04-15-47-57.png

https://t94.pixhost.to/thumbs/904/458764471_scrn-2024-04-04-15-40-51.png

An 'autostart' in which the weather is started:

exec systemctl --user import-environment DISPLAY XAUTHORITY
exec_always ~/.config/sway/weather.sh &
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
exec xrdb -load ~/.Xresources

a 'status.sh' script, which I have adapted to wttr.in and its glyphs:

# The Sway configuration file in ~/.config/sway/config calls this script.
# You should see changes to the status bar after saving this script.
# If not, do "killall swaybar" and $mod+Shift+c to reload the configuration.

# Produces "21 days", for example
uptime_formatted=$(uptime | cut -d ',' -f1  | cut -d ' ' -f4,5)

# The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date
# like 2018-10-06 and the time (e.g., 14:01)
date_formatted=$(date "+%a %F %H:%M:%S")

# Get the Linux version but remove the "-1-ARCH" part
linux_version=$(uname -r | cut -d '-' -f1)

# cut  -d '-' -f2  cut -c17-27
weather_formatted=$(cat /tmp/weather | cut -c2-44)

# Emojis and characters for the status bar
# ? ? ? ? ⚡ ? \| ????????
echo $uptime_formatted ↑ $linux_version ? $weather_formatted ? $date_formatted

and, the weather script itself:

#!/bin/bash

while true
do
	# Get output silently, remove unwanted lines, reformat, output to temp file
	curl -s 'wttr.in/lichtenstein_sachsen?format=+%c+%t+%w+%P+%h+%m' > /tmp/weather
	sleep 600
done

The config of swaybar must then contain, among other things:

# Autostart

include autostart
include status.sh
include variables
include /etc/sway/config.d/*

# Variables
set $mod Mod4
set $term foot
set $menu fuzzel ~/.config/fuzzel/fuzzel.ini
set $screenshot grim ~/Bilder/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $screenclip slurp | grim -g - ~/Bilder/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $background ~/wallpapers/glowing_worldmap_blue.jpg

set $gnome-schema org.gnome.desktop.interface

exec_always {
    gsettings set $gnome-schema gtk-theme 'BL-Lithium'
    gsettings set $gnome-schema icon-theme 'Obsidian-Gray'
    gsettings set $gnome-schema cursor-theme 'DMZ-White'
    gsettings set $gnome-schema font-name 'monospace'
}


### Input configuration
 input * xkb_layout "de"
 input * xkb_variant "nodeadkeys"
 input "MANUFACTURER1 Keyboard" xkb_model "pc105"

# Output configuration
output HDMI-A-1 resolution 1920x1080 position 1920,0
output * bg $background fill
...

ps: the glyphs of wttr.in (moon phases) are unfortunately not displayed correctly here in the code. Also affects Tux battery etc.)

Some members might find it usefull ! Thx for sharing, it s beyond my capacities ! lol

Edit1; Remember sway from when we were on AL forums.

Edit2: Typo

Last edited by altman (2024-04-04 19:22:06)


My Linux installs are as in my music; it s on Metal

Offline

#10 2024-04-04 16:44:52

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,011

Re: waybar, swaybar, polybar

You guys are now officially flying light years over my head.
lol lol

Keep it up!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#11 2024-04-05 13:52:46

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,646

Re: waybar, swaybar, polybar

Thanks to the links from @el_koraco and @lowrider I discovered that nakeDEB also has an excellent wiki on the polybar.

So I was able to add an underline wink

format-underline = #268bd2

458953072_2024-04-05-155132_418x40_scrot.png

Offline

#12 2024-06-04 15:11:04

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 2,646

Re: waybar, swaybar, polybar

Since I've been working with sway and the swaybar, there's a configuration that I think is absolutely cool because it uses a simple KeyBind configuration to quickly and efficiently handle the logout dialog for the entire system.
Unfortunately, I can't remember where it came from or who made it.

Super+e is the magic and, the red appears  smile
The code:

set $mode_system System: (l) lock, (e) logout, (s) suspend, (r) reboot, (S) shutdown, (R) UEFI
mode "$mode_system" {
    bindsym l exec $lock, mode "default"
    bindsym e exit
    bindsym s exec --no-startup-id systemctl suspend, mode "default"
    bindsym r exec --no-startup-id systemctl reboot, mode "default"
    bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
    bindsym Shift+r exec --no-startup-id systemctl reboot --firmware-setup, mode "default"

    # return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+e mode "$mode_system"

the screenshot:
474823147_coolstezeile.png

Offline

Board footer

Powered by FluxBB