Giter VIP home page Giter VIP logo

dalarma's Introduction

dalarma

dalarma is a simple, but powerful cli tool for setting timers, which, after timeout, will block your screen (by default for 15 seconds) to force you to get up from the computer and do some thing.

Why would I want to block my screen and force me for anything?

Imagine you cooking something in oven, and you need to wait for 1 hour until it is done. If you seat at computer, you can very easily miss the time and then your food is crapped. With dalarma you can set timer for 1 hour, which after expiring will block your screen (for 15 seconds), so you have to get up and check oven.

Why no way for easy skip/postpone?

When you do really interesting task and have some experience with such timers, you actually getting training yourself to automatically/mindlessly postpone/skip another one timer alarm, thinking like "ahgh, I'm almost finished this fancy algorithm, let me just done it in 2 minutes and I'll check these oven", which can result in many postpones in a row, so you know what will happen with your food...

Requirements

  • wmctrl (partially optional) - used to make window fullscreen and auto-focus each second to make window harder to close. Hence, it is core functionality, but still, dalarma can work without it.
  • st - simple/suckless terminal emulator, used as gui window that blocks screen.
  • notify-send (optional) - for sending notifies visible on blocked screen.

Installation

On Arch Linux

AUR package: dalarma-git

Manual

Copy ./dalarma somewhere to your $PATH (like ~/.local/bin/ or /usr/bin/) and optionally ./config.example.sh to ~/.config/dalarma/config.sh.

Usage

First argument is always the time after which "you need to do something". Format is the same as for sleep, so go to man sleep for details. In short: there is available suffixes like s, m, h for seconds, minutes and hours respectively.

Additionally, first argument time can be set in format hh:mm to set timer ON TIME, not by offset.

All remaining arguments will be used as title for your timer (can be ommited).

dalarma 30m check oven
dalarma 14:20 time to depart

Managing timers

dalarma puts each new timer metadata to /tmp/dalarma/ folder, one per file. File name is pid of timer process, and file itself contains metadata about this timer, such as started_at, sleep_time and title.

There is script that also utilizes fzf for ui. You can take inspiration from it.

Configuration

~/.config/dalarma/config.sh is just a shell script, so it can be very hackable and extensible.

As interesting feature, you can execute your own commands before and after lock (like mute/unmute all sounds, etc.) with cmd_pre_lock and cmd_post_lock.

You can edit it even after some timers have started and they will use updated config (for example, edit pre and post hooks).

Self-explanatory config example provided.

Inspiration

Spiritual successor of https://github.com/UnkwUsr/UsefulB , which was first inspired by https://github.com/slgobinath/SafeEyes

dalarma's People

Contributors

unkwusr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.