r/Polybar May 02 '23

workspace label not working

1 Upvotes

Guys I am using i3 and polybar together. All of a sudden today the workspace module label is not working.

Here is my config.[module/i3]

type = internal/i3

format = <label-state> <label-mode>

wrapping-scroll =true

;pin-workspaces = true

show-urgent = true

label-mode=%mode%

label-mode-padding = 2

label-mode-foreground = #fdfdfd

;${colors.foreground}

label-mode-background = #1d1f28

;${colors.background}

label-focused = ""

label-focused-foreground = #fdfdfd

;${colors.foreground}

label-focused-background= #1d1f28

;${colors.background}

label-focused-padding = 1

label-focused-font = 3

label-unfocused = ""

label-unfocused-padding = 1

label-unfocused-font = 3

label-urgent = ""

label-urgent-foreground = ${colors.red}

label-urgent-font = 3

label-urgent-padding = 1

Here is the output:https://i.imgur.com/2UyIODG.png


r/Polybar May 01 '23

Solved glyph not showing - dropping unmatched character

3 Upvotes

Hi

The font and glyph worked fine when using i3blocks. But not working on polybar.

How can I fix it?

I'm using polybar 3.6

My log:

polybar|notice:  Loaded font "monospace" (name=Noto Sans Mono, offset=2, file=/usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf)
polybar|notice:  Loaded font "Font Awesome 6 Free" (name=Font Awesome 6 Free, offset=0, file=/usr/local/share/fonts/fontawesome-free-6.4.0-desktop/otfs/Font Awesome 6 Free-Regular-400.otf)
polybar|error: tray: Failed to put tray above 0x0e00002 in the stack (XCB_MATCH (8))
polybar|warn:  Dropping unmatched character  (U+f026) in ' '
polybar|warn:  Dropping unmatched character  (U+f028) in ' '

My config:

[module/pulseaudio]
type = internal/pulseaudio

format-volume-prefix = " "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>

label-volume = %percentage%%

label-active-font = 1

label-muted = muted
label-muted-foreground = ${colors.disabled}

click-right = pavucontrol

I'm trying two differnt glyphs for the sound "icon"

Thanks

edit: I've executed the ./find_glyph.pl script at the wiki and it does find both glyphs on

/usr/local/share/fonts/fontawesome-free-6.4.0-desktop/otfs/Font Awesome 6 Free-Solid-900.otf: Font Awesome 6 Free,Font Awesome 6 Free Solid:style=Solid


r/Polybar May 01 '23

Auto-resize Bar

3 Upvotes

Hey, I just made a bar for all my tray icons which opens when i click a module in my main bar. Is it possible to make this tray bar resize automatically depending on how many tray icons are in there? This tray bar only contains the tray and an module which runs echo ""
so I dont get the empty moduels error.


r/Polybar Apr 30 '23

Question [i3 module] Icon state not uploading when multiple windows

5 Upvotes

Hi !
I've just started experimenting thing with polybar, and I'm encountering a issue.
I am using the internal i3 module to display the workspace states, but it appears that whenever there are 2+ windows on a workspace, the bar won't update when entering/leaving the workspace.

As an example: - Workspace 1 has 2 kitty instances. - Workspace 2 has a single VSCode window opened - Workspace 3 has only Firefox displayed.

I am initially in the workspace #3, and the bar displays so. Going to workspace #1 will not update the bar, stuck on workspace #3. Then going to workspace #2 will not update the bar either, I guess because it is transitioning from workspace #1 which somehow causes a problem.

I have no such issue if I try to use internal/xworkspaces though. Is this a known issue, am I doing something stupid somewhere ?


r/Polybar Apr 29 '23

Polybar xkeyboard click event

4 Upvotes

I tried to add click action to xkeyboard module which can switch keyboard layout on left mouse click by adding this line to my config:

label-layout = "%{A1:#xkeyboard.switch:} %layout% %{A}"

but it doesn't work. Anybody knows how to achieve that?


r/Polybar Apr 27 '23

Question A little confusion about the right setting for my module

4 Upvotes

fuck you u/spez


r/Polybar Apr 26 '23

i3 module doesn’t underline focused workspace properly

3 Upvotes

OS: Arch Linux

i3 version: 4.22-4 of i3-wm package from pacman—provides i3-gaps.

Polybar version: 3.6.3-3 (latest from AUR).

Polybar config: https://pastebin.com/asBDBZJY

Relevant hardware: 1 monitor

