Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.
/ WorkspaceLogger Public archive

The WorkspaceLogger is a script to log and analyze the workspaces you use on your Ubuntu computer.

License

Notifications You must be signed in to change notification settings

usnistgov/WorkspaceLogger

Repository files navigation

README

The WorkspaceLogger is a simple python script to log and analyze which workspaces ("viewports" in unity) you are using in Ubuntu 16.04 (see DISCLAIMER.rst). If you dedicate each workspace to a specific type of task, you may then analyze how much time is spent on these tasks. You may also automate reminders and messages for taking breaks or projects that are collecting dust. Note: healthy workstation guidelines suggest that you take two to three 30- to 60-second breaks each hour to allow your body to recover from periods of repetitive stress. This notification feature, and the analysis, is made possible if you reserve one workspace which you make active just before you stop using the workstation. The scripts are meant to be run every minute by crontab, and saved periodically for analysis.

Installation

  1. Enable workspaces: Appearance -> Behavior -> Enable workspaces
  2. Install X Window manager
sudo apt install wmctrl
  1. Update the path to python in update.sh.
  2. Create your custom logger.json (as shown in logger.json.example) and customize Notifications. If you would like more than 4 workspaces (default), Add more workspaces.
  3. Test that the python script runs by the command below. A timeseries.txt file should have been created with your current workspace.
./update.sh
  1. Add to crontab as shown in crontab.example.
crontab -e
  1. If all goes well, you should see timeseries.txt updating every minute. And the file summary.txt will populate at midnight everyday, with an email notification and attached plot.png histogram. You may also receive notifications if you are not taking breaks. Use the mail command to check for errors if the logger does not appear to be working.

Add more workspaces

You can add more workspaces to unity as follows:

sudo apt install compizconfig-settings-manager
ccsm

Navigate to General Options -> Desktop Size tab

Notifications

This script uses the linux command line program "mutt" to send email notifications.

sudo apt install mutt

https://wiki.ubuntu.com/Mutt

To disable the notifications, change "disable_notify" from 0 to 1 in logger.json.

To add your email address, update "email_address" in logger.json.

To change the number of minutes until notification, update "minutes_per_break" in logger.json.

To change the workspace label which corresponds to taking a break, update "break_label" in logger.json.

To reset the break notification:

python /path/to/WorkspaceLogger/reset_break.py

External contribution

The python code used for computing which workspace (viewport) is active was taken almost entirely from Jacob Vlijm's 4/6/17 answer on https://askubuntu.com/questions/900970/how-do-i-look-up-the-name-of-the-current-workspace

Contact

Harold Wickes Hatch

https://www.nist.gov/people/harold-hatch

harold.hatch@nist.gov

About

The WorkspaceLogger is a script to log and analyze the workspaces you use on your Ubuntu computer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published