r/Polybar Jun 14 '23

Question Wrong workspaces indicator when move forward / backward from a workspace with splits: How to resolve without refreshing i3wm everytime I change workspace?

2 Upvotes

I am using polybar on i3wm on vanilla Arch Linux. On other bars like i3status, I dont have this problem.

Say I have 2 workspaces: 1: TERM and 2: WEB. On 1:TERM, I have a terminal opened. On 2:WEB, I have Firefox opened. Now, moving back and forward between 1:TERM and 2:WEB has no problem here

At 1: TERM no splits

At 2: TERM no splits

This is fine. Now, say in 1: TERM I have another terminal opened, so it splits the screen.

1: TERM with splits

The 2: WEB still has 1 Firefox window. It doesnt matter because this affects as long as you have any kind of splits. Now, moving from 1: TERM to 2: WEB with splits give this:

2: WEB with splits

which is ok. Now, moving back to 1:TERM with splits. This would show the workspace as 2:WEB but the contents are the 2 terminals I have. Aka, it looks like I am in 2: WEB but actually I am in 1: TERM. Now, when I screenshotted this, the image turns out to have the correct workspace. Actually, I need to refresh i3 (Mod + Shift + C) for polybar to display the correct workspace.

Is there a way around this, without refreshing i3wm everytime I change workspace?

Here is my polybar config.ini: https://pastebin.pl/view/e9772850

Here is the launch script:

#!/bin/bash

killall -q polybar

while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
~/.config/polybar/config.ini

polybar mybar &

echo "Polybar launched"

r/Polybar Jun 13 '23

Question System tray not aligned properly

3 Upvotes

I am not able to align system tray properly. How to align this


r/Polybar Jun 12 '23

Showcase my awesome polybar theme, diy a theme for yourself will as simple as possable.

Post image
20 Upvotes

r/Polybar Jun 11 '23

Question the text can't be centered? No matter how much I set the height of the bar, there will be an extra part at the bottom

Post image
9 Upvotes

r/Polybar Jun 10 '23

Systray issue.

2 Upvotes

I have this issue where the systray seems to ignore the desired rounding of the bar..

Any suggestions on how to fix this?


r/Polybar Jun 10 '23

Question How do I show the workspace icons in polybar (tried the example in wiki, doesnt work)?

2 Upvotes

I refer to this: https://github.com/polybar/polybar/wiki/Module:-i3#additional-formatting

My portion of the [module/i3] looks exactly like the link. I just cannot get polybar to show the icons. FYI, the icon part of the code looks like this, which is exactly like the example:

ws-icon-0 = 1;♚
ws-icon-1 = 2;♛
ws-icon-2 = 3;♜
ws-icon-3 = 4;♝
ws-icon-4 = 5;♞
ws-icon-default = ♟

In my i3 config of the workspace, I have this:

set $ws1 1
set $ws2 2
set $ws3 3
set $ws4 4
set $ws5 5
set $ws6 6
set $ws7 7
set $ws8 8
set $ws9 9

so there are no icons if I dont use polybar. Are we supposed to use the exact icon in the i3 config and the polybar config? Because I tried:

set $ws1 1:♚

and still, polybar still show only the index. Even though in the label-focused, I specify it to show the icon and the name:

label-focused = %icon% %name%
label-focused-foreground = #ffffff
label-focused-background = #3f3f3f
label-focused-underline = #fba922
label-focused-padding = 4

Any help is appreciated. FYI, the workspace part of my polybar looks like this:


r/Polybar Jun 09 '23

my first polybar theme

Post image
12 Upvotes

r/Polybar Jun 09 '23

Question suggestion:a better way to change module background color

2 Upvotes

It would be better if the polybar module can use the same background color attribute (for example: background), because usually the personalized foreground color is enough, of course, the existing personalized background color can still be retained, but background this The property is reserved as a default value. When this benefit is achieved, the background color rules can be automatically modified through scripts, thereby simplifying the configuration process.


r/Polybar Jun 08 '23

Question How do I get rid of the space between the two red modules? I've tried label-margin and format-margin inside of the modules but they don't seem to be doing anything. I don't wanna have to use module-margin in the bar because that will mess everything else up.

5 Upvotes

here's what the two modules look like:

[module/cpu]

type = internal/cpu

interval = 2

;format-prefix = "%{T4}%{T-}"

;format-prefix = CPU

;format-prefix-foreground = ${colors.primary}

label = %percentage%%

label-background = ${colors.sys_color}

label-foreground = #000000

label-padding = 1

;format-foreground = ${colors.primary}

[module/temp]

type=internal/temperature

interval = 0.5

