All Projects → claudiodangelis → i3-timer

claudiodangelis / i3-timer

Licence: MIT license
⏰ A simple timer for the i3 window manager

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to i3-timer

Luastatus
universal status bar content generator
Stars: ✭ 195 (+473.53%)
Mutual labels:  i3, i3wm
I3 Gnome Pomodoro
🍅 Integrate gnome-pomodoro into i3
Stars: ✭ 159 (+367.65%)
Mutual labels:  i3, i3wm
I3 Workspace Groups
Manage i3wm workspaces in groups you control
Stars: ✭ 139 (+308.82%)
Mutual labels:  i3, i3wm
i3altlayout
i3wm efficient screen real estate
Stars: ✭ 40 (+17.65%)
Mutual labels:  i3, i3wm
Autotiling
Script for sway and i3 to automatically switch the horizontal / vertical window split orientation
Stars: ✭ 243 (+614.71%)
Mutual labels:  i3, i3wm
Azote
Wallpaper and colour manager for Sway, i3 and some other WMs
Stars: ✭ 138 (+305.88%)
Mutual labels:  i3, i3wm
I3 Battery Popup
A script that shows warning messages to the user when the battery is almost empty. For i3wm users.
Stars: ✭ 190 (+458.82%)
Mutual labels:  i3, i3wm
I3 Wm Config
I3 tiling window manager configuration
Stars: ✭ 109 (+220.59%)
Mutual labels:  i3, i3wm
i3blocks-airpods
i3blocks script for managing airpods and airpods pro.
Stars: ✭ 61 (+79.41%)
Mutual labels:  i3, i3wm
I3 Wm Gruvbox Theme
An i3-wm gruvbox theme implementation
Stars: ✭ 188 (+452.94%)
Mutual labels:  i3, i3wm
Wmfocus
Visually focus windows by label
Stars: ✭ 132 (+288.24%)
Mutual labels:  i3, i3wm
I3 Gaps Deb
Tool to create and install Debian (or Ubuntu) packages of i3-gaps.
Stars: ✭ 236 (+594.12%)
Mutual labels:  i3, i3wm
3mux
Terminal multiplexer inspired by i3
Stars: ✭ 1,687 (+4861.76%)
Mutual labels:  i3, i3wm
I3wm Config
my i3wm config
Stars: ✭ 196 (+476.47%)
Mutual labels:  i3, i3wm
Sgtk Menu
GTK launchers for sway & other WMs w/ menu, dmenu, application grid and button bar
Stars: ✭ 112 (+229.41%)
Mutual labels:  i3, i3wm
Tmux Tilish
Plugin which makes tmux work and feel like i3wm
Stars: ✭ 149 (+338.24%)
Mutual labels:  i3, i3wm
I3 Autodisplay
i3wm multiple monitors auto configuration
Stars: ✭ 104 (+205.88%)
Mutual labels:  i3, i3wm
I3wsr
Change i3-wm workspace names based on content
Stars: ✭ 107 (+214.71%)
Mutual labels:  i3, i3wm
Dotfiles
My [NeoVim + Tmux + Fish Shell] Setup /w install scripts
Stars: ✭ 180 (+429.41%)
Mutual labels:  i3, i3wm
i3blocks-gate
Extra i3blocks Scripts For arch Ubuntu very simple and very useful -
Stars: ✭ 42 (+23.53%)
Mutual labels:  i3, i3wm

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.

Key Bindings

You can setup key bindings to start and stop the timer by using i3blocks' signaling feature. What you should do is to create 2 additional blocks with no interval property but set the proper signal value for the blocks, then set i3 configuration to bind the emission of the given signals to a keyboard shortcut.

The following example will bind the start of timer to Mod1+Shift+Control+k (which will emit, for example, signal 10) and the stop to Mod1+Shift+Control+l (which will emit, for example, signal 11). After emitting signal 10 or 11, both key shortcuts will emit signal 12 that will refresh the timer's "gui".

  1. Create the main block to configure the timer in i3blocks configuration file:

    [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
    signal=12
  2. Create the "start timer" block in i3blocks configuration file

    [i3timer]
    command=~/go/bin/i3-timer -exec-start
    signal=10
  3. Create the "stop timer" block in i3blocks configuration file

    [i3timer]
    command=~/go/bin/i3-timer -exec-stop
    signal=11
  4. Create the keyboard shortcut binding in i3 configuration file

    # start timer
    bindsym --release Mod1+Shift+Control+k exec bash -c "pkill -SIGRTMIN+10 i3blocks && pkill -SIGRTMIN+12 i3blocks"
    # stop timer
    bindsym --release Mod1+Shift+Control+l exec bash -c "pkill -SIGRTMIN+11 i3blocks && pkill -SIGRTMIN+12 i3blocks"
  5. Restart i3 and enjoy

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].