GithubHelp home page GithubHelp logo

jadogg / pydoro Goto Github PK

View Code? Open in Web Editor NEW
537.0 9.0 46.0 1.12 MB

πŸ… pydoro - Terminal Pomodoro Timer

License: MIT License

Python 98.75% Batchfile 0.65% Shell 0.60%
python terminal-based tomato-timer pomodoro terminal-app console-app prompt-toolkit pydoro pomodoro-timer productivity

pydoro's Introduction

pydoro πŸ…

Terminal Pomodoro Timer

https://github.com/JaDogg/pydoro/raw/develop/images/logo.png

PyPI CI Python Support Chat

Installation πŸŽ‰

Install via pip:

$ pip install pydoro
$ pydoro

Install via snap (Linux):

$ sudo snap install pydoro
$ pydoro
  • NOTE: Pop!_OS users will need to run pydoro without sound, using this command option: pydoro --no-sound
  • Snap package is maintained by James Tigert ( kz6fittycent )

Done.

You can also use pip install "pydoro[audio]" to get audio dependencies for OSX(pyobjc-core) and Linux(PyGObject).

Also for Linux pygame will be used if it's installed. (Try this if you cannot get PyGObject to work)

For some systems you may have to use pip3 instead. Only Python 3.6+ is supported.

On windows you may try the packaged .exe file. See the releases page.

If you have pipx:

$ pipx install pydoro

You can also inject dependencies to pipx virtual environment using

$ pipx inject pydoro pygame

Usage πŸ“–

  • Run pydoro to launch. More info in wiki.

https://github.com/JaDogg/pydoro/raw/develop/images/animation.gif

Options: Use --no-sound to mute alarms, --no-clock to hide the clock or --focus for both clock hiding and sound muting

Credits πŸ™‡β€β™‚οΈ

  • Pomodoro - Invented by Francesco Cirillo
  • playsound.py - For playing audio file, Copyright (c) 2016 Taylor Marks
  • prompt-toolkit - Awesome TUI library 😎
  • b15.wav - Dana robinson designs, CC0 from freesound

Contributors πŸ™

Why ? πŸ€”

  • I wanted to follow Pomodoro Technique.
  • I don't like to use mobile apps or web apps.
  • No user info is stored, tracked or shared.
  • I spend lot of time on my Terminal.
  • Written in Python 🐍.

Copyright βš–

This software is Copyright (c) 2021 - 2024 Bhathiya Perera.

See the LICENSE file for more information.

pydoro's People

Contributors

akeerio avatar beatrizuezu avatar dependabot-preview[bot] avatar dependabot[bot] avatar gmelodie avatar islander avatar jadogg avatar kajpio avatar kana800 avatar kz6fittycent avatar liupold avatar mertserezli avatar nikamura avatar requiem avatar sachinsenal0x64 avatar xr09 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydoro's Issues

Save daily statistics of each work/break period into a CSV file

  • Simple local CSV file for those who want's to analyse their data.
  • No servers/internet needed. Everything is saved locally at a location provided by user.
  • Append only writing for each completed task.

CSV Contents

date unix-date start-time unix-start-time end-time unix-end-time pauses type configured-time actual-time
2020/01/20 6:55AM 7:15AM 0 WORK 1200 1200
  • Both human readable dates and unix dates are provided. Human readable date is in current timezone. Unix time will be UTC time.
  • Why UNIX time? Situations where you are working in multiple time-zones (& system is properly updated with new time). Unix time still works.
  • types: WORK, SBREAK, LBREAK
  • pauses: Total pauses you did
  • configured-time: What is the time configured for this type of work
  • actual-time: Actually taken time including pauses within same work/break period. This can also be calculated by unix-end-time - unix-start-time. Provided for convenience.

Support for notification daemon

Is it possible to implement a system to send a notification after the timer counts to zero using notification daemon like dunst.
Also is the program suppose to play a sound when the timer finishes?