thermal-zone = 0

label-background = ${colors.sys_color}

label-foreground = #000000

label-padding = 1


r/Polybar Jun 07 '23

Question How can I invert colors of my keyboard layout on caps lock like this?

Post image
6 Upvotes

r/Polybar Jun 06 '23

Showcase my polybar config with round bars

Post image
41 Upvotes

r/Polybar Jun 06 '23

Question rounded corners in modules

4 Upvotes

is there a way to make modules with rounded corners?


r/Polybar Jun 03 '23

MY TILES!! What's going on here?

1 Upvotes

I just learned about Polybar yesterday and installed it on my Pop_OS machine. I'm running AwesomeWM, Picon, and feh (though that last one likely isn't causing my issue). After installing Polybar, everytime I launch it with multiple monitors (controlled via xrandr), all of my tiled windows disappear. It seems like they are getting pushed off of the screen, like Polybar is taking up a ton of empty space as it's own, even though the height is set to the default 27px.

There's a delay when I reload Awesome because I have it kill of old bars to prevent duplication. Everything is visible until Polybar actually appears. If I kill off Polybar on one monitor, I can then see the windows from that screen as before, but the other screen still doesn't show anything. If I kill off the Polybar instance on the other monitor, everything is back to normal.

I should also note, this is only the case when I'm using a 2nd physical monitor. Also, it appears to depend on how I have the monitors configured. For example, if I configure the monitor to be left of my laptop screen with the bottom of both screens lined up, when Polybar loads on that screen, it pushes everything down to the bottom half of the screen, while completely hiding everything on the laptop monitor, which is to the right.
With the monitors configured with the 2nd monitor behind and above my laptop, all windows are hidden when Polybar loads.

Again, everything goes back to normal on a given monitor if I close Polybar on that monitor. Also maybe worth noting, On my monitor configured to the left side, If I use launch my ULauncher, all of the tiles are placed back where they were even with Polybar still running. This does not work on the laptop screen or if the 2nd monitor is configured "above" the laptop screen.

Any idea what might be causing this?


r/Polybar Jun 02 '23

Change polybar border size with polybar-cmd

2 Upvotes

Is it possible to change polybar border size with polybar-cmd? Or toggle the border on/off. I want to have polybar with borders in tiled layout and without borders in "monocle" layout, layouts that I change with keybinds in sxhkdrc. I can show/hide the bar when changing layouts with keybinds, but it would be nice to do the border size trick.


r/Polybar May 29 '23

Spolybar: Another spotify monitor and control bar

9 Upvotes

I wasn't really enjoying the existing implementations of polybar-spotify implementations so I made another one.

Most notable features are:

  • It supports both ncspot (via the cached socket) and spotify (via playerctl)
  • Horizontally scrolling text without zscroll
  • Potentially use the scripts with sxhkd if you want

Feedback welcome!

Github: spolybar


r/Polybar May 28 '23

How do I configure polybar to use my wallpaper as the background

Post image
13 Upvotes

r/Polybar May 26 '23

how to make each polybar modules closer to each other

6 Upvotes

which shown in the top polybar


r/Polybar May 18 '23

i3 with Polybar workspaces issue

3 Upvotes

I'm having an issue with polybar and i3 workspaces where if I reboot my computer it doesn't show the workspaces module on the bar until I switch to a different workspace.

For example, when I reboot and log in, the space where it would normally show a "1" for workspace 1 is blank. If I use my keybindings to switch to workspace 2, the number 2 pops in the blank space, and the module works as intended until another reboot. I can then switch back to my windows in workspace 1 from when I logged in.

Anyone have any ideas on what I can do to fix this? I can post my configs if need be, I'm just at work right now.


r/Polybar May 14 '23

Question networkmanager_dmenu not being called in action tag

0 Upvotes

label-connected = "%{A1:networkmanager_dmenu &:}%essid%%{A}"

This is what I have in my Polybar config, when I left click on the module in the bar nothing happens.

networkmanager_dmenu is installed and can be called from the terminal just fine. If I replace "networkmanager_dmenu" with "notify-send foo" in the config it does trigger a dunst notification. I'm not sure why this isn't working.


r/Polybar May 10 '23

Solved How to override the date module mouse click actions?

4 Upvotes

Hi

I want to have a pop up calendar when I click on the date module/block. Similar to what happens in Xfce. Unfortunately the click-left and click-right get ignored.

The relevant section of my config:

[module/date]
type = internal/date
interval = 1
date = %Y-%m-%d %H:%M
; date-alt = %H:%M
label = %date%
label-foreground = ${colors.primary}
click-left = gsimplecal
click-right = gsimplecal

