-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
86 lines (66 loc) · 2.11 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# What is this?
This directory holds Flextime, a program for tracking working hours.
The Flextime daemon query D-Bus or X11 for the time since the last
user input once every minute and stores the result on disk. The
flextime program can be used to display the times the user has been
active on the computer. For example:
$ flextime
20200810 07:16:50 — 16:10:22 8:53 | 0:27 w/33 Monday
20200811 13:29:45 — 14:01:18 0:31 | 0:12 w/33 Tuesday
20200812 07:33:21 — 17:22:56 9:49 | 6:22 w/33 Wednesday
20200813 07:54:32 — 15:17:12 7:22 | 3:34 w/33 Thursday
20200814 07:29:37 — 10:38:36 3:08 | 3:08 w/33 Friday
If your working day starts and ends on the computer, this list
effectively represents your working hours.
Just make sure that the Flextime daemon, flextimed, is started every
time you log in.
# Building
`configure` will probe the system for dependencies. On a Fedora 37
system, I had to install the following packages:
```
dnf install protobuf-c-compiler
dnf install protobuf-c-devel
dnf install libXScrnSaver-devel
dnf install glib2-devel
```
Using the follwing commands to find the packages:
```
dnf provides protoc-c
dnf provides "*/protobuf-c/protobuf-c.h"
dnf provides "*/extensions/scrnsaver.h"
dnf provides "*/gio.h"
```
I do not think that there are any runtime dependencies, except for
X11 and D-Bus (optional.)
# Running the daemon
If you are running a Gnome shell, you can use a desktop file in your
~/.config/autostart/ folder to start the Flextime daemon every time
you log in. For example:
```
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Flextime Daemon
Exec=flextimed
Terminal=false
```
To see logs from the daemon you can use the `journalctl` command:
```
journalctl -r _COMM=flextimed
```
# Create a release
```
git checkout <tag>
make clean dist
# upload tgz to Github release
cp flextime-<version>.tar.gz ~/rpmbuild/SOURCES/
cp rpmbuild/flextime.spec ~/rpmbuild/SPECS/
cd ~/rpmbuild/SPECS/
rpmlint
rpmbuild -ba flextime.spec
```
# Testing
```
$ ./flextime --no-local-data --stop "17:00" --mark "07:00;18:00"
20210826 07:00:00 — 17:00:00 10:00 | 0:00 w/NN Weekday
```