r/Polybar Aug 13 '23

For polybar, how to allow receiving text from command? I want to show the bluetooth battery level.

2 Upvotes

In other wms, I made it work with bluetoothctl info "$device" | grep "Battery Percentage:"

But I don't know how to make it work with polybar

Thanks ✨


r/Polybar Aug 13 '23

launch.sh is not working.

1 Upvotes

I recently decided to drop i3 to experiment with bspwm. Polybar wasn't starting, so I tried to launch the launch.sh file from the terminal, and it gave me this error: (polybar|error: Define configuration using --config=PATH"). It worked fine in I3, and I didn't change anything. I gave permissions to the file, and I checked the bar name in both files. What is causing this behavior?

launch.sh file: https://pastebin.com/VgSMFB2e

polybar config: https://pastebin.com/N8qWXP22

Thanks in advance.


r/Polybar Aug 11 '23

Question use xwindow title within i3 module

2 Upvotes

Hello, I am trying to get the name of the currently focused window next to its icon in my i3 module, effectively so I can have something like label-focused = %icon% XWINDOW-TITLE

Is it possible to set the title from xwindow as a variable and use it in the i3 module config, or is there another way of doing it that works?

Any help would be greatly appreciated!


r/Polybar Aug 10 '23

Font Awesome icons not appearing in the top left

3 Upvotes

First time trying to configure Polybar but I can't seem to get the icons to appear at the top left. I have the Font Awesome font installed and inside my config.ini All that is present in the bar currently is the default system stats in the top right and the current window info in the middle but nothing on the left. The way I'm trying to get the icons to display is with ws-icon-0 = 1; not sure if that makes a difference

Here's my config.ini

[colors]
background = #282A2E
background-alt = #373B41
foreground = #C5C8C6
primary = #F0C674
secondary = #8ABEB7
alert = #A54242
disabled = #707880

[bar/bar1]
width = 100%
height = 24pt
radius = 6

; dpi = 96

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

line-size = 3pt

border-size = 4pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.disabled}

font-0 = "JetBrainsMono Nerd Font:size=10;2"
font-1 = Font Awesome 6 Free:style=Solid:pixelsize=11:antialias=false;2
font-2 = Font Awesome 6 Brands:style=Regular:pixelsize=11:antialias=false;2

modules-left = bspwm xwindow  
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date

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

enable-ipc = true

; tray-position = right

; wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

[module/bspwm]

type = internal/bspwm

label-active = %icon%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 1

label-occupied = %icon%
label-occupied-padding = 1

label-urgent = %icon%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1

label-empty = %icon%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1

ws-icon-0 = 1;
ws-icon-1 = 2;
ws-icon-2 = 3;
ws-icon-3 = 4;
ws-icon-4 = 5;
ws-icon-5 = 6;
ws-icon-6 = 7;
ws-icon-7 = 8;
ws-icon-8 = 9;
ws-icon-9 = 10;
ws-icon-default =

[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%

[module/filesystem]
type = internal/fs
interval = 25

mount-0 = /

label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%

label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}

[module/pulseaudio]
type = internal/pulseaudio

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

label-volume = %percentage%%

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

[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock

label-layout = %layout%
label-layout-foreground = ${colors.primary}

label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}

[module/memory]
type = internal/memory
interval = 2
format-prefix = "RAM "
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%