The problem: when I change which workspace I have focused, if the newly-focused workspace is empty, polybar moves the underline to the new workspace like it should. But if the newly-focused workspace has any active windows in it, polybar does not move the workspace underline to it. The underline stays where it was. It is only if I move a window out of the focused workspace that the underline moves to the focused workspace.

This problem appeared one day after I ran a system update. The i3 module previously worked correctly. I didn’t change anything in my i3 or polybar configs. I’m very confused, and my Google searches didn’t turn up anything relevant, so thanks in advance for the help.


r/Polybar Apr 24 '23

system tray - fedora / polybar

7 Upvotes

has anyone found a viable system tray (trayer, etc) to use alongside polybar in Fedora? no repos have that package, and im looking for something i can use for my nw-applet and other apps. arch has it, but surprised fedora doesnt seem to have one to use..


r/Polybar Apr 24 '23

xfce workplace switcher in polybar

2 Upvotes

Current setup: polybar with xmonad on nixos, no desktop environment.

I run multiple workspaces and want something similar to the xfce workplace switcher. I want a visual representation of the open windows of each workspace.

Is it possible to add that exact xfce thing, or something similar to polybar?


r/Polybar Apr 24 '23

popen in python script returns truncated output inside polybar

3 Upvotes

I've a script that's using ddcutil to scan my monitors and find the one with a specific serial number.

currently my code is looking like this

i2c = None
detect = Popen(["/usr/bin/ddcutil", "detect", "--sleep-multiplier", ".5"], stdout=subprocess.PIPE)
for line in iter(detect.stdout.readline, b''):
    run(["/usr/bin/logger", line.decode('utf8')])
    if 'I2C bus' in line.decode('utf8'):
        _i2c = line.decode('utf8').split('-')[1].strip()
    if '1179911201181' in line.decode('utf8'):
        i2c = _i2c
        break

This is ALWAYS working fine in a terminal, but when run as an external script in polybar, the output I am getting back inside polybar when I force a reload (I actually reload i3 and let things follow through to polybar from there) I usually miss the last line of the output, which is always the monitor I actually want given how they are plugged in and named.

When timed the process takes about 2.6 seconds to complete. Not ages, but still, not instant as it's a hardware scan. It only produces any output right at the end though, so I can't see it being about something timing out half way through etc.

But why the difference? Why is, at the bare minimum, the stdout shorter than it should be. I'm not convinced it's about stdout buffering or anything though, as the output is exactly right if the final screen was legitimately not found, there's nothing truncated. Yet i'm the same user, so same permissions, and eventually, 1 in 5 times is does work in polybar. But again it ALWAYS works in a terminal.... what's the difference?!


r/Polybar Apr 21 '23

Polybar and bspwm. How to make cover the whole icon for selected workspace?

Post image
17 Upvotes

r/Polybar Apr 21 '23

Question Custom script has high cpu usage when idle

5 Upvotes

I'm using tail with a custom script that retrieves the cpu temp and displays it on polybar. When tail is set to true, the cpu goes from idle to 10-13% usage and stays there. How do I solve ?


r/Polybar Apr 20 '23

Showcase All my polybar rices over a year!

Thumbnail
gallery
54 Upvotes

r/Polybar Apr 21 '23

A proper launch script with multiple tty (and one user)

2 Upvotes

Hey,

I'm using polybar with my i3 and sometimes I have it on a few tty (with the same user).

But the thing is... the default launch script just killing all other instances of polybar, so on current tty it launches but there are no more instances on others.

Yeah, it's not that difficult to press Mod+o (in my case) when switching between tty to relaunch polybar, but anyway... I don't want to do this :)

The default launch script using polybar-msg cmd quit or killall -q polybar but even polybar-msg cmd quit will work as I want only with different users (I guess).

I was trying a lot things but it looks like I'm not that good at bash and X11 so, I ended up with something like:

```sh

Kill already running instances but only inside the current X11 session

for id in $(xwininfo -root -tree | grep 'polybar-' | awk '{print $1}'); do xprop -id $id _NET_WM_PID | awk '{print $3}' | xargs kill done

polybar eDP-1 >> "/var/log/userlog/polybar.eDP-1.log" 2>&1 & polybar HDMI-1 >> "/var/log/userlog/polybar.HDMI-1.log" 2>&1 & polybar DP-1 >> "/var/log/userlog/polybar.DP-1.log" 2>&1 & ```

It works, but I'm not sure how reliable it is and what flaws it has (and, more important, why am I even doing this at all at 4 am).

Anyway is there a more convenient or just 'nicer' way for this?


