Replies: 7 comments 1 reply
-
I was about to come submit a question, but this sounds roughly like what I am trying to do. Custom module which dynamically changes its appearance somehow (I was thinking of whether its possible to change the set of active classes, and then style them differently with css). Will watch this issue with interest. |
Beta Was this translation helpful? Give feedback.
-
@hossbeast prefer when toggle with key-binding, the appearance on the waybar (custom module) will change the color or when it |
Beta Was this translation helpful? Give feedback.
-
I see Keybinding does not work for my case, the change I have in mind is not something initiated by the user (similar to how network connected -> disconnected is not initiated by the user, its just reacting to the state of the system) |
Beta Was this translation helpful? Give feedback.
-
@hossbeast your ideal might not work for my case, since i need an input to trigger (custom module) than only it will changing the state from on to off. Any how, you build it out, and i will tester it, to find out the outcome. :)) |
Beta Was this translation helpful? Give feedback.
-
You can use @thyeun Every 5 seconds this will check if If you still need this to trigger on keybind, you can do so with signals. e.g. in Sway: waybar/config"custom/recorder": {
"format": "{}",
"exec": "~/.config/waybar/scripts/recorder",
"return-type": "json",
"signal": 12,
"interval": 5, // execute script every n seconds; adjust as desired
} waybar/scripts/recorder#!/bin/sh
if pgrep -x wf-recorder >/dev/null; then
printf '{"text":" On-air","class":"enabled"}';
else
printf '{"text":" Off-air"}';
fi waybar/style.css#custom-recorder {
/* default module style */
}
#custom-recorder.enabled {
color: red;
} @hossbeast This might also be suitable for your case. You should be able to feed the module a custom format and CSS class for anything you can return via script. |
Beta Was this translation helpful? Give feedback.
-
@BoomerangNebula will try it out, and will feedback to you. thanks |
Beta Was this translation helpful? Give feedback.
-
Want to change the network icon color on click (vpn on/off). How do I trigger the enabled event? From style.css:
From config:
|
Beta Was this translation helpful? Give feedback.
-
Below are the code to appear the recording on-air and off-air. Stuck on the off-air part.
For the on-air part, once i trigger the keybinding of the recording, the
On-air
will appear withred color
on the waybar (this one working fine).The only part that cant possible to make it work, is the part
Off-air
, if not trigger by the keybinding of the recording. it should stay on the waybar withblack color
, instead that, it hide from the bar.Below are the code (config & style.css)
With recording triggering
Without/Stop recording triggering
Beta Was this translation helpful? Give feedback.
All reactions