Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
working timer, added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
infeeeee committed Nov 11, 2019
1 parent 1e27a60 commit 8855481
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 27 deletions.
Binary file added @Resources/Fonts/accid___.ttf
Binary file not shown.
Binary file added @Resources/Screenshots/infinibar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added @Resources/Screenshots/kimai-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified @Resources/kimai2-cmd/kimai2-cmd.exe
Binary file not shown.
72 changes: 67 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,73 @@
# kimai2-cmd-rainmeter
Rainmeter widget for Kimai2

TODO: Write readme
[Rainmeter](https://www.rainmeter.net/) is an open source desktop customization tool for Windows

## Install
[Kimai2](https://www.kimai.org/) is an open source self-hosted time tracker

This widget uses [kimai2-cmd](https://github.com/infeeeee/kimai2-cmd). Executable included in this repo and in the rmskin package.

## Variants

- kimai-default: similar to the Kimai webui

![kimai-deafult screenshot](@Resources/Screenshots/kimai-default.png)

- infinibar: fits my hardware monitor skin [infinibar](https://github.com/infeeeee/infinibar)

![infinibar screenshot](@Resources/Screenshots/infinibar.png)

If you have an idea of another variant, just open an issue!

## Installation

### Prerequisites

- Install Rainmeter
- Download this to Rainmeter skin folder
- Rename settings.ini.example to settings.ini and edit
- Enable in rainmeter
- Install Kimai on your server
- Create an API password for your username on your Kimai installation. In Kimai: User menu (Top right corner) -> Edit -> API

### Installation

- Download the rmskin package from [releases](https://github.com/infeeeee/kimai2-cmd-rainmeter/releases/latest)
- Open the rmskin package with Rainmeter, enable the skin
- Click on the Kimai logo, and add your server address and creditentials in the opening new window
- Click on the reload icon to update the skin

## Usage

- Click on the Kimai logo to open yourt Kimai webui in your default browser
- Click on the name of the current active recording or on the 'No active recording' text to show your recent measurements
- Click on one of a recent measurement to restart it
- Click on the ▶️ play button to restart your latest measurement
- Click on the ⏹ stop button to stop your current measurement
- Click on the 🔄 reload button to reload settings from the server. Play and stop also reloads everything, use this button if you made changes on the Kimai webUI
- When you click on the 🔄 reload button it will disappear and only reapper if everything was reloaded successfully.

## Settings

### Kimai specific settings

Settings stored in the `@Resources\kimai2-cmd\settings.ini` file. You can change your server settings here, reload the skin after you modified this file.

### Variant specific settings

- kimai2-default: `kimai2\kimai-default.ini`
- infinibar:
- `@Resources\infinibar`: this files are same as the settings files of the infinibar skin, contains a lot of unnecessary variables
- `kimai2\infinibar.ini`

## Troubleshooting

If the widget is out of sync, try to click on the 🔄 reload button!

The widget only supports single concurrent measurements! If you click on the ⏹ stop button it will stop all ongoing measurement, and it only shows the latter started current measurement.


## Acknowledgments

The font used in the infinibar skin is Accidental Residency, created by Tepid Monkey.

## License

MIT
7 changes: 2 additions & 5 deletions kimai2/infinibar.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
[Metadata]
Name=kimai2-cmd-rainmeter infinibar
Author=infeeeee
Information=All settings are in the Variables.inc file | More info at github: https://github.com/infeeeee/infinibar, Created by UNIGHT(http://unight.deviantart.com/) modded by DISCONNECTVD (http://dscnctvd.deviantart.com/)
Information=All settings are in the Variables.inc file | More info at github: https://github.com/infeeeee/infinibar
License=MIT
Version=0.0.1
Update=1000

[Variables]
activeRecording=Click KIM to setup
serverUrl=[!CommandMeasure MeasureFirstrun "Run"]
activeDur=''

@include=kimaiVars.inc

Expand Down Expand Up @@ -108,8 +106,7 @@ leftmouseupaction=[!hidemeter meterRefreshButton][!CommandMeasure MeasureReload
[meterCurrentProject]
Meter=String
MeterStyle=styleSmallCenter
; Text=[MeasureDuration] #activeRecording#
Text=#activeRecording#
Text=[MeasureActiveTime]#activeRecording#
DynamicVariables=1
ClipString=1
Y=#barY#
Expand Down
4 changes: 2 additions & 2 deletions kimai2/kimai-default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ leftmouseupaction=[!hidemeter meterRefreshButton][!CommandMeasure MeasureReload
Meter=String
MeterStyle=styleSelected
W=250
Text=#activeRecording#
Text=[MeasureActiveTime]#activeRecording#
DynamicVariables=1
ClipString=0
ClipString=1
leftmouseupaction=[!SetVariable MenuVis '0'][!SetVariable activeRecording Select]

@include=kimaiData.inc
36 changes: 21 additions & 15 deletions kimai2/kimaiMeasures.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,27 @@ State=Show
; OutputFile=#CURRENTPATH#log.txt
; OutputType=UTF8

; [MeasureDuration]
; Measure=String
; Formula=#activeRecording#
; IfMatch=No active recording
; IfMatchAction=[!SetVariable activeDur '']
; IfNotMatchAction=[!SetVariable activeDur (MeasureHrs + : + MeasureMins)]
[MeasureCurrTimeMin]
Measure=Time
Format=%M
IfBelowValue=1
IfBelowAction=[!SetVariable activeMins (#activeMins#+60)]

[MeasureStartMin]
Measure=Calc
Formula=MeasureCurrTimeMin
OnUpdateAction=[!PauseMeasure MeasureStartMin]

; [MeasureHrs]
; Measure=Calc
; Formula=#activeHrs#+MeasureHrs+1%25
[MeasureMins]
Measure=Calc
Formula=MeasureCurrTimeMin+#activeMins#-MeasureStartMin
IfAboveValue=59
IfAboveAction=[!SetVariable activeMins (#activeMins#-60)][!SetVariable activeHrs (#activeHrs#+1)]
DynamicVariables=1

; [MeasureMins]
; Measure=Calc
; Formula=MeasureMins >= 0 ? (MeasureMins+1%60) : #activeMins#
; UpdateDivider=60
; IfCondition=MeasureMins = 60
; IfTrueAction=[!SetVariable #activeHrs# (#activeHrs#+1)]
[MeasureActiveTime]
Measure=String
String=#activeHrs#:[MeasureMins]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(:)(\d)$":"\10\2 ","(:\d\d)$":"\1 ","^:00 $":"","#activeHrs#:00":""

0 comments on commit 8855481

Please sign in to comment.