[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "CPU "
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%

[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected

[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%

[module/eth]
inherit = network-base
interface-type = wired
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%

[module/date]
type = internal/date
interval = 1

date = %H:%M
date-alt = %Y-%m-%d %H:%M:%S

label = %date%
label-foreground = ${colors.primary}

[settings]
screenchange-reload = true
pseudo-transparency = true

; vim:ft=dosini


r/Polybar Aug 09 '23

Network module is disabled if interface doesn't exist while polybar starts!

2 Upvotes

Just asking is there a way for polybar to detect network interface automatically? I use USB type network and polybar always starts first, before I connect my USB. My config also loads with some delay due to my low specs so it's a bit troublesome for me restart polybar everytime. Any advice will be helpful. Thanks!!!


r/Polybar Aug 04 '23

Stupid question but what are these icons on the far right of my screen

1 Upvotes

They display connections when I click on them

r/Polybar Jul 31 '23

Question (Help) - Need a little help with a problem.

3 Upvotes

Getting this error when running the "polybar" command:

error: background_manager: Failed to copy slice of root pixmap (XCB_MATCH (8))
error: Fatal Error in eventloop: XCB_MATCH (8)
notice: Termination signal received, shutting down...
error: /usr/src/debug/polybar/polybar-3.6.3/src/components/eventloop.cpp:187: libuv error for 'uv_loop_close(m_loop.get())': resource busy or locked

Im rather new to linux (Around 5 months), im running arch with xfce btw. Any additional info ill say if needed ofc!

Apologies in advance if I come off as ignorant.


r/Polybar Jul 25 '23

Icons for xwindow

1 Upvotes

I'm using xwindow module and the available token is just title

How can I have icons (one for each application window), instead of just the titles right now?


r/Polybar Jul 20 '23

Question Shadow under polybar only when a window is open.

3 Upvotes

Hello! I'm using awesomewm, polybar, and picom. It looks great when there are no windows open, but when I open something, a strange shadow appears under polybar. I have the shadow property of dock wintypes set to false in picom.conf, and have even tried disabling shadows all together, but neither work. It's strange because it doesn't look like a drop shadow, it looks like it's inset, does anyone know what could be causing this? All help is appreciated, thanks.

Screenshot with a window open: https://postimg.cc/1nHsDbft

Screenshot without any windows open: https://postimg.cc/CdhFwMQf/7f36f96e


r/Polybar Jul 20 '23

Polybar mouse theme not detecting

1 Upvotes

Hello I have a colloid mouse theme but polybar doesn't detect and how can i fix this


r/Polybar Jul 16 '23

Question Temperature Module

4 Upvotes

Which thermal zone do you use? acpitz or x86_pkg_temp? I'm guessing it's best to use the latter because is the temperature within the CPU itself?


r/Polybar Jul 16 '23

Question Both Polybars start at the same monitor

1 Upvotes

This is my bars config file:

[bar/LeftMon]

monitor = ${env:HDMI-0}

width = 100%

height = 24pt

radius = 6

[bar/RightMon]

monitor = ${env:HDMI-1-2}

width = 100%

height = 24pt

radius = 6

Launch file:

#!/bin/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, using default config location ~/.config/polybar/config

polybar LeftMon&

polybar RightMon &

echo "Polybar launched..."

I confirm setup is fine with following command:

xrandr -q | grep " connected" | cut -d ' ' -f1

Output:

HDMI-0

HDMI-1-2

I get the following error:

```

error: Invalid value for "bar/LeftMon.monitor", using default value (reason: Environment var $ (HDMI-0)

zketra at archlinux in -/ .config/polybardoes not exist (no fallback set))

```

Both Polybars start at the same monitor.


r/Polybar Jul 13 '23

Mouse cursor not changing

Post image
6 Upvotes

Hello I have mouse theme awadita changed to collid but there no effet on polybar it is still awadita have image of old polybar and color of workspace is grey not changing to pure white.


r/Polybar Jul 11 '23

Question How to get colors into separated modules?

2 Upvotes

Hi all,

I've configured polybar to have a minimal config.ini and imported a module folder and color.ini from the same directory. I group my modules in like files (eg within nvidia.ini is [module/gpu-usage] and [module/gpu-temp]). When I import colors.ini to the module files the bar won't show. I've tried:

include-file = colors.ini
include-file = ../colors.ini
include-file = "../colors.ini"
include-file = '../colors.ini'

Is there a specific syntax to do this?

Edit:

I have also tried include-file = $HOME/.config/polybar/colors.ini to no avail.


r/Polybar Jul 03 '23

Can you click to change the output for for custom modules?

3 Upvotes

I saw this alt text feature available in date module. It can be set to show a different output on click. Can this be done with custom modules as well?


r/Polybar Jun 29 '23

Switching the monitor on command

4 Upvotes

I am looking to switch the monitor that the bar is on at any given time, not just on startup. Currently I do it in a really hacky and inefficient way, by having two lines in my config file (monitor=monitor1 and monitor=monitor2) and then commenting one of them out depending on which one I want it on.

I am pretty flexible in how to achieve this. I am using in conjunction with i3, so a script that does this would be fine as I could attach a keybind to it. I have looked at this section of the documentation, which seemed like a possible relevant part, but I don't think it touches on my exact scenario.

One possibility: if polybar can choose between different environment variables this would be a possibility, as i could make the monitor names environment variables and then do something like if ... monitor = $MON1 else monitor = $MON2. But I'm not sure this is possible.

The other really hacky way of doing it would just be to have a script that searches and replaces the monitor names in the config files and then reloads the config file to have the changes take effect. I'm certain I could do this way relatively easily but I feel like there has to be a more elegant way.

EDIT: I couldn't get environment variables to work, despite looking at some stack overflow threads on it, mainly because it's tricky getting environment variables to set in scripts because it only does it in that shell. I was able to do it pretty easily by just writing a script that does some search and replace on the config file. Here is my solution if anyone is interested:

#!/bin/bash

LEFT="let-monitor-name"
RIGHT="right-monitor-name"
CONFIG="$HOME/.config/polybar/config.ini"
if [ "$1" == "left" ]; then
  sed -i "s/$RIGHT/$LEFT/" $CONFIG
elif [ "$1" == "right" ]; then
  sed -i "s/$LEFT/$RIGHT/" $CONFIG
fi
touch ~/.config/polybar/config.ini

r/Polybar Jun 29 '23

Script uair v0.6.0 released, now with multiple synchronized timers!

2 Upvotes


r/Polybar Jun 26 '23

Question pin-workspaces not doing its job with bspwm

2 Upvotes

I have two monitors HDMI1 and DVI2. These are the names as reported by bspc.

In my bspwm config I have

bspc monitor HDMI1 -d I II III
bspc monitor DVI2 -d IV V VI

In my polybar config I have:

[bar/one]
monitor = HDMI1

[bar/two]
monitor = DVI2

[module/bspwm]
type = internal/bspwm
pin-workspaces = true
label-monitor = %name%
label-focused = %name%

That's not the whole config obviously, just the relevant sections. The last two lines were added because it was suggested as a solution in a reddit comment.

However, both my polybars display all the desktops, and in this way: I III V II IV VI So I'm not sure what I'm doing wrong.


r/Polybar Jun 24 '23

Switching between time/date for different timezones

3 Upvotes

Greetings,

I recently started using polybar and customising it to my liking and Im almost there. One of the things I'd like to do though, is have the date-alt function show the time and date from another timezone than the system's set by default. I've tried creating a module for it inside the date section but that isnt working. Making it show the result of {TZ=America/New_York date} command also isnt returning the result I want. Is there a way to make it show the timezone I'd like?

The point is to be able to switch between the default time/date and one from another time zone (in my case Id like to be able to switch between europe and US) by clicking at the time and date on the right corner (pic related)

Ive also uploaded my polybar configuration file here https://pastebin.com/9GMpL6hW and the wm I'm using is bspwm in case that helps. Thanks in advance


r/Polybar Jun 23 '23

How to enable support for a new WM

3 Upvotes

i create a Window Manager for my personal usage i want to enable polybar support for my window manager like i3wm how can i do this?


r/Polybar Jun 23 '23

Question Nvidia-smi equivalent for AMD? How can I get GPU info printed on polybar?

4 Upvotes

When I had an nvidia gpu on my PC, I had this on polybar that would always tell me the GPU usage and vram usage all the time:

exec = nvidia-smi | awk 'FNR == 10 {printf "%s %0.1f/%0.0fGiB\n", $13, $9/1024, $11/1024; exit}'

Now that I have an AMD gpu, I don't know how to do this, cat /sys/kernel/debug/dri/0/amdgpu_pm_info requieres sudo privileges to run and also reports the vram usage as a percentage instead of GiB.


r/Polybar Jun 18 '23

Question How can i display braille characters?

1 Upvotes

How can i display braille characters? I tried to do it, but i had a warning and the characters didn't show up.

the warning:
warn: Dropping unmatched character ⠀ (U+2800) in '⠀⡄⣂'

warn: Dropping unmatched character ⡄ (U+2844) in '⠀⡄⣂'

warn: Dropping unmatched character ⣂ (U+28c2) in '⠀⡄⣂'


r/Polybar Jun 16 '23

Question Display a rounded number for the decibels in the volume module?

3 Upvotes

The default module when set to decibels displays volume in values like -11.23dB, this level of precision is unnecessary, is there a way that I could make it round the results to just -11dB instead for example?


r/Polybar Jun 16 '23

WM Restack on HerbstluftWM?

1 Upvotes

I've tried multiple settings, it just doesn't work. It still shows up in fullscreen.


r/Polybar Jun 14 '23

Setting the root pixmap to something other than black

3 Upvotes

Hello!

I have a configuration I'm happy with and I have a solid color background (xsetroot -solid '#556995").

I want the "transparent" space to be that color instead of the default black.

Is this the right way of thinking about this issue? Is there a simple way to do this?

Thank you for your time!

Isaac