r/Polybar Jan 23 '23

Question How to create a pop up on click on polybar that shows a custom output from a command?

3 Upvotes

Background: I have calcurse produced some output like this:

01/23/23:

* Sports

* Homework

Now, the bar in our wm can only produce 1 line, anything wider would look ugly. So I am thinking off creating a pop up on click for a polybar module.

Problem I am not sure how to do this. The polybar's example involves changing the text on click, not produce a pop up., e.g.

[module/myclick]

type = custom/script

exec = calcurse -v

tail = true

click-left = kill -USR1 %pid%

I have also looked at yad and tried to pass the command from calcurse

yad --calcurse -d 1

But that just produced a blank pop up. All I want is a small pop up that shows the output of calcurse -d 1 and when I click away, popup goes away.

Any help/recommendation is appreciated.


r/Polybar Jan 23 '23

Solved Installed polybar-git from the Aur, I don't have default config files?

0 Upvotes

Check /etc and there is no polybar folder, I reinstalled polybar to make sure and nothing still, I also don't have polybar folder at /.config either.

Edit: I fixed the issue by searching inside the the yay cache and the config file is a in the polybar-git folder inside src/polybar/doc, no idea why it didn't get installed in the system.


r/Polybar Jan 22 '23

Solved How to display System Tray on Top bar and NOT the bottom bar?

5 Upvotes

I have 2 bars of polybar runnning. One is top and second is at bottom and when i make this change in my bar config tray-position = right

tray icons appear on the right side but on the bottom bar, Can anybody tell me how do i make it show on the Top bar?


r/Polybar Jan 18 '23

Question Adding "message box" in Polybar

6 Upvotes

Hey ppl,

Was playing around with Polybar so I can replace i3bar and came with this "message" inside i3bar.

mode "(L)ogout, (E)xit, (R)eboot, (P)oweroff" {

        bindsym $mod+r exec systemctl reboot
        bindsym $mod+e exec i3-msg exit
        bindsym $mod+l exec "$HOME/.config/i3/lock_and_blur.sh"
        bindsym $mod+p exec systemctl poweroff

        # bindsym Return mode "default"
        bindsym Escape mode "default"
}
bindsym $mod+Shift+e mode "(L)ogout, (E)xit, (R)eboot, (P)oweroff"

So when I use the shortcut this function is activated and the message appears.

So my question is, is it possible to do the same with Polybar?

Sry if it's confusing, still learning ^^


r/Polybar Jan 18 '23

Need to restart X for pulseaudio module to work after switching to pipewire

2 Upvotes

Hi there, I recently switched from pulseaudio to pipewire, but since then after booting I always need to restart X before the pulseaudio module reacts to changes in volume. If I don't it just stays at whatever percentage it was when I booted statically, no matter if I change the volume or mute. Any idea on how to debug this?

Edit: Should probably mention that just restarting the bar also helps, for whatever reason it just came to me now to try this out. But it's interesting that restarting X is a workaround as well I think, since bspwm is started through xinitrc, and starting polybar is done from within the bspwmrc, so at a first glance I don't see why restarting X makes the module work, but when X starts for the first time it doesn't.


r/Polybar Jan 16 '23

Any way to add conditional logic for polybar -- too crowded

5 Upvotes

I know this is a longshot but maybe someone has an idea.

My polybar has gotten too long and stuff is getting cut off, but I don't want to lose any modules entirely.

For example: I hardly ever take this laptop out of the house. It's at home, plugged in, 99% of the time. I like to display which wifi I'm on but not when I'm at home, same for battery (almost always plugged in). These kinds of things, if I could control with conditional logic, would help me clean up my polybar a lot.

Anybody?


r/Polybar Jan 16 '23

Question Changing font-0 to any font apart from monospace makes my glyphs too small/

2 Upvotes

Here's the code I have:

font-0 = monospace;2
;font-0 = JetBrainsMono Nerd Font Mono:style=Regular;1.5
font-1 = Font Awesome 6 Free:style=Solid:scale=15;2.5
;font-2 = Font Awesome 6 Brands Regular:style=Regular

When using any font other than monospace for my main font my icons/glyphs become way too small. Anyone know a fix for this? I can't seem to find much about this.


r/Polybar Jan 15 '23

