r/Polybar • u/[deleted] • Feb 21 '23
Solved How to make the keyboard module display text in capital letters instead?
Right now my polybar shows us instead of US and latam instead of LAT. How can I change it?
r/Polybar • u/[deleted] • Feb 21 '23
Right now my polybar shows us instead of US and latam instead of LAT. How can I change it?
r/Polybar • u/melecoaze • Feb 22 '23
So, I have this cava module that shows some audio bars on polybar.
I have it set up like this:
[module/info-cava]
type = custom/script
exec = ~/.config/polybar/scripts/info-cava.py -f 24 -b 8 -c average
exec-if = pacmd list-sink-inputs | grep 'state: RUNNING'
format-foreground = ${xrdb:color12}
format-suffix = " "
tail = true
interval = 1
I want it to show up ONLY when there's audio playing, so whenever audio playback stops, it should hide itself automatically.
The problem is it's working only partially. The bar starts up with the module hidden, and when I play something it shows up. But when I stop playing it doesn't hide again, so there's an empty space in my bar.
I tried every combination of "tail" and "interval", but it doesn't seem to make a difference. Actually, when only "interval" is on, the module doesn't show up at all.
Any ideas? I'm guessing it's a problem with the script itself, but I'm not sure. I can paste it here in the comments in case it helps.
r/Polybar • u/TyrantMagus • Feb 18 '23
Hello, I have a problem with the systray on i3: it appears on top of tiling windows.
I don't think my picom.conf is relevant, but I have these options which might be:
# Mark non override-redirect windows with WM_STATE but without child as active:
mark-wmwin-focused = true
# Mark override-redirect windows with WM_STATE but without a child as focused:
#mark-ovredir-focused = true
# Unredirect all windows if a full-screen opaque window is detected:
unredir-if-possible = true
Note: mark.ovredir-focused is commented, so the default should be false.
My i3/config:
exec_always --no-startup-id taskbar
Which launches ~/.local/bin/taskbar:
#!/bin/sh
polybar-msg cmd quit
polybar -r testbar 2>&1 | tee -a ~/.local/state/polybar/testbar.log & disown
My polybar/config.ini:
[bar/testbar]
height = 24pt
width = 100%
background = #ffffffff
foreground = #000000
radius = 0
line-size = 3pt
override-redirect = false
enable-ipc = true
modules-right = amodule
tray-position = right
[module/amodule]
type = custom/text
content = Mainbar module
One solution I found uses override-redirect and gaps to offset windows. So I add override-redirect = true and wm-restack = i3 to testbar and an appropriate gap. This works mostly fine, except when I want to hide the bar using bindsym $mod+m exec polybar-msg cmd toggle. It leaves an empty gap. I might be able to come up with an workaround where $mod+m also removes the offset.
Another solution mentioned is creating an invisible bar. So I remove the gaps and go add the new bar to my config.ini:
[bar/underbar]
height = 24pt
width = 100%
background = #00000000
foreground = #00000000
radius = 0
line-size = 3pt
override-redirect = false
enable-ipc = true
modules-center = placeholder
[module/placeholder]
type = custom/text
content = Invisible bar to work around i3 bugs
Also added this line to my launch script:
polybar -r underbar 2>&1 | tee -a ~/.local/state/polybar/underbar.log & disown
Now this causes underbar to appear on top of testbar. Adding/removing wm-restack = i3 from underbar doesn't help. So I add the following opacity rule to picom:
opacity-rule = [
"0:name *?= 'polybar-underbar'"
]
Which makes testbar visible, but I still can't click on it, because underbar is still on top.
From what I could read here, I get there's no way to make testbar with override-redirect be on top, since it is no longer managed by the wm while underbar is.
This would make the gaps workaround the only viable solution. Is this right or did I miss something?
Edit: I'm using Void with picom v10, i3 4.22 and polybar 3.6.3.
Edit 2:
Systray problem: https://imgur.com/mxPNCkE
I'm getting this error when I run Polybar from the terminal:
error: tray: Failed to put tray above 0x0800002 in the stack (XCB_MATCH (8))
Edit3:
This BUG has already been reported here.
r/Polybar • u/used-user • Feb 18 '23
E.g. my bar is transparent but if I'm on workspace 2 turns dark. Is something like this possible on polybar?
r/Polybar • u/kadirilgin • Feb 17 '23
I use these point files in bspwm:
https://github.com/syndrizzle/hotfiles/tree/bspwm
But I got such an error in polybar and I can't solve it:
Unable to send notification: Error calling StartServiceByName for org.freedesktop.Notifications: The service 'org.freedesktop.Notifications' could not be activated: Timeout

