Inspired by the macOS app Pandan by Sindre Sorhus.
Time Awareness is a productivity tool that tracks your computer usage sessions, providing daily summaries and statistics. It features a tray icon for Ubuntu, Debian, Fedora, CentOS, and other Linux desktops (with AyatanaAppIndicator3 support) that allows you to quickly view your current session, total time today, previous sessions, and more.
- Tracks active computer usage sessions automatically.
- Ends sessions after a configurable idle threshold.
- Tray applet for Ubuntu with session info and quick actions.
- Dynamic tray icon that visually shows time spent as a circle progress indicator:
- 0 min → empty circle.
- 15 min → 25% filled.
- 1 hour → full circle.
- Colors change with time (optional):
- 0–59 min: blue.
- 60–119 min: purple.
- 120+ min: red.
- Session history and statistics (daily totals, averages, etc.).
- Persistent state and logging.
-
Python 3.7+
-
Linux desktop with AyatanaAppIndicator3 support (Ubuntu, Debian, Fedora, CentOS, etc.)
-
Python dependencies: (installed via
requirements.txt)pytestpygobjectpydbuspillowlogurupeeweetyper
-
System packages:
Ubuntu/Debian:
sudo apt-get update sudo apt-get install \ python3-gi \ libgtk-3-bin \ gir1.2-ayatanaappindicator3-0.1 \ libayatana-appindicator3-dev \ dbus \ libdbus-glib-1-dev \ libgirepository1.0-dev \ libgirepository-2.0-dev \ gir1.2-glib-2.0 \ gobject-introspectionRHEL/CentOS/Fedora (GNOME required):
Note: You may need to enable the CRB repository first:
sudo dnf config-manager --set-enabled crb sudo dnf makecache
sudo dnf install -y \ python3-gobject \ libayatana-appindicator3 \ libayatana-appindicator3-devel \ cairo \ cairo-devel \ cairo-gobject-devel \ libffi-devel \ glib2-devel \ dbus \ dbus-glib-devel \ gobject-introspection \ gobject-introspection-devel \ libjpeg-turbo \ libjpeg-turbo-devel \ gnome-shell \ gnome-extensions-appNote:
- For PyGObject > 3.50.1, you need
libgirepository-2.0-dev(Debian/Ubuntu). - For PyGObject <= 3.50.1, you need
libgirepository1.0-dev(Debian/Ubuntu). - On RHEL/CentOS/Fedora, GNOME desktop is required for tray icon support.
- For PyGObject > 3.50.1, you need
The application uses GNOME's IdleMonitor via D-Bus to detect inactivity.
Run this command to automatically install all dependencies, clone the project into ~/.time_awareness, create a virtual environment, install Python packages, and set up autostart:
curl -sSL https://raw.githubusercontent.com/AndersFB/Time-Awareness/main/scripts/install.sh | bashThis will:
- Install required system packages.
- Clone the repository to
~/.time_awareness. - Create a Python virtual environment (
.venv). - Install Python dependencies from
requirements.txt. - Create an autostart entry so the tray app launches on login.
- Launch the tray app immediately after installation.
-
Clone the repository
git clone https://github.com/AndersFB/Time-Awareness.git time_awareness cd time_awareness -
Set up a Python virtual environment
python3 -m venv .venv source .venv/bin/activate -
Install Python dependencies
pip install -r requirements.txt
-
If you are on RHEL/CentOS/Fedora (GNOME):
- Install the AppIndicator GNOME extension from the provided zip file:
gnome-extensions install libs/appindicatorsupportrgcjonas.gmail.com.v60.shell-extension.zip
- Log out and log in again.
- Enable the extension:
gnome-extensions enable [email protected]
- Log out and log in again.
- The tray icon will not work unless this extension is installed and enabled.
- Install the AppIndicator GNOME extension from the provided zip file:
-
Launch the tray app
gtk-launch time_awareness
You should see a circle-based progress icon in your system tray.
To update Time Awareness to the latest version, use the provided update script:
bash ~/.time_awareness/scripts/update.shWhat it does:
- Fetches the latest changes from the repository.
- Merges updates if available.
- Restarts the tray app automatically.
Use this script whenever you want to upgrade to the newest release without reinstalling.
If you did not use the automatic installer, you can set up autostart manually:
-
Find paths to Python and the app script
which python pwd -
Create
~/.config/autostart/time_awareness.desktop:[Desktop Entry] Type=Application Exec=/full/path/to/python /full/path/to/app.py Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name=Time Awareness Comment=Track your computer usage sessions -
Make it executable:
chmod +x ~/.config/autostart/time_awareness.desktop -
Launch the app:
gtk-launch time_awareness
- Current session: When it started and its duration.
- Total today: How much time you've spent today.
- Previous session: Details of your last session.
- Disable: Ends the current session.
- New session: Starts a new session.
- History: Shows summary statistics and session details.
- Reset: Clears all tracked data and resets the database.
- Quit: Cleans up and exits the tray app.
-
Log file:
All errors and activity are logged to~/.time_awareness/timeawareness.log.
Check this file for details if the app fails to start or behaves unexpectedly. -
Common issues:
- Missing tray icon:
Ensure you have installed all required system packages for your distribution (see Requirements).
On GNOME, make sure the AppIndicator extension is enabled (gnome-extensions list | grep appindicator). - Python errors:
Make sure you are using Python 3.7 or newer and have activated the virtual environment (source ~/.time_awareness/.venv/bin/activate). - Idle detection not working:
Confirm thatpydbusis installed and D-Bus is running.
Some desktop environments may not support idle detection; check the log for warnings. - Autostart not working:
Verify that~/.config/autostart/time_awareness.desktopexists and is executable.
You can test autostart by runninggtk-launch time_awarenessor restarting your session.
- Missing tray icon:
-
Diagnosing problems:
- Run the app from a terminal to see live logs:
~/.time_awareness/.venv/bin/python ~/.time_awareness/app.py
- Check for missing dependencies:
python3 -m pip check
- Reinstall system packages if you see import errors for
gi,pygobject, ordbus.
- Run the app from a terminal to see live logs:
To fully remove Time Awareness if you installed via the quick install script, you can use the automated script:
bash ~/.time_awareness/scripts/uninstall.shThis script deletes the app directory, removes the autostart entry, and deletes the application symlink.
Alternatively, you can manually run these commands:
-
Delete the app directory:
rm -rf ~/.time_awareness -
Remove the autostart entry:
rm -f ~/.config/autostart/time_awareness.desktop -
Remove the application symlink (if present):
rm -f ~/.local/share/applications/time_awareness.desktop
This will remove all files and autostart entries created by the quick install script.
MIT License.