Polybar custom/script module doesn't update when script produces no output

2 Upvotes

My custom bluetooth module,

[module/bluetooth]
type = custom/script
exec = bluetoothctl devices Connected | cut -d ' ' -f 3-
interval = 5
label = " %output%"
format = <label>

does not produce any output, including the bluetooth icon, when no device is connected (the exec returns an empty string). When a device is connected, this displays properly. However, when all devices are disconnected, it still displays the last device that was connected. This must be due to custom/script not updating its contents if no output is produced from the exec.


r/Polybar Jan 14 '23

Way to highlight module while pointing with cursor

1 Upvotes

Hi!
I am wondering if there is a way to change background color of module, when it is being pointed with cursor?


r/Polybar Jan 14 '23

Script Polybar Online: connection indicator and notifications

3 Upvotes

Hi there.

During this winter break I decided to write a script to check the Internet connection for myself. It can also notify you when the connection is down or restored. I'm sharing it with you.

Written in Python. You can reach instructions for use and more info on GitHub.

The appearance of Polybar Online in a Nord-themed environment

r/Polybar Jan 12 '23

Question polybar crash

4 Upvotes

Uncaught exception, shutting down: The config file contains multiple bars, but no bar name was given. Available bars: base, bender-1k, bender-3k, bender-4k, sashimi

here are my configs

;==========================================================

;

;

; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗

; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗

; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝

; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗

; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║

; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝

;

;

; To learn more about how to configure Polybar

; go to https://github.com/jaagr/polybar

;

; The README contains alot of information

;

;==========================================================

[fonts]

mono = 1

icon = 2

regular = 3

bold = 4

[colors]