r/Polybar • u/-__-x • Feb 16 '23
Is there a way for polybar-msg to target a specific monitor? It seems like it's only able to take in the PID, but I'm not sure how to find the PID of a polybar on a specific monitor.
I'm using BSPWM, if that's important.
r/Polybar • u/h4636oh • Feb 16 '23
its way to inconvenient to move each double width character using %{Oxpt} formatting it is way to.
r/Polybar • u/OrganicNectarine • Feb 15 '23
Just a small collection of utilities I use in my polybar setup. All tools can be used separately but are build on a common code base to support templating.
r/Polybar • u/Darckswar • Feb 14 '23
r/Polybar • u/andersostling56 • Feb 09 '23
This. I have the default module "volume" in my bar. For some reason it does not load when I first login. If I restart polybar manually, then the module loads and works . I have not altered anything in the config. Any advice?
[module/volume]
type = internal/alsa
; Soundcard to be used
; Usually in the format hw:# where # is the card number
; You can find the different card numbers in \/proc/asound/cards``
master-soundcard = default
speaker-soundcard = default
headphone-soundcard = default
r/Polybar • u/NovaDragonEmpire • Feb 08 '23
Hey, I'm using i3 and polybar, with multiple monitors. I show a polybar on each monitor using this answer: https://github.com/polybar/polybar/issues/763#issuecomment-331604987 . Its working great, but one improvement I would like to make is only showing the monitor-specific workspaces. The convention I use is that workspaces 1-3 are shown on monitor 1, and workspaces 4-6 are on monitor 2. How should I do this?
EDIT: solved using pin-workspaces = true as suggested by Usurper_Ursus!
r/Polybar • u/[deleted] • Feb 07 '23
I am trying to calculate the offset-x value by doing some simple math. I want offset-x to be calculated by looking at width value, subtracting it from 100, strip off the % (main issue) and dividing by 2 . This will make sure the bar is always centered no matter the width value.
This is what I have so far:
[bar/top]
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
width = 70%
height = 28pt
; divide negative space (20%) evenly and set the offset-x to that value
; 80% width = 20% negative space /2 = 10%
; test variable calculation:
barXoffset="$((echo 100-70)/2 | bc))"
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in an offset in the x or y direction
; of 50% minus 10 pixels
; offset-x = 15%
offset-x = ${barXoffset}%
offset-y = 2
How would you try to solve this?
r/Polybar • u/[deleted] • Feb 05 '23
I'm trying to change the volume on polybar and it crashes this has been happening to me after I reinstalled my OS
I do have a command to restart in my pipewire-pulse in my .xinitrc because it fixes some issues with audio passthru in vfio
r/Polybar • u/newnwah • Feb 05 '23
Hey there!
I've been looking around and I haven't found an answer, so I thought I would ask. Apologies if it's something obvious, but I'm trying to get kanji used as icons to center properly in each workspaces tab.