more command line interface or api wanted [FEAT]

Related Problem
I am trying to integrate this with taskwarrior timewarrior and vim to build my task system
I want to trigger the start pause and reset with some command so that I can bind it with taskwarrior and other tools to keep track
of task and generate reports.
Wanted Features
It would be nice if you can provide some thing like:
$ pydoro start [jobid]
$ pydoro pause [jobid]
$ pydoro reset [jobid]
-- job id used to refer to the working instance
It would be even better If it can communicate with taskwarrior's data base directly
Alternative
or can you provide some functions and document that you think can get this done.
By the way
This is the best pomodoro timer I could find in github, I love your style really.

Introduce a config file for keybindings, and other features

There is a recent pull request #12 for introducing a config file. However I want to modify it and introduce an .ini as a config file so people don't need to edit code to change things.

Where to look for config file

  1. Look in the location set in PYDORO_CONFIG_FILE
  2. Look in ~/.pydoro.ini
  3. Look in current dir/.pydoro.ini

Config format

[keys]
navigate_left = ["left", "s-tab"]

[animation]
no_seconds = False # Only show minutes if this is True.
no_progress = False # Does not animate the indefinite progress bar.

[time]
work_minutes = 25
sbreak_minutes =  5
lbreak_minutes = 15

from pydoro.pydoro_core.tomato import Tomato ImportError: No module named pydoro_core.tomato

My error

Traceback (most recent call last):
  File "/Users/<USER>/Library/Python/2.7/bin/pydoro", line 5, in <module>
    from pydoro.pydoro import main
  File "/Users/<USER>/Library/Python/2.7/lib/python/site-packages/pydoro/pydoro.py", line 15, in <module>
    from pydoro.pydoro_core.tomato import Tomato
ImportError: No module named pydoro_core.tomato

I just installed the software using the instructions

 pip install pydoro
 pydoro

Then add to $PATH

[FEAT] Would itbe possible to make it so you can change the sound the timer makes?

Is your feature request related to a problem? Please describe.
The sound for the alarm is harsh and piercing. Could you add a feature that could customize the sound?

Describe the solution you'd like
Within the .ini file, you could customize the sound.

Describe alternatives you've considered
I just mute the sound

Additional context
Add any other context or screenshots about the feature request here.

[FEAT] Run a command after successful sessions

Is your feature request related to a problem? Please describe.
Allow users to run an arbitrary command when work/small-break/large-break alarm is triggered

Describe the solution you'd like
3 configurable shell commands & a switch to enable/disable this feature in config. No need for new CLI argument support. Config should load empty commands and disabled command execution if keys are not found

Describe alternatives you've considered
This would allow people to plug in custom notifications, etc.

README should include all contributors πŸ˜€πŸ˜Ž

Currently README doesn't show all the contributors. Perhaps have a different .rst file and .md file so we can easily add a list of auto generated contributors to it

This needs change in setup.py as well. Rename README.rst to README_PYPI.rst & create a markdown version that contain README.rst content.

Keep copyright as it is.

Unecessary msilib import

While building the project locally for development I found that commenting out this line from pydoro_tui.py made pydoro work on Linux, while before it was giving me:

(venv) ➜  pydoro git:(master) pydoro
Traceback (most recent call last):
  File "/home/gmelodie/.local/bin/pydoro", line 33, in <module>
    sys.exit(load_entry_point('pydoro', 'console_scripts', 'pydoro')())
  File "/home/gmelodie/.local/bin/pydoro", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/gmelodie/repos/pydoro/pydoro/pydoro_tui.py", line 7, in <module>
    from msilib.schema import EventMapping
ModuleNotFoundError: No module named 'msilib'

I noticed that nothing is using EventMapping. Maybe we'd want to comment it out?

[BUG] No sound for OpenBSD

Describe the bug
No sound using Pydoro using OpenBSD

To Reproduce
pydoro --audio-test
OR
pydoro

