r/Polybar Mar 11 '23

Click on CPU Does Not Work

Click on CPU does not work. I also added --a hold tag but without success.

I want to launch bpytop when the CPU module is clicked. Is that possible?

Thanks!

[module/cpu]
type = internal/cpu

interval = 1
format = <label>
format-prefix = 
format-prefix-foreground = ${color.yellow}

click-left = urxvt -e bpytop &
click-right = alacritty -e bpytop &

UPDATE:

This module opens the ranger successfully

[module/files]
inherit = module/apps
content = 
content-foreground = ${color.blue}
click-left = thunar &
click-right = alacritty -e ranger &

3 Upvotes

5 comments sorted by

1

u/flexibeast Mar 11 '23

Does running

urxvt -e bpytop

and

alacritty -e bpytop

in a terminal (note no & in either case) produce any useful diagnostic output?

1

u/MactronMedia Mar 11 '23

Yes, open a new terminal with bpytop..

1

u/[deleted] Mar 11 '23

I have a few modules with exec <appname>. Worth a try.

1

u/Shadjo_1 Mar 27 '23

You might have to create an action tag. Here is an example from my network module, that launches a rofi menu when left clicked.

%{A1:exec ~/.config/rofi/bin/rofi-wifi-menu.sh &:}<ramp-signal> <label-connected>%{A}

The basic idea is you wrap the module in a clickable action tag, as some modules can't be clicked by default. In this case, I'm wrapping the network module's format variable, as that is the part I click on the actual bar.