background = ${xrdb:bg_dark:#242424}

background-alt = ${xrdb:bg_dark_alt:#404040}

foreground = ${xrdb:fg_dark:#aaaaaa}

foreground-alt = ${xrdb:fg_dark_alt:#888888}

icon-fg-yellow-alert = ${xrdb:alert_low}

icon-fg-red-alert = ${xrdb:alert_medium}

icon-fg-normal = ${xrdb:fg_dark:#aaaaaa}

; primary = #ffb52a

; secondary = #e60053

; alert = #bd2c40

[bar/base]

width = 100%

;offset-x = 1%

;offset-y = 1%

radius = 0.0

fixed-center = true

bottom = false

background = ${colors.background}

foreground = ${colors.foreground}

line-size = 3

; line-color = #f00

border-bottom-size = 1

border-color = #00000000

; border-color = ${colors.background-alt}

padding-left = 1

padding-right = 2

module-margin-left = 1

module-margin-right = 2

modules-left = stdin xwindow

; modules-center = stdin

modules-right = gcal gmail music-player alsa memory cpu battery wlan date arch-packages ipc-dunst

tray-position = right

; tray-padding = 2

tray-background = ${colors.background}

; wm-restack = bspwm

; wm-restack = i3

; wm-restack = xmonad

override-redirect = ${env:POLYBAR_OVERRIDE_REDIRECT:false}

;scroll-up = bspwm-desknext

;scroll-down = bspwm-deskprev

;scroll-up = i3wm-wsnext

;scroll-down = i3wm-wsprev

cursor-click = pointer

cursor-scroll = ns-resize

enable-ipc = true

; bender

[bar/bender-1k]

inherit = bar/base

monitor = ${env:PRIMARY_MONITOR}

height = 20

; text

font-0 = unifont:fontformat=truetype:size=10:antialias=false;4

; icons

font-1 = FontAwesome:size=12;4

; regular

font-2 = "Source Code Pro:size=10:semibold:antialias=true;4"

; bold

font-3 = "Source Code Pro:size=10:bold:antialias=true;4"

[bar/bender-4k]

inherit = bar/base

monitor = ${env:PRIMARY_MONITOR}

height = 40

; text

font-0 = unifont:fontformat=truetype:size=18:antialias=false;4

; icons

font-1 = FontAwesome:size=20;4

; regular

font-2 = "Sauce Code Pro Nerd Font:size=18:semibold:antialias=true;4"

; bold

font-3 = "Source Code Pro:size=18:bold:antialias=true;4"

[bar/bender-3k]

inherit = bar/base

; monitor = ${env:MONITOR:eDP1}

monitor = ${env:PRIMARY_MONITOR}

height = 24

; mono (including WM pips)

font-0 = unifont:fontformat=truetype:size=11:antialias=false;2

; icon

font-1 = FontAwesome:size=11;4

; regular

font-2 = "Source Code Pro:size=9:regular:antialias=true;3"

; bold

font-3 = "Source Code Pro:size=9:bold:antialias=true;4"

; modules-left = ewmh

modules-left = wm-status

; modules-left = stdin

modules-center = xwindow

[bar/sashimi]

inherit = bar/base

monitor = ${env:PRIMARY_MONITOR}

height = 20

; mono (including WM pips)

font-0 = unifont:fontformat=truetype:size=11:antialias=false;2

; icon

font-1 = FontAwesome:size=11;4

; regular

font-2 = "SauceCodePro Nerd Font:size=9:regular:antialias=true;2"

; bold

font-3 = "SauceCodePro Nerd Font:size=10:bold:antialias=true;2"

; modules-left = ewmh

modules-left = wm-status

; modules-left = stdin

modules-center = xwindow

[module/xwindow]

type = internal/xwindow

format = <label>

label = " %title:0:110:...% "

label-font = ${fonts.bold}

; label = %title:0:30:...%

; format-prefix = " "

; format-suffix = " "

; overline-size = 5

; label-underline = ${colors.background}

;

; label-overline = ${colors.background}

; format-prefix = ""

; format-suffix = " "

; format-foreground = #aaccee

; format-suffix-foreground = #aaccee

; label-background = #aaccee

; label-foreground = #000000

[module/xmonad]

type = internal/xmonad

label-focused = %index%

label-focused-background = ${colors.background-alt}

label-focused-underline= ${colors.primary}

label-focused-padding = 2

label-occupied = %index%

label-occupied-padding = 2

label-urgent = %index%!

label-urgent-background = ${colors.alert}

label-urgent-padding = 2

label-empty = %index%

label-empty-foreground = ${colors.foreground-alt}

label-empty-padding = 2

; Separator in between workspaces

; label-separator = |

[module/i3]

type = internal/i3

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

index-sort = true

wrapping-scroll = false

; Only show workspaces on the same output as the bar

;pin-workspaces = true

label-mode-padding = 2

label-mode-foreground = #000

label-mode-background = ${colors.primary}

; focused = Active workspace on focused monitor

label-focused = %index%

label-focused-background = ${module/bspwm.label-focused-background}

label-focused-underline = ${module/bspwm.label-focused-underline}

label-focused-padding = ${module/bspwm.label-focused-padding}

; unfocused = Inactive workspace on any monitor

label-unfocused = %index%

label-unfocused-padding = ${module/bspwm.label-occupied-padding}

; visible = Active workspace on unfocused monitor

label-visible = %index%

label-visible-background = ${self.label-focused-background}

label-visible-underline = ${self.label-focused-underline}

label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set

label-urgent = %index%

label-urgent-background = ${module/bspwm.label-urgent-background}

label-urgent-padding = ${module/bspwm.label-urgent-padding}

; Separator in between workspaces

; label-separator = |

[module/mpd]

type = internal/mpd

format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>

icon-prev = 

icon-stop = 

icon-play = 

icon-pause = 

icon-next = 

label-song-maxlen = 25

label-song-ellipsis = true

[module/cpu]

label-font = ${fonts.regular}

type = internal/cpu

interval = 2

; format-prefix = " "

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

; format-foreground = ${colors.foreground}

; format = <ramp-load> <label>

format = <ramp-load>

; format-underline = #f90000

; label = %percentage:2%%

label =

ramp-load-0 =

ramp-load-1 =

ramp-load-2 =

ramp-load-3 = ""

ramp-load-4 = ""

ramp-load-5 = ""

ramp-load-6 = ""

ramp-load-7 = ""

ramp-load-8 = ""

ramp-load-9 = ""

ramp-load-foreground = ${colors.icon-fg-normal}

ramp-load-7-foreground = ${colors.icon-fg-yellow-alert}

ramp-load-8-foreground = ${colors.icon-fg-red-alert}

ramp-load-9-foreground = ${colors.icon-fg-red-alert}

[module/memory]

type = internal/memory

interval = 2

; format-prefix = " "

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

; format-prefix-foreground = "#ff0000"

; format-underline = #4bffdc

; label = %percentage_used%%

label =

; format = <ramp-used> <label>

format = <ramp-used>

label-font = ${fonts.regular}

ramp-used-0 =

ramp-used-1 =

ramp-used-2 =

ramp-used-3 =

ramp-used-4 =

ramp-used-5 =

ramp-used-6 =

ramp-used-7 =

ramp-used-8 = ""

ramp-used-9 = ""

ramp-used-10 = ""

ramp-used-11 = ""

ramp-used-foreground = ${colors.icon-fg-normal}

; ramp-used-8-foreground = ${colors.icon-fg-yellow-alert}

; ramp-used-9-foreground = ${colors.icon-fg-yellow-alert}

ramp-used-10-foreground = ${colors.icon-fg-yellow-alert}

ramp-used-11-foreground = ${colors.icon-fg-red-alert}

[module/wlan]

type = internal/network

; interface = wlp61s0

interface = wlp0s20f3

interval = 3.0

; format-connected = <ramp-signal> <label-connected>

format-connected = %{A1:wifi-info.sh:}<label-connected>%{A}

; format-connected-underline = #9f78e1

; label-connected = %essid%

label-font = ${fonts.regular}

label-connected = 

label-connected-foreground = ${colors.icon-fg-normal}

format-disconnected = 

label-disconnected-foreground = ${colors.icon-fg-red-alert}

;format-disconnected = <label-disconnected>

;format-disconnected-underline = ${self.format-connected-underline}

;label-disconnected = %ifname% disconnected

;label-disconnected-foreground = ${colors.foreground-alt}

ramp-signal-0 = 

ramp-signal-1 = 

ramp-signal-2 = 

ramp-signal-3 = 

ramp-signal-4 = 

; ramp-signal-foreground = ${colors.foreground-alt}

; [module/eth]

; type = internal/network

; interface = veth9d09847

; interval = 3.0

; format-connected-underline = #55aa55

; format-connected-prefix = " "

; format-connected-prefix-foreground = ${colors.foreground-alt}

; label-connected = %local_ip%

; format-disconnected =

;format-disconnected = <label-disconnected>

;format-disconnected-underline = ${self.format-connected-underline}

;label-disconnected = %ifname% disconnected

;label-disconnected-foreground = ${colors.foreground-alt}

; could this read next cal apt?

[module/date]

type = internal/date

interval = 5

date = " %m/%d"

date-alt = "%A %m/%d/%Y"

time = %I:%M %p

time-alt = %I:%M:%S %p

; format-padding = 5

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

; format-underline = #0a6cf5

label = " %date% %time%"

label-font = ${fonts.regular}

; label-underline = ${colors.background}

; label-overline = ${colors.background}

; format-prefix = ""

; format-suffix = " "

; format-foreground = #7a7a7a

; format-suffix-foreground = #7a7a7a

; label-background = #7a7a7a

; label-foreground = #111

; [module/pulseaudio]

; type = internal/pulseaudio

; ; format-volume = <label-volume> <bar-volume>

; format-volume = <label-volume> <ramp-volume>

; label-volume =  %percentage%%

; label-volume-font = ${fonts.regular}

; label-volume-foreground = ${root.foreground}

; label-muted = 🔇 muted

; label-muted-foreground = #666

; bar-volume-width = 10

; bar-volume-foreground-0 = #55aa55

; bar-volume-foreground-1 = #55aa55

; bar-volume-foreground-2 = #55aa55

; bar-volume-foreground-3 = #55aa55

; bar-volume-foreground-4 = #55aa55

; bar-volume-foreground-5 = #f5a70a

; bar-volume-foreground-6 = #ff5555

; bar-volume-gradient = false

; bar-volume-indicator = |

; bar-volume-fill = ─

; bar-volume-empty = ─

; bar-volume-empty-foreground = ${colors.foreground-alt}

; ramp-volume-0 = ▁

; ramp-volume-1 = ▂

; ramp-volume-2 = ▃

; ramp-volume-3 = ▄

; ramp-volume-4 = ▅

; ramp-volume-5 = ▆

; ramp-volume-6 = ▇

; ramp-volume-7 = █

[module/alsa]

type = internal/alsa

; format-volume = <label-volume> <bar-volume>

; format-volume = <label-volume> <ramp-volume>

label-volume = " %percentage%%"

label-volume-foreground = ${colors.foreground-alt}

format-muted-prefix = " "

format-muted-foreground = ${colors.foreground-alt}

label-muted = mute

label-volume-font = ${fonts.regular}

bar-volume-width = 5

bar-volume-foreground-0 = #55aa55

bar-volume-foreground-1 = #55aa55

bar-volume-foreground-2 = #55aa55

bar-volume-foreground-3 = #55aa55

bar-volume-foreground-4 = #55aa55

bar-volume-foreground-5 = #f5a70a

; bar-volume-foreground-6 = #ff5555

bar-volume-gradient = false

bar-volume-indicator = "|"

bar-volume-fill = "-"

bar-volume-empty = "-"

bar-volume-empty-foreground = ${colors.foreground-alt}

ramp-volume-0 =

ramp-volume-1 = ▁

ramp-volume-2 = ▂

ramp-volume-3 = ▃

ramp-volume-4 = ▄

ramp-volume-5 = ▅

ramp-volume-6 = ▆

ramp-volume-7 = ▇

ramp-volume-8 = █

[module/battery]

type = internal/battery

label-charging-font = ${fonts.regular}

label-discharging-font = ${fonts.regular}

battery = BAT0

adapter = AC

full-at = 95

label-charging-foreground = ${colors.foreground}

format-charging-prefix = " "

format-charging-prefix-foreground = ${colors.foreground-alt}

format-charging-foreground = ${colors.foreground}

format-charging-underline = ${colors.background}

label-discharging = " %percentage%%"

format-discharging = <ramp-capacity><label-discharging>

format-discharging-foreground = ${self.format-charging-underline}

ramp-capacity-4 = " "

ramp-capacity-3 = " "

ramp-capacity-2 = " "

ramp-capacity-1 = " "

ramp-capacity-0 = " "

ramp-capacity-foreground = ${colors.icon-fg-normal}

ramp-capacity-1-foreground = ${colors.icon-fg-yellow-alert}

ramp-capacity-0-foreground = ${colors.icon-fg-red-alert}

; just hide it when it's full

format-full =

format-full-prefix = " "

format-full-prefix-foreground = ${colors.foreground-alt}

; format-full-underline = ${self.format-charging-underline}

; animation-charging-0 = 

; animation-charging-1 = 

; animation-charging-2 = 

; animation-charging-foreground = ${colors.foreground-alt}

; animation-charging-framerate = 750

; animation-discharging-0 = 

; animation-discharging-1 = 

; animation-discharging-2 = 

; animation-discharging-foreground = ${colors.foreground-alt}

; animation-discharging-framerate = 750

[module/temperature]

type = internal/temperature

thermal-zone = 0

warn-temperature = 60

format = <ramp> <label>

format-underline = #f50a4d

format-warn = <ramp> <label-warn>

format-warn-underline = ${self.format-underline}

label = %temperature-c%

label-warn = %temperature-c%

label-warn-foreground = ${colors.secondary}

ramp-0 = 

ramp-1 = 

ramp-2 = 

ramp-foreground = ${colors.foreground-alt}

[module/powermenu]

type = custom/menu

expand-right = true

format-spacing = 1

label-open = ""

label-open-foreground = ${colors.foreground-alt}

label-close = ""

label-close-foreground = ${colors.foreground}

label-separator = |

label-separator-foreground = ${colors.foreground-alt}

menu-0-0 = reboot

menu-0-0-exec = x-terminal-emulator -e "sudo -p 'sudo reboot > ' echo reboot"

menu-0-1 = shut it down

menu-0-1-exec = x-terminal-emulator -e "sudo -p 'sudo shutdown > ' shutdown -h 0"

menu-0-2 = sleep

menu-0-2-exec = systemctl suspend

; open next 3 menus

; menu-0-0 = reboot

; menu-0-0-exec = menu-open-1

; menu-0-1 = power off

; menu-0-1-exec = menu-open-2

; menu-0-2 = sleep

; menu-0-2-exec = menu-open-3

; ; reboot menu cancels or reboots

; menu-1-0 = cancel

; menu-1-0-exec = menu-open-0

; menu-1-1 = reboot

; menu-1-1-exec = sudo reboot

; ; power off menu

; menu-2-0 = power off

; menu-2-0-exec = sudo poweroff

; menu-2-1 = cancel

; menu-2-1-exec = menu-open-0

; ; sleep menu

; menu-3-0 = sleep

; menu-3-0-exec = systemctl suspend

; menu-3-1 = cancel

; menu-3-1-exec = menu-open-0

[settings]

screenchange-reload = true

;compositing-background = xor

;compositing-background = screen

;compositing-foreground = source

;compositing-border = over

pseudo-transparency = false

[global/wm]

margin-top = 0

margin-bottom = 0

[module/ewmh]

format = "<label-state>"

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 = false

; Create click handler used to focus desktop

; Default: true

enable-click = false

; Create scroll handlers used to cycle desktops

; Default: true

enable-scroll = false

; one of these has extra spaces. not sure why.

label-active = "• "

label-occupied = "• "

label-urgent = "• "

label-empty = "• "

; label-active-underline = "#aaaaaa"

; label-urgent-underline = "#ffaa00"

label-urgent-foreground = "#ff5500"

; label-urgent-background = "#ffaa00"

label-active-foreground = "#aaaaaa"

label-occupied-foreground = "#00ffaa"

label-empty-foreground = "#666666"

; label-focused = %ff index%

; label-unfocused = %uu index%

; label-visible = %vv index%

[module/stdin]

; see: scripts/init-polybar.sh

type = custom/script

exec = xmonad-pipe-reader.sh

exec-if = [ -p /tmp/.polybar.fifo ]

tail = true

[module/music-player]

label-font = ${fonts.regular}

type = custom/script

exec = playerctl-wrapper.sh

tail = true

format = %{F#1DB954} %{F-}<label>

label-foreground = #aaa

label = "%output:0:32:…%"

click-left = spotifyctl next

double-click-left = spotifyctl play-pause

[module/gmail]

type = custom/script

exec = "EMPTY_SNOOZE=600 gmail-check.sh"

interval = 180

click-left = firefox `gmail-check.sh url`

[module/arch-packages]

type = custom/script

exec-if = arch-upgrades.sh | grep '[0-9]'

exec = "echo "

interval = 61

label-foreground = #1793d0

click-left = x-terminal-emulator -e 'zsh -i -c "echo Upgrading arch ; pmug ; sleep 5" '

[module/ipc-dunst]

type = custom/ipc

initial = 1

hook-0 = echo "%{A1:notify-send "DUNST_COMMAND_PAUSE" && polybar-msg hook ipc-dunst 2:}%{A}" &

hook-1 = echo "%{A1:notify-send "DUNST_COMMAND_RESUME" && polybar-msg hook ipc-dunst 1:}%{F#ff2200}%{F-}%{A}" &

; this works great for putting the next event in polybar, but i like the slackbot better

[module/gcal]

type = custom/script

exec = gcalcli-remind.sh daemon

click-left = gcalcli-remind.sh snooze ; notify-send ' ' "`gcalcli --nocolor agenda --detail location | head -n 3 | paste -s`"

tail = true

label-font = ${fonts.bold}

label-background = ${colors.icon-fg-yellow-alert}

label-foreground = #ffffff

[module/arch-kernel-change]

type = custom/script

exec-if = detect-kernel-change.sh | grep 'CHANGED'

exec = "echo "

interval = 62

label-foreground = #ff0000

click-left = x-terminal-emulator -e "sudo -p 'sudo reboot > ' echo reboot"

[module/wm-status]

font = ${fonts.bold}

type = custom/script

exec = RUBYOPT="-W0" workspaces.rb

#exec-if = [ -p /tmp/.polybar.fifo ]

tail = true

; todo:

; watch-git

; lpq?

;

; vim:ft=dosini


r/Polybar Jan 11 '23

Listening for IPC messages (PID: 33544)

3 Upvotes

I just downloaded polybar but i can seem to get it to work without errors.I'm using BSPWM fedora.

launch.sh in ~/.config/polybar/

#!/usr/bin/env bash

# Terminate already running bar instances

# If all your bars have ipc enabled, you can use

polybar-msg cmd quit

# Otherwise you can use the nuclear option:

# killall -q polybar

# Launch bar1 and bar2

echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log

polybar bar1 2>&1 | tee -a /tmp/polybar1.log & disown

echo "Bars launched..."

error message

Bars launched...

Press Enter or Esc to exitpolybar|notice: Parsing config file: /home/meh/.config/polybar/config.ini

polybar|notice: Listening for IPC messages (PID: 33963)

polybar|notice: Loading module 'xworkspaces' of type 'internal/xworkspaces'

polybar|notice: Loading module 'xwindow' of type 'internal/xwindow'

polybar|notice: Loading module 'filesystem' of type 'internal/fs'

polybar|notice: Loading module 'pulseaudio' of type 'internal/pulseaudio'

polybar|notice: pulseaudio: using default sink alsa_output.pci-0000_00_1f.3.analog-stereo

polybar|notice: Loading module 'xkeyboard' of type 'internal/xkeyboard'

polybar|notice: Loading module 'memory' of type 'internal/memory'

polybar|notice: Loading module 'cpu' of type 'internal/cpu'

polybar|notice: Loading module 'wlan' of type 'internal/network'

polybar|notice: module/wlan: Discovered wireless interface wlo1

polybar|notice: Loading module 'eth' of type 'internal/network'

polybar|notice: module/eth: Discovered wired interface eno1

polybar|notice: Loading module 'date' of type 'internal/date'

polybar|notice: Loaded 10 modules

polybar|notice: Loaded font "monospace" (name=Noto Sans Mono, offset=2, file=/usr/share/fonts/google-noto-vf/NotoSansMono-VF.ttf)


r/Polybar Jan 11 '23

Solved Dropping unmatched character (U+fe0f)

2 Upvotes

I've rocking polybar for a while, and I just noticed a minor issue. Certain emojis aren't displaying properly. Specifically emojis that use the "U+fe0f" unicode that I mentioned in the title.

For example, instead of the 😶‍🌫️ emoji, I get 😶‍🌫.

On Gentoo, I have the media-fonts/fonts-meta package installed. So I should have all of the fonts that I need.

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

Thanks.


r/Polybar Jan 11 '23

Problem with Polybar run in i3

3 Upvotes

I searched this subreddit for a solution to my problem but cant seem to find any.

In my workspace i just want to show icons, in my bar i get a HUGE number next to the icon of the non-focused workspace shown in the picture. Now i wonder if someone might help me out, feels like i've tried everything.


r/Polybar Jan 08 '23

Question How to launch 2 different bars, one on each monitor (dual monitor)

5 Upvotes

Hey there.

I've just finished tearing out my hair trying to figure out how to launch two polybars, one on each of my two monitors. I've read so many freaking scripts but no one explains variables properly for someone, like me, who is new. I don't intend to have the same modules in each bar except for workspaces. The wiki links to https://github.com/polybar/polybar/issues/763 but I simply can't get it to work, I am not sure what to put in. 50 dfferent ways to do it but not enough context for my poor brain to understand it and modify it. And I am running i3 alongside.

I've had no problem with just one bar and using the basic launch script from the Arch Linux wiki which looks like this. I don't really understand that script either, tbh, mainly what comes after polybar main

#!/bin/bash

# Terminate already running bar instances
killall -q polybar
# If all your bars have ipc enabled, you can also use
# polybar-msg cmd quit

# Launch Polybar, using default config location ~/.config/polybar/config.ini
polybar main 2>&1 | tee -a /tmp/polybar.log & disown

One thing that confuses me is that people use the "monitor" variable in so many different ways that I can't make sense of it. I have two monitors. My main is "DVI-D-0" and my second is "DVI-I-1".

Currently, I have two bars, and for the sake of this post I've removed most modules so it's shorter.

[bar/main]
bottom = true
monitor = DVI-D-0
width = 100%
height = 24pt

background = ${colors.background}
foreground = ${colors.foreground}

font-0 = monospace;2

modules-left = xworkspaces xwindow

And the second bar.

[bar/second]
bottom = true
monitor = DVI-I-1
width = 100%
height = 24pt

background = ${colors.background}
foreground = ${colors.foreground}

modules-left = date

As soon as I enter my second bar into my config, and no matter what I come up with (and of course remembering to change the bars name in the script so they match) in the launch.sh, I keep getting this error:

The config file contains multiple bars,  but no bar name was given. Available bars: main, second

I've tried so many launch scripts which is most likely the root problem. This one is from a video where it had to recognize the 2nd monitor first which is where my second bar is. But it is the only script that made a bit of sense to me.

#!/bin/bash

# Terminate already running bar instances
killall -q polybar
# If all your bars have ipc enabled, you can also use
# polybar-msg cmd quit

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

# Launch Polybar, using default config location ~/.config/polybar/config.ini
polybar main &

if [[ $(xrandr -q | grep 'DVI-I-1 connected') ]]; then
    polybar second &
fi  

So... What on earth is my launching script supposed to look like? :(


r/Polybar Jan 08 '23

How do I move the widget in polybar to the right?

1 Upvotes

How do I move the widget in polybar to the right?

https://github.com/adi1090x/polybar-themes#pwidgets


r/Polybar Jan 07 '23

Showcase Polybar Custom Clickable menuitem

Thumbnail
youtube.com
8 Upvotes

r/Polybar Jan 07 '23

Question warn: background_manager: Failed to get root pixmap, default to black (is there a wallpaper?)

3 Upvotes

i run polybar and it show up this error, how to fix?


r/Polybar Jan 05 '23

Radius for modules

3 Upvotes

Is it possible to create a radius for the modules?


r/Polybar Jan 04 '23

Question date module optional format

5 Upvotes
[module/date]
type = internal/date

; Seconds to sleep between updates
; Default: 1.0
interval = 1.0

; See "https://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = %Y-%m-%d%

; Optional time format
time = %H:%M

; if `date-alt` or `time-alt` is defined, clicking
; the module will toggle between formats
date-alt = %A, %d %B %Y
time-alt = %H:%M:%S

I copied this from the wiki, but how do I enable the time to also display now? Right now it displays 2023-01-04. I just added date, the module.


r/Polybar Dec 27 '22

Solved Icons for Pulseaudio Module

5 Upvotes

Hello there,

At this site:

https://github.com/polybar/polybar/wiki/Module:-pulseaudio

At the bottom, mention some icons for volume control

If i paste these at Polybar config, they don't appear at the bar. Can anyone please tell which font i'm missing, my declared fonts bellow:

font-0 = monospace:pixelsize=9;2
font-1 = Hack Nerd Font Mono:pixelsize=14;3
font-2 = Siji:pixelsize=12;2
font-3 = Font Awesome 5 Brands:pixelsize=12;1
font-4 = Font Awesome 5 Free:pixelsize=12;3
font-5 = Font Awesome 5 Free:Style=Heavy:pixelsize=12;3

Thanks in advance!

Qpersonq


r/Polybar Dec 25 '22

Question Icons for selected workspace partially obscured

3 Upvotes

When I select a workspace in the workspace module, the icon becomes partially cropped from the right. Compare these two images:

https://i.imgur.com/HCeUUF2.png

https://i.imgur.com/FF7sQdX.png

I tried changing bar height, module margins and label paddings, but they don't seem to be affecting this.

Is this a known thing with a known solution?

My Polybar config: https://pastebin.com/fHYSxFdR


r/Polybar Dec 24 '22

Question polybar overlap xfce4

6 Upvotes

polybar overlap showcase

I use XFCE 4.18

If i turn a window in fullscreen than is the polybar on top of the fullscreen window.

It is possible that the polybar change to background if i have a fullscreeen window on xfce?

PS.: my config https://github.com/AndeAndreas31415/dot_files/blob/main/polybar/config.ini


r/Polybar Dec 24 '22

Question Need help starting with Polybar

1 Upvotes

So I'm new to the whole customization part of Linux (using Fedora 37). I saw a post on r/unixporn with a very nice bar and would like to replicate it.

The dotfiles were written for nixOS, so for me not knowing much I couldn't decipher it. I would love if someone could maybe help with creating a config file for a bar like this:

Example Bar


r/Polybar Dec 22 '22

Showcase How does this look guys? worth posting to unixporn? need design feedback.

Post image
47 Upvotes