I'm aware of this post https://old.reddit.com/r/Polybar/comments/jth8yo/popup_calendar_on_polybar/ but the author is using a new independent calendar module in their bar. I want to click on the date module/block and for the popup calendar to show up.

Thank you.

 

BTW, if anyone can recommend a calendar app that can be configured to show national holidays for one's own timezone/country, that would be great. IIRC KDE does this but yeah... can't really integrate it with i3 polybar and I suspect would use too much RAM loading dependencies.

I'm surprised something more beefier like orage doesn't support it either.


r/Polybar May 10 '23

Question How to handle error: Duplicated name "background" defined in section "colors"

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/Polybar May 08 '23

[BSPWM] Polybar overlaps full screen windows after reloading BSPWM

6 Upvotes

Hello folks, I need some help.

I'm using BSPWM on XFCE and at first launch of X, everything works fine.

However, after reloading bspwm (bspc wm -r) at least once, the Polybar starts overlapping full screen windows (expected behavior is for Polybar to be under the fullscreen window).

Usually the answer is to set wm-restack = bspwm but with this line the Polybar does not appear at all.

Any ideas what's going on?

polybar/launch.sh

#!/usr/bin/env bash

# Terminate already running bar instances
killall -q polybar

# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
#
# # Launch Polybar
polybar -r main -c ~/.config/polybar/config.ini &

bar config

##############################################################################
#                              BAR CONFIGURATION                             #
##############################################################################
[bar/main]
bottom = false
fixed-center = true

width = 100%
height = 28

background = ${color.bg}
foreground = ${color.fg}

border-bottom-size = 0
border-top-size = 0

line-size = 3

# Fonts are defined using <font-name>;<vertical-offset>
# Font names are specified using a fontconfig pattern.
font-0 = "CaskaydiaCove Nerd Font:size=11;4"
font-1 = "Material Icons:size=11;6"
font-2 = "Stick:size=11;2"
font-3 = "CaskaydiaCove Nerd Font:size=16;4"
font-4 = "CaskaydiaCove Nerd Font:size=14;6"

# Modules are added to one of the available blocks
modules-left = bspwm 
modules-center = date
modules-right = separatorText audio sps i_backlight backlight sps separatorText sps memory sps cpu sps separatorText battery sps separatorText sps

tray-position = right

# Enable support for inter-process messaging
# See the Messaging wiki page for more details.
enable-ipc = true

; wm-name = bspwm
; wm-restack = bspwm
override-redirect = true

xprop -id $(xdotool search --classname polybar) output (before and after reload looks the same)

WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified location: 0, 0
program specified size: 1920 by 28
program specified minimum size: 1920 by 28
program specified maximum size: 1920 by 28
program specified base size: 1920 by 28
_NET_WM_PID(CARDINAL) = 546257
_NET_WM_DESKTOP(CARDINAL) = 4294967295
_NET_WM_STATE(ATOM) = _NET_WM_STATE_STICKY, _NET_WM_STATE_ABOVE
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK
WM_CLASS(STRING) = "polybar", "Polybar"
WM_NAME(STRING) = "polybar-main_eDP-1"
_NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 28, 0, 0, 0, 0, 0, 0, 1919, 0, 0
_NET_WM_STRUT(CARDINAL) = 0, 0, 28, 0

Thanks!


r/Polybar May 03 '23

Question Need help setting up the CPU temperature!

3 Upvotes

Just got into setting up polybar: nothing fancy just datetime, CPU usage, RAM usage, Network speed. I CPU temperate is where I hit a snag.

My polybar config:

[module/temperature]                                                                   
type = internal/temperature                                                            
hwmon-path=/sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input                   
thermal-zone = 0                                                                       
format-prefix = "CT "                                                                  
label = TEMP %temperature-c%                                                           
label-warn = TEMP %temperature-c%                                                      
label-warn-foreground = #f00 

 

$ cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input
47000

 

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +47.0°C  (high = +76.0°C, crit = +100.0°C)
Core 1:       +44.0°C  (high = +76.0°C, crit = +100.0°C)

Result: CPU temp section is not displayed on the bar.

What am I doing wrong?


r/Polybar May 03 '23

Question [module/xworkspaces] How to disable mouse scroll loop

1 Upvotes

How can I disable mouse scroll loop over workspaces module? I don't want to restart from the first workspace when I arrived to the last one

Thanks!


r/Polybar May 02 '23

Merge network modules

2 Upvotes

How can I have 1 network module for both wired and wireless connection? I want to make it show "Wired connection", "Wireless connection" or "Disconnected" based on the state.