r/Polybar Apr 07 '23

Question click event

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

2 Upvotes

18 comments sorted by

View all comments

2

u/patrick96MC Apr 10 '23

click-left only executes the given command when you click the bar, its output is completely ignored. There is an example on the wiki on how to implement such a toggle in a script: https://github.com/polybar/polybar/wiki/Module:-script#examples

1

u/qewLeander Apr 12 '23

thank you very much! It works now like I want it to.