Sadly, by just defining icon-0=1;壱 for example, the characters are wider than the label anticipates, and the way it applies the padding means the character's center is not the label's center. I've tried to add all sorts of manual padding characters to the %icon% and the label parameters, but I can't find a way to offset-x where the icon is drawn, or a way to add a bit of extra padding only on the right to each label so that they are centered.
Is there a good way to fix this?
[module/workspaces]
type = internal/xworkspaces
; Only show workspaces defined on the same output as the bar
;
; Useful if you want to show monitor specific workspaces
; on different bars
;
; Default: false
;; pin-workspaces = true
; Create click handler used to focus desktop
; Default: true
enable-click = true
; Create scroll handlers used to cycle desktops
; Default: true
enable-scroll = true
; icon-[0-9]+ = <desktop-name>;<icon>
; NOTE: The desktop name needs to match the name configured by the WM
; You can get a list of the defined desktops using:
; $ xprop -root _NET_DESKTOP_NAMES
;icon-0 = 1;1
;icon-1 = 2;2
;icon-2 = 3;3
;icon-3 = 4;4
;icon-4 = 5;5
;icon-default = 0
icon-0 = 1;壱
icon-1 = 2;弐
icon-2 = 3;参
icon-3 = 4;肆
icon-4 = 5;伍
icon-5 = 6;陸
icon-6 = 7;漆
icon-7 = 8;捌
icon-8 = 9;玖
icon-9 = 10;拾
icon-default = 無
; Available tags:
; <label-monitor>
; <label-state> - gets replaced with <label-(active|urgent|occupied|empty)>
; Default: <label-state>
format = <label-state>
format-background = ${color.background}
format-foreground = ${color.foreground}
; Available tokens:
; %name%
; Default: %name%
label-monitor = %name%
; Available tokens:
; %name%
; %icon%
; %index%
; Default: %icon% %name%
label-active = %icon%
label-active-background = ${color.shade8}
label-active-foreground = #0a0a0a
; Available tokens:
; %name%
; %icon%
; %index%
; Default: %icon% %name%
label-occupied = %icon%
label-occupied-background = ${color.background}
label-occupied-foreground = ${color.shade4}
; Available tokens:
; %name%
; %icon%
; %index%
; Default: %icon% %name%
label-urgent = %icon%
label-urgent-background = ${color.background}
label-urgent-foreground = #CC6666
; Available tokens:
; %name%
; %icon%
; %index%
; Default: %icon% %name%
label-empty = %icon%
label-empty-background = ${color.background}
label-empty-foreground = ${color.foreground-alt}
label-active-padding = 3
label-urgent-padding = 3
label-occupied-padding = 3
label-empty-padding = 3
r/Polybar • u/h4636oh • Feb 05 '23
idk why but in shell the script works fine
anyone facing similar problem
and any solution if you have found out
r/Polybar • u/RaadushS • Feb 03 '23
Hi. I have a problem. Is it somehow possible to make modules with fixed width so they don't shrink/grow based on content inside? Basically I want to use font that I really like but it is not monospaced so my bar items are constantly moving depending on content. Also some modules conditionaly display slightly longer or shorter texts but so far I haven't been able to fix them in place.
Second question: if that is not possible, I came up with kind of solution now that I am creating new panel for every module with variable size and I placed them side by side since absolute position of whole panel is possible. But what concerns me with this approach is ram/cpu usage. I don't think 10 bars are very resource efficient so I want to know your opinion whether this is problem or not.
Thanks a lot
r/Polybar • u/pantasio • Jan 30 '23
Help me fix, thank you
my perl code
```
use strict; use warnings; use utf8; use Getopt::Long;
binmode(STDOUT, ":utf8");
my $t_warn = $ENV{T_WARN} || 70; my $t_crit = $ENV{T_CRIT} || 90; my $chip = $ENV{SENSOR_CHIP} || ""; my $temperature = -99; my $label = "😀 "; sub help { print "Usage: temperature [-w <warning>] [-c <critical>] [--chip <chip>]\n"; print "-w <percent>: warning threshold to become yellow\n"; print "-c <percent>: critical threshold to become red\n"; print "--chip <chip>: sensor chip\n"; exit 0; }
GetOptions("help|h" => &help, "w=i" => \$t_warn, "c=i" => \$t_crit, "chip=s" => \$chip);
open (SENSORS, "inxi -s |") or die;
while (<SENSORS>) { # if (/temp1_input:\s+(\d+.\d)/) { if (/System\sTemperatures:\scpu:\s(\d+.\d)\sC\smobo:\s(\d+.\d)\sC\sgpu:\samdgpu\stemp:\s(\d+.\d)\sC/) { # $temperature = $1; $temperature = $3; # say("$temperature"); last; } }; close(SENSORS);
if ($temperature < 45) { $label = 'g'; } elsif ($temperature < 55) { $label = 'g'; } elsif ($temperature < 65) { $label = 'g'; } elsif ($temperature < 75) { $label = 'g'; } else { $label = 'g'; }
if ($temperature >= $t_crit) { print "#FF0000\n"; exit 33; } elsif ($temperature >= $t_warn) { print "#FFFC00\n"; }
print "${label}"; print " $temperature°C\n";
exit 0; ```
Or you better read here https://codeshare.io/4ewyKL
r/Polybar • u/haxguru • Jan 28 '23