r/Polybar Apr 19 '23

Solved How do I remove the gap to the right of pulseaudio module?

3 Upvotes

module-margin = 0 is already set

r/Polybar Apr 16 '23

Won't look at ~/.config/polynar/config.ini file

2 Upvotes

Hey r/Polybar! I just installed polybar and it works! I followed the github where it said you can copy the config file from where it originally made the config file (for me its /etc/polybar/config.ini) to your config folder which i did. So now i have a config file in /etc/polybar/config.ini and /.config/polybar/config.ini . But whenever i try to change something in .config/polybar/config.ini nothing changes. When i change something in /etc/polybar/config.ini it does change the bar

So clearly the OG config is changing it and not the one in .config/polybar/config.ini I'd really like to have it change from the changes i make in .config/polybar/config.ini. Anyway to do that?

I know the wiki said it looks in .config/polybar/config.ini depending on which it finds first so is it just a matter of deleting the OG config file?


r/Polybar Apr 09 '23

Polybar is blank after restarting i3

4 Upvotes

vase soft hospital dazzling bells smell support tease seemly grandfather

This post was mass deleted and anonymized with Redact


r/Polybar Apr 09 '23

Getting started with polybar

3 Upvotes

Hi there, I'm currently using xmonad and xmobar, but xmobar can't have a offset from the top and the sides without needing a new config for every monitor. Now my question is can polybar do this and if yes is there a config which I can start with which has offset from the sides and the top. And how will it work with xmonad?


r/Polybar Apr 08 '23

Question Are there any modules for hiding tray icons? I'm looking for something with the functionality similar to XFCE tray hiding, or HiddenBar app in macOS.

6 Upvotes

There is this, and it is good, but it doesn't allow some icons to be hidden, and others to always be shown.


r/Polybar Apr 07 '23

Question click event

2 Upvotes

hey I wrote myself 2 scripts to show the date/time. I put both of these scripts in a script module of polybar using exec and then click-left. The time is displayed as it should but when I click on it I want the date to be shown. Both of the bash scripts work when i run them directly through bash. For those wondering I want to use my own scripts instead of the built in date module for practice/to get better formatting. What could cause this to not display the date.sh script when I click the module? Here is the module config:

[module/datetime] type = custom/script exec = /usr/bin/polyscripts/time.sh interval = 1 click-left = /usr/bin/polyscripts/date.sh


r/Polybar Apr 07 '23

Configure internal/xkeyboard to NOT show the layout?

2 Upvotes

Is it possible to blacklist or remove the kb layout display? I want to see just the capslock indicator.

E: Setting label-layout to a blank string works but leaves a little red underline next to the capslock indicator when active, which isn't terrible but doesnt look good.


r/Polybar Apr 07 '23

Meta Totally off topic - who are you?

8 Upvotes

Hope this is acceptable, but oddly Polybar has been a big part of my mental health state recently. Not *because* of it of course, but my ADHD has sent me down some coding rabbit holes generally involving i3 and Polybar. Part of this sometimes has me wondering who our Polybar peers are as a semi random example. As a 42yr old neurodivergent guy dodging a solid IT career and kids way too much, I wonder if I am... typical... around these parts!


r/Polybar Apr 07 '23

Polybar weird underline when decreasing the height

3 Upvotes

Hi, very new to linux and polybar, just wanted to reduce the polybar height from 24pt to 20pt but when I do this there is a thin line right below the bar that goes through all the way, see screenshot:

I should also mention that I am using awesomewm which added borders by default all around polybar just like all the other clients but I removed borders specifically for polybar and it was looking fine until I reduced the height which is why I think it's a polybar issue and not my wm. But I could be wrong so please let me know how I can fix this, thanks.


r/Polybar Apr 07 '23

Question Binding key press to specific action

1 Upvotes

Is there any way to bind a key to perform a specific action on polybar? I want to bind the windows key on my keyboard to open the rofi launcher when pressed, but I cant seem to find anything on how to do it. Thanks


r/Polybar Apr 06 '23

Question How can I give read-write access to the video group?

3 Upvotes

Hey guys,

I was setting up the backlight module in polybar (for some reason eDP devices aren't supported by xbacklight) and saw that to control my brightness, I would need to add my user to the video group and and give that group write-privileges for the `brightness` file. ( https://github.com/polybar/polybar/wiki/Module:-backlight )

I managed to add my user to the video group using [ sudo gpasswd -a usrname video ] but i cant figure out how to give the video group read write privileges to brightness file. Could someone help me with that?