# Pomodoro Timer for Streamdeck

**URL:** <https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814>\
**Category:** Configuration Help & General Discussion\
**Tags:** question, stream-deck\
**Created:** [October 19, 2022, 9:08pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814 "2022-10-19T21:08:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [October 19, 2022, 9:08pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/1 "2022-10-19T21:08:09Z")

</div>

Hi!  
New (kinda) user here, longtime keyboard maestro user. The stream deck control has made me start digging in a bit more.

I can see timers for the touch bar, can they just be transferred to the SD? Otherwise, any tips on setting up a Pomo timer?

Cheers!

Edit: Added Stream Deck tag

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 19, 2022, 9:18pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/2 "2022-10-19T21:18:08Z")

</div>

Do without. You're supposed to work when you're in the flow and stop when the flow ends or your girlfriend/boyfriend gets annoyed. Tomatoes can't help you there. Just sayin'... 🙂

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [October 19, 2022, 9:28pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/3 "2022-10-19T21:28:51Z")

</div>

Ok, how about an egg timer for my eggs? 😉

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 19, 2022, 9:37pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/4 "2022-10-19T21:37:47Z")

</div>

I don't know your eggs 😂 But I know how people function and I promise you that you don't need tomatoes or eggs to be productive.

Seriously, I unfortunately do not know how to set your pomo timer.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [October 19, 2022, 9:42pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/5 "2022-10-19T21:42:35Z")

</div>

Can you explain what exact functionality you'd need?  
Timers should be easy to do (very similar to Touch Bar), is a Pomodoro timer something special?

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 19, 2022, 9:44pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/6 "2022-10-19T21:44:39Z")

</div>

Oh, you don't know the famous (and useless) Pomodoro technique?

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [October 19, 2022, 9:46pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/7 "2022-10-19T21:46:05Z")

</div>

Nah my mindset while working is pure chaos, I can't work with anything that brings structure 😃

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 19, 2022, 9:50pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/8 "2022-10-19T21:50:01Z")

</div>

Pomodoro means simplified, work a certain amount of time, then take a 25 minute break, then work again....and so on.

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [October 19, 2022, 9:52pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/9 "2022-10-19T21:52:26Z")

</div>

Ok so you'll need a timer where you can specify multiple time slots and maybe different colors?

Like 10 minute timer (working) =\> Widget is red  
15 minute timer (pause) =\> Widget is blue

and so on?

I can post some example for that tomorrow, it can be done using a script widget.

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 19, 2022, 9:55pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/10 "2022-10-19T21:55:31Z")

</div>

In fact, it's more complicated than that. Pomodoro suggests that the working periods become shorter from cycle to cycle, while the breaks, conversely, become longer and longer.

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [October 19, 2022, 10:08pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/11 "2022-10-19T22:08:55Z")

</div>

Hey @Andreas_Hegenberg!

@Frank1 is probably right about the famous pomodoro technique, but I would love a timer, and the version I'm familiar with is pretty simple, like what you suggested:

25 minute timer (working 1) =\> Widget is red  
5 minute timer (pause 1) =\> Widget is blue  
25 minute timer (working 2) =\> Widget is red  
5 minute timer (pause 2) =\> Widget is blue  
25 minute timer (working 3) =\> Widget is red  
5 minute timer (pause 3) =\> Widget is blue  
25 minute timer (working 4) =\> Widget is red  
15 minute timer (pause 4) =\> Widget is blue.

I had one on the SD but hitting the button paused the timer, whereas the functionality I would be looking for ideally would be that at the end of the timer an alarm would go off, then wait for me to hit it again to progress to the next stage. And if I pressed the button before the time had passed, it would progress to the next stage. Fancy extra's would be choosing your own alarm sound and a long press to pause/unpause, but hey, I'm dreaming here.

Admittedly, I've made it more complicated. Even a single 25min / 5 min timer would be great, or even one button for 25mins and one button for 5 mins.

I'm curious as to whether someone with little coding experience could take a touchbar timer and convert for SD, or is it a bit trickier than that.

I'm away for the night, thanks for the response and the app, it's bringing my SD to life. (Though I have been using a few simple BTT trackpad shortcuts for years now, they are second nature now).

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 19, 2022, 10:25pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/12 "2022-10-19T22:25:12Z")

</div>

I wish you a good night 😃

