Open parthsharma1996 opened 5 years ago
I've been thinking about the very same blocklet, with very same hint (Google). The hard part, I think, is that the script should access the blocklet state when you click on it. E.g. when the timer is paused and you click on it to resume/start it, the script should first retrieve the current blocklet state (=text shown), and then start running. And... Oh, I'm just reasoning about it. Take what I've written so far for what it is 🤣
Another thought: you want the blocklet to be updated with a high frequency (at least once per second, like the clock, or quicker if you want the decimals), and you don't want it to refresh (at all) when it's paused. But the command is scheduled through the interval property; how would you change that dynamically?
This is definitely possible if one of you would like to try your hand at it. You will need to use format=json
and interval=persist
and loop over a read -t
statement. Persistent blocks get click info through stdin so that's why you will need to be using read
.
You will need? Is json a necessary condition to give shape to this idea? I ask this because the only json I can write something sensible about has one more letter in it and comes out of Crystal lake... Oh, BTW, @kb100, could you please give a look at the upgrade to rofi calendar? 😇
Well, for the block to be fully functional I think you would need json, since normal and pango formatted blocks only receive the block button to stdin and no other information (click location, click modifiers, etc.). I guess a stopwatch could be fully functional with just the button, but I would imagine a timer block or combined timer/stopwatch to need more. If you come up with something nice that doesn't use json that's fine by me!
@kb100 , I think I'm finding a way :smiley:
Hi, I wanted to have a stopwatch and a countdown timer in my
i3bar
so that I can track time for various things. After a lot of googling I couldn't really find ani3blocks
script that could do that.The functionality I am looking for is something similar to the stopwatch/timer applet that appears when you google "stopwatch" (which I currently use for my purposes)
Thanks!