Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qbart/timelog
Time logging in CLI
https://github.com/qbart/timelog
cli csv fzf go golang linux polybar timelog timelogging
Last synced: 16 days ago
JSON representation
Time logging in CLI
- Host: GitHub
- URL: https://github.com/qbart/timelog
- Owner: qbart
- License: mit
- Created: 2020-02-03T20:22:00.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T21:29:29.000Z (over 2 years ago)
- Last Synced: 2024-11-29T13:13:53.154Z (24 days ago)
- Topics: cli, csv, fzf, go, golang, linux, polybar, timelog, timelogging
- Language: Go
- Homepage:
- Size: 1010 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# timelog
[![LICENSE](https://img.shields.io/github/license/qbart/timelog)](https://github.com/qbart/timelog/blob/master/LICENSE)
[![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/)
[![Go Report Card](https://goreportcard.com/badge/github.com/qbart/timelog)](https://goreportcard.com/report/github.com/qbart/timelog)
[![Last commit](https://img.shields.io/github/last-commit/qbart/timelog)](https://github.com/qbart/timelog/commits/master)```
Time logging in CLIUsage:
timelog [flags]
timelog [command]Available Commands:
adjust Adjusts time between entries
archive Archive data file
autocomplete Autocomplete for entries
clear Clears all entries
help Help about any command
polybar Polybar configuration
qlist Prints all quicklist entries
start Starts a new time entry
stop Stops active time entry
version Prints software versionFlags:
-h, --help help for timelogUse "timelog [command] --help" for more information about a command.
```## Install
```
git clone [email protected]:qbart/timelog.git
cd timelog
make build
```## Usage
### Print current timelog
```
timelog
```![timelog](./doc/timelog.png)
### Start next task
```
timelog start
```### Stop current task
```
timelog stop
```### Clear
```
timelog clear
```1. Current timelog will be printed.
2. Once confirmed local database will be cleared :warning:.### Adjust time
```
timelog adjust
```1. Console UI will start (use arrows or hjkl).
2. Enter to continue.
3. After changes you will see git-like diff to accept/reject changes.![timelog](./doc/timelog_adjust_step1.png)
![timelog](./doc/timelog_adjust_step2.png)### Archive
```
timelog archive
```1. Current timelog will be printed.
2. Once confirmed file will be moved to archive (`~/.config/timelog/archive/`)## Configuration
### Install autocompleter (bash + fzf using complete)
Tested only in Ubuntu (PR appreciated for other OSes)
```
timelog autocomplete install >> ~/.bash_profile
``````
timelog [hit TAB]
```
![timelog](./doc/timelog_autocomplete_cmds.png)### Quicklist
Quicklist is a data source for autocompleter (fzf). Tasks should not contain whitespaces.
```
vim ~/.config/timelog/config.ini
``````
[quicklist]
task-1
task-2
task-3
hello
``````
task start [hit TAB]
```
![timelog](./doc/timelog_autocomplete_qlist.png)## Polybar (or any other bar) integration
You can integrate timelog with your custom bar:
```
timelog polybar format "FORMAT"
````FORMAT` exposes following vars in `go` template:
```go
type polybarItem struct {
Comment string // task comment
Duration string // last task duration
Total string // tasks total duration
Count int // task count
CountNotZero bool //
TotalGtDuration bool // true when total > duration
}
```### Polybar example
```
[module/timelog]
type=custom/script
interval=10
exec=timelog polybar format "{{if .CountNotZero }}%{F#011814}%{B#24f5bf} {{.Comment}} %{B-}%{B#0adba6} {{.Duration}} %{B-}{{ if .TotalGtDuration}}%{B#08aa81} {{.Total}} %{B-}{{ end }}%{F-}{{ end }}"
```#### When duration equals total
![timelog](./doc/timelog_polybar_same.png)
#### When duration does not equal total
![timelog](./doc/timelog_polybar.png)## Config
## How to contribute?
Ask first before any implementation.
Possible todos:
- edit comments `timelog edit` (similar to `timelog adjust` editor)
- quicklist management from CLI ie. `timelog qlist.add ENTRY`
- multi-autocomplete i.e `timelog start [TAB]`, then `timelog start autocompleted-1 [TAB]` <- currently this will replace `autocompleted-1` with new qlist entry, goal is to append next one
- autocomplete for other OSes (OSx integration anyone?)