![image](https://community.folivora.ai/uploads/default/original/3X/0/8/08c75ba0ef4c4598d1943beb7f2316e8f364a370.jpeg)

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [October 20, 2022, 5:17pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/13 "2022-10-20T17:17:21Z")

</div>

So of course I forgot the most gadgety element. The timer counting down on the steam deck.

If nothing else, it's cool.

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [October 31, 2022, 5:58pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/14 "2022-10-31T17:58:41Z")

</div>

Hey!  
Any suggestions on where I should look to try to get a timer? 😃  
Or how I should learn to transform a Touch Bar script into a SD script?

---

<div class="post-metadata">

**Author:** ![Frank1](https://community.folivora.ai/letter_avatar_proxy/v4/letter/f/a87d85/32.png) [@Frank1](https://community.folivora.ai/u/Frank1)\
**Post date:** [October 31, 2022, 9:39pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/15 "2022-10-31T21:39:47Z")

</div>

You might want to give Tomighty a try.  
 ![image](https://community.folivora.ai/uploads/default/original/3X/4/b/4b59cd8e71d3ff8dcf0aec1555db46600af9332b.png)  
This slightly older free menubar app still works well.

 ![image](https://community.folivora.ai/uploads/default/original/3X/1/3/1359141c5168494e5a569c6ce85a6545f3364b83.jpeg)

You can download it here [https://www.macupdate.com](https://www.macupdate.com)

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [October 31, 2022, 9:54pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/16 "2022-10-31T21:54:57Z")

</div>

Sorry I didn't get to this yet.  
If you know some Java Script you can maybe expand on this:

this example just counts down from 300, you would need to do some formatting to get minutes and seconds, but this should be relatively easy:

 ![image](https://community.folivora.ai/uploads/default/original/3X/5/8/58d95373fff4ce8e5c5230e912c959c2a4c79fae.jpeg)

the assigned action will reset the time when the button is pressed

 ![image](https://community.folivora.ai/uploads/default/original/3X/e/4/e4a3ea43f0b809c47572fbf90a31ca201b311cec.jpeg)

The widget script:

```auto
(async ()=> {

let timeAllowed = 300; //seconds to count down from
let startTime = await callBTT('get_number_variable', {variable_name:'timer_start_time'}); // the time the timer was started, this is set in the assigned action
let timePassed = Math.round((Date.now()-startTime)/1000); // converting from milliseconds to seconds and rounding

returnToBTT(timeAllowed - timePassed + ' s'); // returning the formatted value to BTT, so it can display it on the button

})();

```

The action script (just to set set the current time when pressing the button)

```auto
(async ()=> {
let currentTime = Date.now(); // current time in milliseconds since 1970
let result = await callBTT('set_number_variable', {variable_name:'timer_start_time', to: currentTime});
returnToBTT('timer reset');
})();

```

Here the full button config (copy & paste into BTT)

> **Summary**
>
> ```auto
> [
> {
> "BTTStreamDeckButtonName" : "Apple\nScript",
> "BTTTriggerType" : 725,
> "BTTTriggerTypeDescription" : "Apple Script Widget",
> "BTTTriggerClass" : "BTTTriggerTypeStreamDeck",
> "BTTPredefinedActionType" : 281,
> "BTTPredefinedActionName" : "Run Real JavaScript",
> "BTTRealJavaScriptString" : "(async ()=> {\nlet current = Date.now();\nlet result = await callBTT('set_number_variable', {variable_name:'timer_start_time', to: current});\n\n\nreturnToBTT(current);\n\n})();",
> "BTTEnabled2" : 1,
> "BTTAlternateModifierKeys" : 0,
> "BTTRepeatDelay" : 0,
> "BTTUUID" : "C6DDEFD2-F418-45AE-B63B-A4BEC597BEEB",
> "BTTNotesInsteadOfDescription" : 0,
> "BTTEnabled" : 1,
> "BTTModifierMode" : 0,
> "BTTOrder" : 0,
> "BTTDisplayOrder" : 0,
> "BTTMergeIntoTouchBarGroups" : 0,
> "BTTTriggerConfig" : {
> "BTTScriptSettings" : {
> "BTTScriptType" : 3,
> "BTTAppleScriptString" : "(async ()=> {\n\nlet timeAllowed = 300; \/\/seconds\n\nlet startTime = await callBTT('get_number_variable', {variable_name:'timer_start_time'});\n\nlet timePassed = Math.round((Date.now()-startTime)\/1000);\n\nreturnToBTT(timeAllowed - timePassed + ' s');\n\n})();",
> "BTTAppleScriptUsePath" : false
> },
> "BTTStreamDeckAlternateBackgroundColor" : "108.194754, 155.000000, 201.000000, 255.000000",
> "BTTStreamDeckIconColor2" : "255, 255, 255, 255",
> "BTTStreamDeckIconColor3" : "255, 255, 255, 255",
> "BTTStreamDeckAlternateIconColor1" : "255, 255, 255, 255",
> "BTTStreamDeckAlternateIconColor2" : "255, 255, 255, 255",
> "BTTStreamDeckImageHeight" : 50,
> "BTTStreamDeckBackgroundColor" : "255.000000, 192.000004, 114.000001, 255.000000",
> "BTTStreamDeckCornerRadius" : 12,
> "BTTStreamDeckAlternateIconColor3" : "255, 255, 255, 255",
> "BTTScriptUpdateInterval" : 1,
> "BTTStreamDeckAlternateImageHeight" : 50,
> "BTTStreamDeckAttributedTitle" : "cnRmZAAAAAADAAAAAgAAAAcAAABUWFQucnRmAQAAAC6UAQAAKwAAAAEAAACMAQAAe1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcY29jb2FydGYyNzA2Clxjb2NvYXRleHRzY2FsaW5nMFxjb2NvYXBsYXRmb3JtMHtcZm9udHRibFxmMFxmbmlsXGZjaGFyc2V0MCBTRkNvbXBhY3QtUmVndWxhcjt9CntcY29sb3J0Ymw7XHJlZDI1NVxncmVlbjI1NVxibHVlMjU1O1xyZWQyNTVcZ3JlZW4yNTVcYmx1ZTI1NTt9CntcKlxleHBhbmRlZGNvbG9ydGJsOztcY3NnZW5lcmljcmdiXGMxMDAwMDBcYzEwMDAwMFxjMTAwMDAwO30KXHBhcmRcdHg1NjBcdHgxMTIwXHR4MTY4MFx0eDIyNDBcdHgyODAwXHR4MzM2MFx0eDM5MjBcdHg0NDgwXHR4NTA0MFx0eDU2MDBcdHg2MTYwXHR4NjcyMFxwYXJkaXJuYXR1cmFsXHFjXHBhcnRpZ2h0ZW5mYWN0b3IwCgpcZjBcZnM1MCBcY2YyIEFwcGxlXApTY3JpcHR9AQAAACMAAAABAAAABwAAAFRYVC5ydGYQAAAAG0NgY7YBAAAAAAAAAAAAAA==",
> "BTTStreamDeckAlternateCornerRadius" : 12,
> "BTTStreamDeckIconColor1" : "255, 255, 255, 255"
> }
> }
> ]
> 
> ```

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [October 31, 2022, 11:20pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/17 "2022-10-31T23:20:26Z")

</div>

Thanks so much. I’ll look into minutes and seconds.

I appreciate this very much! 🙏

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [November 1, 2022, 12:20am UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/18 "2022-11-01T00:20:09Z")

</div>

Hey Frank. Love that site, I wasn’t familiar with it, gonna check it out some more. I have various timer apps, though this one does look good. I’m just really keen to try to work out how to use BTT and the SD together. And I love the idea of the button counting down. It’s the simple (?) things that make me happy!

Cheers!

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [November 3, 2022, 4:52pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/19 "2022-11-03T16:52:21Z")

</div>

I have got this running, which is no mean feat as I have no idea what I'm doing! 😀

It's displaying the remaining seconds and counting down.

Could anyone direct me to a decent 'teach myself javascript' site to start working on things like: 1) adding minutes and second.  
2) having the second press of the button pause (and then unpause on 3rd press)  
3) Long hold to reset the timer.

Obviously a javascript course isn't going to address any of them, but the problem I've always found with JS for me is that I've never had a sandbox in which to use it. I feel like I could use this as a sandbox, it would give me some purpose to my tinkering. So I might get there. The actual features aren't that important, as Frank said, there are plenty of apps that do that.

Actually, I think I could manage the long hold myself, because the default action is to reset the timer, so I should be able to take that from the action script and put it in for a long hold. In fact, I'll try that now.

---

<div class="post-metadata">

**Author:** ![Damoeire](https://community.folivora.ai/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@Damoeire](https://community.folivora.ai/u/Damoeire)\
**Post date:** [November 3, 2022, 4:58pm UTC](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814/20 "2022-11-03T16:58:28Z")

</div>

By god, I'm a programmer. 🤣

```auto
(async ()=> {

let timeAllowed = 300; //seconds to count down from
let startTime = await callBTT('get_number_variable', {variable_name:'timer_start_time'}); // the time the timer was started, this is set in the assigned action
let timePassed = Math.round((Date.now()-startTime)/1000); // converting from milliseconds to seconds and rounding

returnToBTT(timeAllowed - timePassed + ' s'); // returning the formatted value to BTT, so it can display it on the button

// If the count down is finished, write some text 
  if (timeAllowed - timePassed < 0) returnToBTT("Time!")
  })();

```

[Next page](https://community.folivora.ai/t/pomodoro-timer-for-streamdeck/28814.md?page=2)
