Skip to content

simonvbrae/i3-timer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i3-timer

A simple timer for the i3 window manager's status bar built for i3blocks.

screenshot

Installation

go get github.com/claudiodangelis/i3-timer

Add these lines to the configuration file, which is usually located at ~/.i3blocks.conf:

[i3timer]
command=~/go/bin/i3-timer -alarm-command="notify-send 'i3-timer' 'Alarm Elapsed!'; play /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"
interval=10

Note: higher values for interval lead to poor timer accuracy.

Colors

The -colors flag enables colored output. The config parametermarkup=pango is required, for example:

[i3timer]
command=~/go/bin/i3-timer...
markup=pango
interval=10

Color Codes

Color Code
(default) Timer is idle
Green Timer is in its first half
Yellow Timer is in its second half
Red Timer is in its last quarter

Note: if pango markup is not rendered, for example the output is something like <span color="red">Timer: 5m0s</span>, you will need to set font pango:Monospace 10 to the bar section of the i3's configuration file.

Status label

Label Status
[I] Timer is idle
[R] Timer is showing remaining time
[E] Timer is showing elapsed time

Arguments

Argument Type Description
-alarm-command String Command(s) to be executed when the alarm fires
-colors Boolean Prints colorized timer
-debug Boolean Prints debug information
-recurring Boolean Restarts timer after the alarm fires
-duration Integer Sets the default duration, in minutes, of the timer
-autostart Boolean Starts the timer as soon as i3 starts

Usage

You can interact with the timer by clicking and/or using the scrollwheel.

Event Outcome
Left Click Toggles between elapsed/remaining time
Middle Click Starts the timer
Right Click Stops and resets the timer
Scroll Up Adjusts the timer to add one minute
Scroll Down Adjusts the timer to remove one minute

If passed, the value of -alarm-command will be executed when the timer runs out. In the example above the value is notify-send 'i3-timer' 'Alarm Elapsed!'; play /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga, which will pop up a notification on the top right corner of the screen and play a sound.

You can execute whatever program(s) you like.

Note: i3-timer stores timer's data into a hidden JSON file, .i3-timer.json stored at your home directory.

Credits

The original author and current maintainer is Claudio d'Angelis. Refer to contributors page for a full list of people who have contributed to this project. Contributions are always welcome.

License

MIT

About

⏰ A simple timer for the i3 window manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%