Skip to main content

exclock is a cui extended timer.

Project description

PyPI PyPI - Python Version PyPI - Downloads https://gitlab.com/yassu/exclock/badges/master/pipeline.svg https://gitlab.com/yassu/exclock/badges/master/coverage.svg PyPI - License

exclock is a cui extended timer.

Required

  • mplayer

  • xmessage or terminal-notifier(If you use mac, I recommend terminal-notifier)

How to install

$ pip install exclock

Usage

$ exclock [options] {clock-filename}

Features

  • Sound an alarm at a specified time.

  • Sound the alarm after the specified time has elapsed.

  • You can flexibly set the alarm.

Options

  • –version: show program’s version number and exit

  • -h, –help: show this help message and exit

  • -l, –list: show clock names in your PC and exit

  • -t, –time: Time which spends until or to specified

  • -r, –ring-filename: Sound-filename which used for ringing with -t, –time option. Note that you can use EXCLOCK_RING_FILENAME system variable if you often indicate ring-filename option.

  • –trace, –traceback: show traceback

How to sound an alarm at a specified time

Enter

$ exclock -t {time}

format command.

Where time is given in the {hour}:{min} or {hour}:{min}:{sec} format.

Ex.

$ exclock -t "1:00"
$ exclock -t "1:00:20"

How to sound the alarm after the specified time has elapsed

Enter

$ exclock -t {time}

format command.

Where time is given in the {sec}, {sec}s, {min}m or {min}m{sec}s.

Ex.

$ exclock -t 3
$ exclock -t 3s
$ exclock -t 2m
$ exclock -t 2m3s

How to flexibly set the alarm

Enter

$ exclock {clock-filename}

format command. Although {clock-filename} can be omitted as descrived below.

clock-file should be a file in json5 format.

Official page for json5 format is Here.

clock file format

{
  "title": "title(optional)",
  "sounds": {
    "time1": {
      "message": "message1",
      "sound_filename": "sound_filename1",
    },
    "time2":{
    "message": "message2",
    "sound_filename": "sound_filename2",
    },
    ...
  },
  "loop": loop_number(optional)
}
  • title(Optional): string which be used for notification. Then the property is computed from clock-filename if this option is not indicated.

  • sounds: dictionary from time to dictionary which includes message and sound_filename.

    • time format is “{sec}”, “{sec}s”, “{min}m” or “{min}m{sec}s” format.

    • message is a string which be used for notification and terminal output. Then message is replaced by “{count}” to number of how many times execute.

    • sound_filename is a string which be used for play the sound.

  • loop(Option): number of iterations for above clock timer. If this is nil, this means repeatation a number of times. Default value is 1.

There are sample files in sample dir in gitlab.

How to omit clock filename

Clock filename can be omitted for some case.

Rules are

  • If extension of clock filename is .json5, extension can be omitted(ex: pomodoro.json5 => pomodoro).

  • If dir is in the specified directory(~/.config/exclock/clock/ or environment variable EXCLOCK_CLOCK_DIR), dir is omitted (ex: ~/.config/exclock/clock/abc.json5 => abc).

  • Buitin clock file can be accessed. There are in sample dir in gitlab (ex: 3m or pomodoro).

How to omit sound filename

Sound filename can be omitted for some case.

Rules are

  • If dir is in the specified directory(~/.config/exclock/sound/ or environment variable EXCLOCK_SOUND_DIR), dir is omitted (ex: ~/.config/exclock/sound/abc.mp3 => abc.mp3).

  • Buitin sound file can be accessed. There are in sample sound dir in gitlab (ex: silent.mp3 or ring.mp3).

LICENSE

Apache 2.0

Todo

  • [-] exclock/sound/ring.mp3もしくはexclock/sound/ring.wavがあったら それをringに使うようにする

  • [-] システムでデフォルトで使われている音声ファイル名をclock_fileに埋め込めるようにする

  • [x] システムでデフォルトで使われている音声ファイルをデフォルトで使うようにする

  • [ ] property based test試してみる(Ref: https://pypi-hypernode.com/project/pytest-quickcheck/)

  • [ ] aliasを設定できる設定ファイルを置けるように
    • [ ] 環境変数から設定ファイルを拾えるように

  • [x] __でシステム内のファイルを指す仕様, 止める

  • [-] inner_strを消す

  • [ ] add tests to main function

  • [ ] abcを消す

  • [x] add Type for main function

  • [x] split main function

  • [x] default value of loop to 1

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exclock-0.2.8.2.tar.gz (70.8 kB view details)

Uploaded Source

Built Distribution

exclock-0.2.8.2-py3-none-any.whl (70.3 kB view details)

Uploaded Python 3

File details

Details for the file exclock-0.2.8.2.tar.gz.

File metadata

  • Download URL: exclock-0.2.8.2.tar.gz
  • Upload date:
  • Size: 70.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.7.0 Darwin/19.3.0

File hashes

Hashes for exclock-0.2.8.2.tar.gz
Algorithm Hash digest
SHA256 3840c000172a6f25977541044b3fd84bab60396277f3d12011b5484ecb97b74a
MD5 1e6c83978b18574689b3bfa53a95cf8d
BLAKE2b-256 838e8430d5aa471448fc7f603018ec85f0a4b209cce17327222d3e225c5f118c

See more details on using hashes here.

File details

Details for the file exclock-0.2.8.2-py3-none-any.whl.

File metadata

  • Download URL: exclock-0.2.8.2-py3-none-any.whl
  • Upload date:
  • Size: 70.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.7.0 Darwin/19.3.0

File hashes

Hashes for exclock-0.2.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2b172da732d3eb027825e33d5656416552332c23ffec1e8e7826d6e3460395a
MD5 e360ae485a8ae8496e56dc82c1a29b9e
BLAKE2b-256 305c12bafe46ce1ce287fa2f125fc6c4b00beefddcaf7fc652b2933b8d3e4969

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page