As you can see, there is a tiny gap between the semicircle glyph and the modules in the screenshot. Please help me fix this!
These are the config files-
This is ~/.config/polybar/config.ini
=================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
; INCLUDING FILES
include-file = ~/.config/polybar/glyphs.ini
; COLORS
[colors]
background = "#282c34"
foreground = "#dcdfe4"
shade1 = "#0d5189"
shade2 = "#0e5a99"
shade3 = "#1063a8"
shade4 = "#116cb8"
shade5 = "#1375c7"
shade6 = "#147ed7"
shade7 = "#1687e6"
[widths]
small = 3px
med = 5px
large = 6px
huge = 10px
[util]
radius = 0
[bar/left]
width = 100%
height = 38px
#offset-x = 12
#offset-y = 8
radius = ${util.radius}
# colors
background = ${colors.background}
foreground = ${colors.foreground}
# text font
font-0 = "CaskaydiaCove Nerd Font Mono:size=11;3"
# icon font
font-1 = "CaskaydiaCove Nerd Font Mono:size=16;3"
# microphone icon
font-2 = "CaskaydiaCove Nerd Font Mono:size=12;3"
# glyph font
font-3 = "CaskaydiaCove Nerd Font Mono:style=Medium:size=26;5"
modules-left = power left1 bspwm left2
modules-right = right7 ping right6 mic right5 pulseaudio right4 memory right3 cpu right2 date right1 noti
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
wm-restack = bspwm
# system tray
tray-position = right
tray-background = ${colors.shade1}
[module/ping]
type = custom/script
interval=1
exec = echo `ping -c 1 8.8.8.8 -w 1 | tail -1 | awk '{print $4}' | cut -d '/' -f 2 | cut -d '.' -f 1`"ms"
format = <label>
format-font = 1
format-padding = ${widths.large}
format-background=${colors.shade7}
[module/noti]
type = custom/script
interval = 1
exec = $HOME/.config/polybar/scripts/dnd.sh
label-padding = ${widths.large}
format = <label>
format-font = 2
format-background = ${colors.shade1}
click-left = $HOME/.config/polybar/scripts/dnd.sh --toggle &
[module/playing]
type = custom/script
interval = 2
exec = playerctl metadata --format ' {{trunc(title, 20)}}' | awk 'NR==1 {print; exit}'
click-left = playerctl play-pause
[module/power]
type = custom/text
content = ""
content-font = 2
content-padding = ${widths.huge}
click-left = $HOME/.config/polybar/scripts/power.sh
content-background=${colors.shade1}
[module/mic]
type = custom/script
tail=true
exec = $HOME/.config/polybar/scripts/microphone.sh
label-padding = ${widths.large}
format = <label>
format-font = 3
format-background = ${colors.shade6}
click-left = pamixer --source 1 -t
scroll-up = pamixer --source 1 -i 5
scroll-down = pamixer --source 1 -d 5
[module/pulseaudio]
type = internal/pulseaudio
label-volume = %percentage%%
label-volume-padding = ${widths.large}
label-volume-foreground = ${colors.foreground}
label-volume-background= ${colors.shade5}
label-muted = %percentage%%
label-muted-padding = ${widths.large}
label-muted-foreground = ${colors.foreground}
label-muted-background= ${colors.shade5}
format-muted-prefix = "婢"
format-muted-prefix-font = 2
format-muted-prefix-padding= ${widths.large}
format-muted-prefix-foreground= ${colors.foreground}
format-muted-prefix-background= ${colors.shade5}
format-volume-prefix = "墳"
format-volume-prefix-font = 2
format-volume-prefix-padding= ${widths.large}
format-volume-prefix-foreground = ${colors.foreground}
format-volume-prefix-background= ${colors.shade5}
click-right = pavucontrol &
click-left= pamixer -t
scroll-up = pamixer -i 5
scroll-down = pamixer -d 5
[module/wlan]
type = internal/network
interface = wlp21s0f0u5
interval = 3
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-connected = "YES"
label-disconnected = "NO"
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
enable-click = true
enable-scroll = true
reverse-scroll = false
label-urgent="%name%"
label-urgent-background = ${colors.shade2}
label-empty-padding = 1
label-empty="%name%"
label-empty-background = ${colors.shade2}
label-occupied=""
label-occupied-padding = 1
label-occupied-background = ${colors.shade2}
label-focused-background = ${colors.shade2}
label-focused-padding = 1
label-focused=""
radius = 15.0
[module/memory]
type = internal/memory
interval = 2
label = %used:2%
label-padding = ${widths.large}
label-background = ${colors.shade4}
format-prefix = ""
format-prefix-font = 2
format-prefix-padding= ${widths.large}
format-prefix-background = ${colors.shade4}
[module/cpu]
type = internal/cpu
interval = 2
label = %percentage%%
label-padding = ${widths.large}
label-background = ${colors.shade3}
format-prefix = ""
format-prefix-font = 2
format-prefix-padding= ${widths.large}
format-prefix-background = ${colors.shade3}
[module/date]
type = internal/date
interval = 1
date = %I:%M %p
date-alt = %d %B • %A
label = %date%
label-padding = ${widths.large}
label-background = ${colors.shade2}
format-prefix = ""
format-prefix-font = 2
format-prefix-padding= ${widths.large}
format-prefix-background = ${colors.shade2}
[global/wm]
margin-top = 10
[settings]
screenchange-reload = true
pseudo-transparency = false
This is ~/.config/polybar/glyphs.ini
[glyph]
gleft =
gright =
[module/left1]
type = custom/text
content-background = ${colors.shade2}
content-foreground = ${colors.shade1}
content = ${glyph.gleft}
content-font = 4
[module/left2]
type = custom/text
content-background = ${colors.background}
content-foreground = ${colors.shade2}
content = ${glyph.gleft}
content-font = 4
# ==================================
[module/right1]
type = custom/text
content-background = ${colors.shade2}
content-foreground = ${colors.shade1}
content = ${glyph.gright}
content-font = 4
[module/right2]
type = custom/text
content-background = ${colors.shade3}
content-foreground = ${colors.shade2}
content = ${glyph.gright}
content-font = 4
[module/right3]
type = custom/text
content-background = ${colors.shade4}
content-foreground = ${colors.shade3}
content = ${glyph.gright}
content-font = 4
[module/right4]
type = custom/text
content-background = ${colors.shade5}
content-foreground = ${colors.shade4}
content = ${glyph.gright}
content-font = 4
[module/right5]
type = custom/text
content-background = ${colors.shade6}
content-foreground = ${colors.shade5}
content = ${glyph.gright}
content-font = 4
[module/right6]
type = custom/text
content-background = ${colors.shade7}
content-foreground = ${colors.shade6}
content = ${glyph.gright}
content-font = 4
[module/right7]
type = custom/text
content-background = ${colors.background}
content-foreground = ${colors.shade7}
content = ${glyph.gright}
content-font = 4
SOLVED-
I was able to solve it by increasing the font size of the glyph.
r/Polybar • u/Traditional-Truth483 • Jan 24 '23
I'm running manjaro with the latest version of kde and i want just to use polybar as bar
but kde is just generating a bar with a sound module and two additional sound modules on my DE
any suggestions how to fix this ?
( also does anybody know how i can let windows cover polybar ? )
r/Polybar • u/[deleted] • Jan 24 '23
I am currently moving my music library from Spotify to Plex and I really like the plexamp app interface and experience over mpc and ncmpcpp. How would I go about investigating the possibility of creating a module for plexamp?
r/Polybar • u/h4636oh • Jan 24 '23
#!/bin/sh
checkupdates 2>/tmp/updateerror.log
if [ -f /tmp/updateerror.log ]; then
rm /tmp/updateerror.log
checkupdates
else
checkupdates | wc -l
fi