https://github.com/kringkaste/timeaddup
Script for Alfred (macOS) or Albert (Linux) to add up time ranges to a float of hours
https://github.com/kringkaste/timeaddup
albert-extensions albert-launcher albertlauncher alfred alfred-workflow alfred4 alfred4-workflow
Last synced: about 1 month ago
JSON representation
Script for Alfred (macOS) or Albert (Linux) to add up time ranges to a float of hours
- Host: GitHub
- URL: https://github.com/kringkaste/timeaddup
- Owner: kringkaste
- License: mit
- Created: 2021-12-18T23:10:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-23T07:26:21.000Z (over 3 years ago)
- Last Synced: 2025-01-18T07:48:01.589Z (3 months ago)
- Topics: albert-extensions, albert-launcher, albertlauncher, alfred, alfred-workflow, alfred4, alfred4-workflow
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Add up time ranges
This script is for [Alfred](https://www.alfredapp.com/) or [Albert](https://albertlauncher.github.io/) to add up multiple time ranges. The result is a floating-point number of hours.
## Query format
All times are in 24h format. The time ranges consists of pairs of time strings separated by spaces. The first time sting of the pair is the start time and the second is the end time. E.g.:
`t 12:00 12:15 13:30 14:00`
The query above starts with the trigger `t ` followed by two pairs of time ranges which will be calculated and added up: `12:00` to `12:15` and `13:30` to `14:00`.
You can modify the result by a number of minutes. Just add the string `+10m` to add 10 minutes or `-12m` to subtract 12 minutes from the result.
## Install for Alfred on macOS
If you want to use the script in Alfred, you first have to copy the `timecalc` module to your site-packages folder:
```shell
# Install the module
cp -r timecalc ~/Library/Python/3.8/lib/python/site-packages
```Then you can copy the `timeaddup.py` somewhere in your system. The path in the included `timeaddup.alfredworkflow` file expects the script in `/usr/local/bin`. You can change it later in the imported workflow if you use an other folder.
```shell
sudo cp timeaddup.py /usr/local/bin
```Then import the workflow by double click the `timeaddup.alfredworkflow` in the Finder.
## Install for Albert on Linux
Clone this repo into the Albert extension folder:
```shell
git clone [email protected]:kringkaste/timeaddup.git ~/.local/share/albert/org.albert.extension.python/modules/timeaddup
```Then copy the `timecalc` module to your site-packages folder:
```shell
cp -r ~/.local/share/albert/org.albert.extension.python/modules/timeaddup/timecalc ~/.local/lib/python3.9/site-packages
```Restart Albert and go to the extension tab in the settings and activate the extension.