You are browsing as a guest. Sign up (or log in) to start making projects!

timer

  • 6 Devlogs
  • 7 Total hours

terminal timer application

Ship #1 Pending review

timer

a dead-simple CLI timer

why

i was tired of googling for timers all the time. for a while i’d had this thought sitting in the back of my head: why not just have a timer command in my terminal instead?
i looked around for something like this first, but couldn’t find anything in the form i actually wanted, so i built it myself.

it solves a simple problem: i needed a, terminal-native way to track time without breaking my workflow or needing a browser open in the background eating my ram.

what it is

a dead-simple timer. no fancy UI, no flags to memorize. one argument, intuitive syntax (imo):

timer 5m

that’s it.
no messing around with weird bash loops or sleep one-liners etc :D

it’s a fully working & tested on windows & linux directly, builds clean on mac via the github action too (but i dont own a mac so idk if it fully works, but it should).

QoL stuff

  • audio alarms plays a sound when the timer’s up. instead of bundling a massive audio library, it just leans on native OS tools (PlaySoundW on Windows, afplay on macOS, and a fallback chain of pw-play/paplay/aplay on Linux). it supports loopable or one-shot playback of a set sound, or you can just disable it entirely.

  • visual alerts triggers a visual alert alongside the alarm using system tools (requires libnotify on linux, uses osascript notifications on mac, and triggers a classic message box popup on windows).

  • simple config file 4 “set-and-forget” config options (SoundPath, SendNotification, PlayAudio, LoopAudio) via a simple key=value format. no need to pass crazy flags or remember syntax for a good setup;
    just configure it once and run timer 5m.

  • easy peasy to use!!! i guess that counts as qol ^o^ ?

other stuff

  • simple syntax timer 5m, timer 90s, timer 1h30m20s, whatever feels natural.

p.s the ordering of time units does not matter

  • kept the scope intentionally tight: one arg in, a timer running, an alert out. no dependencies bundled in, it’s dependency-less-ish by design, leaning on existing system-level tools instead of pulling in external libraries. binary’s relatively small & fast to build because of this
  • the git repo also hosts some arch linux pkgbuilds i wrote myself if ur into that kinda thing.. easy installation for nerds :)

I’m pretty happy with it and enjoy using it myself,
honestly wasn’t too hard to do since i’ve dealt with the terminal quirks i had before, which was the biggest issue

(specifically how windows handles ansii escape sequences on its old terminals)

more info exists in the readme for configuration and usage !!

Try project → See source code →
Open comments for this post

1h 26m 28s logged

windows quirks…

kinda just setting things up

  • Windows VM & ANSI Support: Spent time testing in the Windows VM.
  • older command prompts or PowerShell prompts on Windows require explicit setting of ANSI escape sequence support which I use so got that sorted out.. (the same way as i project i did last year actually…)
  • setup Got GitHub Actions configured and put together a proper README, and also made some arch linux pkgbuilds because thats how i like installing my own applications :)
  • Audio Backends: Updated the audio player logic. Now it tries to use pw-play if it exists, rather than strictly relying on PipeWire-Pulse or other specific layers. It supports all the audio backends for REAL now.
0
0
7
Open comments for this post

1h 58m 53s logged

Audio Alerts & Config Files

changes

  • audio player, the timer can make noise now. via native OS tools instead of pulling in an audio library: PulseAudio/PipeWire/ALSA on Linux, afplay on macOS, PlaySoundW on Windows.
  • config system, added a simple key=value config format with a custom parser. nothing fancy, but it works!:D
  • cleanup, nothing exciting just tidying up…

p.s everything here is my own tiny (and maybe terrible) code, no imported libraries. this project’s stayed dependency-less-ish from the start, it leans on existing system-level stuff (libnotify, whatever audio server you’ve got on Linux, etc) instead of bundling in external libs :D

0
0
3
Open comments for this post

21m 16s logged

I have notifications working, it will trigger a terminal-bell and send a notification (depends on platform though) on windows it will use a messagebox, on linux it currently depends on libnotify, maybe not great but it’s easy to use and already super common… macos also has an implementation but i have not tested it since i am not a mac user.. you can also press ‘q’ to quit while the timer is running (on all platforms)

0
0
7
Open comments for this post

1h 32m 33s logged

been fixing formatting as shown, also working on taking in input too (so pressing q quits the timer early) and im also working on getting notifications implemented

0
0
2
Open comments for this post

1h 2m 37s logged

ive got the command line parser working, its a recursive descent parse which turns input (taken from argv) such as “1h30m” into milliseconds, and gets used by the timer function, suprised I got it working so quickly :) … i think im going to focus on making the output format properly to Day:Hour:Minute:Second or something, since right now its just Minutes:Seconds.. then probably figure out what to do when time runs out

0
0
5
Open comments for this post

50m 15s logged

i was lowk tired of having to google “x timer” every time I needed one, so I figured it would be easier to just make my own simple terminal timer app

currently i have a basic test setup i guess that just counts down and exits when done, it uses milliseconds internally but takes minutes as input

i plan to turn it into a proper CLI app with input parsing, so things like:

  • 10s
  • 5m
  • 2h
  • 2h5m

etc. will work, then probably implement some sort of notification or something once it’s done

0
0
9

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…