Skip to content

A portable timer-application: simple yet efficient time management tool.

License

Notifications You must be signed in to change notification settings

sentenzo/secondglass

Repository files navigation

SecondGlass

A portable timer-application: simple yet efficient time management tool.

Screenshot

It was hugely inspired by @dziemborowicz's Hourglass app.

Table of Contents

Goals

Why did I make it:

  • to get familiar with Python GUI toolkits (with tkinter in particular) to be able to utilize this skills in my other projects
  • to make a proper substitution for Hourglass
What is Hourglass? Click to (un)fold.

What is Hourglass?

It's a countdown timer desctop GUI application for Windows; written on C#; minimalistic in a Unix-way-ish sence.

It looks like this:

hourglass

What's wrong with Hourglass?

Nothing's wrong with it. It's an amazing app. I've being using it for 3+ years.

Though, in my humble opinion, it maybe needs some slight optimization. Its downsides are:

  • unreasonably high memory consumption: 70-180 MB, depending on the size of the window I guess
  • inefficient GPU usage: up to 30% load on GeForce RTX 2060
    • like why it even needs GPU?
      • it is used to produce a fancy window flickering background effect when the timer has rang

Features

  • a single-file portable app
  • resizable window with adaptive UI
  • right button click opens a context menu, where you can:
    • change UI theme
    • change the ring sound
  • the application state is saved between sessions (last valid input, UI theme, the dinging sound picked)
  • when the timer expires:
    • the short dinging sound is played
    • the timer window pops up above all the over windows
  • the progress bar is also displayed on a taskbar plate, so it's visible even when the app is minimized

How to use

Windows 10 is required.

  1. Download the executable named secondglass.exe, from the latest release
  2. Run the executable
  3. Type the time duration in a textbox and press the start-button (or just Enter). Input examples:
    • 10 becomes: 10 minutes
    • 123 or 123 m or 123min becomes: 2 hours 3 minutes
    • 30s or 30 s or 30 sec becomes: 30 seconds
    • 1h 35m becomes: 1 hour 35 minutes
  4. You can pause, restart or abort the timer by pressing pause, restart and stop buttons respectively

What's inside

My modules

Third party modules

  • tkbootstrap — gives tkinter some attractive appearance
  • comtypes — grants access to Windows API (to change window toolbar)
  • pygame — plays that dinging sound when the timer rings
  • pyinstaller — packs everything together into a single executable

How to build

Software requirements

First run

  1. Install the dependencies:
    • option 1 - if having both make and Poetry:
      • in the project directory execute make init
    • option 2 - if only having Poetry:
      • in the project directory execute poetry install
    • option 3 - if having none:
      • in the project directory create virtual environment and switch to it
      • execute pip install -r requirements.txt
  2. Run the app:
  • option 1: make run
  • option 2: poetry run python -m secondglass
  • option 3: python -m secondglass

Regular make targets

  • make run or make — run app with Python
  • make lint — launching linters and formaters (mypy, black, isort, flake8)
  • make test — run unit-tests
  • make build — create an executable in a build folder

Licensing