Expected behavior
expected to play sound

Desktop (please complete the following information):

  • OS: OpenBSD
  • Version 7.1

Additional context
I am pretty sure the solution is to add to the sound.py under platforms. I will try to create a pull request to fix this for openbsd under fallback. There is probably another library to use in OpenBSD as OpenBSD does not use linux utilites like ALSA, pulse audio, jack, etc. (im pretty sure the linux version uses alsa). Since OpenBSD uses sndio, I will see if there is a related python library.

docutils version mismatch?

Hi, when I run:

python -m venv env
source env/bin/activate
pip install -r dev_requirements.txt

I receive this error.

ERROR: docutils-stubs 0.0.21 has requirement docutils==0.14, but you'll have docutils 0.16 which is incompatible.

am I doing something wrong?

Fix `audio` extra in setup.py

There are problems with having audio extra_requires.

  • It would be easier if we can just install pydoro and it comes with dependencies. ❌ - no, we need current behavior. (Otherwise it might break for systems that doesn't support those requirements)
  • Checking for platform manually in the setup.py doesn't sound right. βœ”

No animation/Silent mode

If I run Pydoro in a visible iTerm pane, the timer animation is distracting. Perhaps having a "silent mode" would be nice, just animate when done, so as to break distraction less.

High cpu usage and possible solution

I noticed that Pydoro taxes my cpu quite a lot considering it's just a simple tui program (even while idling on the start screen). -- I'm talking about 3 to 5% on my i5 8250U. So I investigated a little and found out that most of the draw calls are not really necessary because the text that is to be drawn did not change at all since previous draw.

I have a proof of concept solution here freidonuten@a95cf12 the idea is that before calling invalidate in draw (which turns out to be quite expensive) you hash tomato state and compare it with hash from previous call. If they match then there's no need to redraw. The cpu usage dropped basically to zero at the start screen, 1~2% if the countdown is running.

I'm not sending this as a pull request because it is quite a hacky solution and I don't feel like investing more time into this as I don't really know what I'm doing.

Add configuration screen

It would be convenient to have a configuration screen so that users could change configs without writing directly into the .ini file.

Alternative linux audio?

PyGObject based audio might not be a good idea all the time. Need to think of other possible ways too.

Additional keybindings

Nice project. An idea for enhancement:

  • Vim keybindings: h for left and l for right, synonyms for tab and shift + tab, respectively.
  • Shortcut keybindings: (S)tart, (P)ause, (R)eset, Reset (A)ll, (E)xit

Make emoji tomatoes optional and activate with a command line

Checking to see if we can write tomato emoji to terminal doesn't seem to work on Windows (normal console cmd.exe) and other various terminals.

Use a command line option such as pydoro --emoji to activate it.

NOTE: This wasn't a bug with the merge request sent by a contributor. Rather a bug in the requirement github issue I created 😭

Failed to run from pydoro command

Traceback (most recent call last):
  File "/Users/bperera/.pyenv/versions/3.8.0/bin/pydoro", line 6, in <module>
    from pydoro.pydoro_tui import main
ImportError: cannot import name 'main' from 'pydoro.pydoro_tui' (/Users/bperera/.pyenv/versions/3.8.0/lib/python3.8/site-packages/pydoro/pydoro_tui.py)

[Feature] Ability to autostart sessions

Hello
1- Sometimes sound is off, and you don't know your session in over or not so what I want is when the session ends (work or rest) the terminal window comes up, so we know the session (work or rest) is over. - Not doable

2- AutoStart sessions ability for Rest and Work sessions; I want them separated; for example, I want Rest session to be automated but Work session be manual some other guy might want it both automated that why I want autostart to be separated. - Good idea

Add button to open config file

Add a "Config" TUI button that opens the .ini file in default $EDITOR

(#50 reminded me of this idea)

I can try my hand at this btw :)

Create test sound feature

Create a new command line only argument that once used will test bell sound and exit

pydoro --test-sound

[BUG] AttributeError: 'NoneType' object has no attribute 'props'

Describe the bug
pydoro fails to play sound(s). Please see "Additional Context".

To Reproduce
Steps to reproduce the behavior:

  1. pydoro --audio-check
  2. Press Enter '....'
  3. See error
Traceback (most recent call last):
  File "/snap/pydoro/44/bin/pydoro", line 8, in <module>
    sys.exit(main())
  File "/snap/pydoro/44/lib/python3.8/site-packages/pydoro/pydoro_tui.py", line 130, in main
    sound.play(in_app_path("b15.wav"), block=True)
  File "/snap/pydoro/44/lib/python3.8/site-packages/pydoro/pydoro_core/sound.py", line 135, in _play_sound_nix
    _play_sound_nix_blocking(sound)
  File "/snap/pydoro/44/lib/python3.8/site-packages/pydoro/pydoro_core/sound.py", line 114, in _play_sound_nix_blocking
    playbin.props.uri = "file://" + pathname2url(os.path.abspath(sound))
AttributeError: 'NoneType' object has no attribute 'props'

Expected behavior
I expected pydoro to play it's default sound or one that I chose (.wav).

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Pop!_OS
  • Version 22.04

Additional context
Please note, I am working on a snap for pydoro - so put your container hat on. :)

Failed to build wheel for pycairo

During installation of audio dependencies on Kubuntu 19.10 using

pip3 install pydoro[audio]

Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.


Failed building wheel for pycairo

[BUG] No alarm sound

Describe the bug
No alarm sound after timer ends on either break or work.

To Reproduce
Steps to reproduce the behavior:
run pydoro on a new terminal
start running timer
No alarm after timer ends

Expected behavior
Alarm sounds after timer ends during break or work

Desktop :

  • OS: Arch Linux
  • DM: dwm

[FEAT] Support different .wav files / built in alarms?

Is your feature request related to a problem? Please describe.

  • I don't like the bell sound

Describe the solution you'd like

  • Different sounds

Describe alternatives you've considered
N/A

Additional context

  • Provide an --audio-file argument so a custom audio file can be used.

[FEAT] Allow Skipping to the next period

This app seems awesome. I miss one feature to allow me to skip the current running timer to the next period.

Like skip running Work time >> Relax time or skip Relax time to work time
It's useful if you start the application in the middle of working period and you want to synchronize your time when you finish.

[BUG] Custom audio for alarm does not work

Describe the bug
When I specify the the .wav file within the INI, the sound does not get played

To Reproduce
Set up the INI file so that it's the following:

[General]
no_clock = False
no_sound = True
emoji = False
; Set a file here to play this instead of default bell sound (Optional) 
audio_file = /home/jared/Sounds/Hummingbird-SoundBible.com-623295865.wav

[Time]
tomatoes_per_set = 4
work_minutes = 1
small_break_minutes = 5
long_break_minutes = 15
alarm_seconds = 5

[KeyBindings]
focus_previous = s-tab,left,h,j
focus_next = tab,right,l,k
exit_clicked = q
start = s
pause = p
reset = r
reset_all = a
  1. Uninstall the pip package via pip uninstall 'pydoro[audio]
  2. Build using python3 ./setup.py build
  3. Install using python3 ./setup.py install
  4. Run using python pydoro/pydoro_tui.py

Expected behavior
I expect the humming bird sound to play after the timer ends

Desktop (please complete the following information):

  • Linux Mint 21 "Vanessa"

Add support for cmd/shell execution.

While working or taking a break it would be nice if it can automatically trigger system events. For example, turning the internet on/off or blocking/unblocking a few sites or even as simple as turning system sound on or off.

This is probably not that difficult to implement and a few lines in the general section of .ini file will do.

...
[general]
work_start_cmd  = "echo 'WORK'"
work_end_cmd  = "echo 'TAKE A BREAK'"
...

This can also be used to send notifications.

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.