summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2026-01-25 18:59:11 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2026-02-07 22:37:16 +0100
commit89c8cf9f5949f0f6a947564748e1d9fb3e45c463 (patch)
treec94f76041dc08b0aa8411763f74edf33491a807d
parent0322144d9b71007fa4cbcdb45c14046a418e6985 (diff)
gnu: Add activity-watch packages.
* gnu/packages/monitoring.scm (aw-source, aw-core, aw-client) (aw-notify, aw-qt, aw-watcher-afk, aw-watcher-input) (aw-watcher-window): New variables. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
-rw-r--r--gnu/packages/monitoring.scm179
1 files changed, 178 insertions, 1 deletions
diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm
index 046dd41f5bb..1c8990de31a 100644
--- a/gnu/packages/monitoring.scm
+++ b/gnu/packages/monitoring.scm
@@ -80,12 +80,189 @@
80 #:use-module (gnu packages python-science) 80 #:use-module (gnu packages python-science)
81 #:use-module (gnu packages python-web) 81 #:use-module (gnu packages python-web)
82 #:use-module (gnu packages python-xyz) 82 #:use-module (gnu packages python-xyz)
83 #:use-module (gnu packages qt)
83 #:use-module (gnu packages rrdtool) 84 #:use-module (gnu packages rrdtool)
84 #:use-module (gnu packages sphinx) 85 #:use-module (gnu packages sphinx)
85 #:use-module (gnu packages time) 86 #:use-module (gnu packages time)
86 #:use-module (gnu packages tls) 87 #:use-module (gnu packages tls)
87 #:use-module (gnu packages web) 88 #:use-module (gnu packages web)
88 #:use-module (gnu packages xml)) 89 #:use-module (gnu packages web)
90 #:use-module (gnu packages xml)
91 #:use-module (gnu packages xorg))
92
93(define aw-source
94 (let ((name "activitywatch")
95 (version "0.13.2"))
96 (origin
97 (method git-fetch)
98 (uri (git-reference
99 (url "https://github.com/ActivityWatch/activitywatch")
100 (commit (string-append "v" version))
101 (recursive? #t)))
102 (file-name (git-file-name name version))
103 (sha256
104 (base32 "0yaa7g35rz9dmgxvahvkfhjpkvmi50rd6bjd9ckxvk7mfs1q0xb7"))
105 (modules '((guix build utils)))
106 (snippet
107 #~(begin
108 ;; Relax platformdirs requirement.
109 (for-each delete-file (find-files "." "poetry\\.lock"))
110 (substitute* "aw-core/pyproject.toml"
111 (("^platformdirs = .*")
112 "platformdirs = \"*\"\n")))))))
113
114(define-public aw-core
115 (package
116 (name "aw-core")
117 (version "0.5.17")
118 (source aw-source)
119 (build-system pyproject-build-system)
120 (arguments
121 (list
122 #:modules
123 '((guix build pyproject-build-system)
124 (guix build utils)
125 (ice-9 ftw)
126 (srfi srfi-1)
127 (srfi srfi-26))
128 #:phases
129 #~(modify-phases %standard-phases
130 (add-after 'unpack 'chdir
131 (lambda* (#:key name #:allow-other-keys)
132 ;; All subprojects are in directories that match their name
133 ;; Here name still contains the version suffixed.
134 (and=> (find (cute string-prefix? <> name) (scandir "."))
135 chdir)))
136 (add-before 'check 'pre-check
137 (lambda _
138 (setenv "HOME" (getcwd)))))))
139 (native-inputs (list python-poetry-core python-pytest))
140 (propagated-inputs
141 (list python-click
142 python-deprecation
143 python-iso8601
144 python-jsonschema
145 python-peewee
146 python-platformdirs
147 python-rfc3339-validator
148 python-strict-rfc3339
149 python-timeslot
150 python-tomlkit))
151 (home-page "https://activitywatch.net/")
152 (synopsis "Core library for ActivityWatch")
153 (description
154 "This package provides the core library for @code{ActivityWatch}.")
155 (license license:mpl2.0)))
156
157(define-public aw-client
158 (package/inherit aw-core
159 (name "aw-client")
160 (version "0.5.15")
161 (arguments
162 (substitute-keyword-arguments (package-arguments aw-core)
163 ((#:test-flags test-flags #~(list))
164 #~(list
165 ;; Most likely requires the server to run.
166 "--deselect=tests/test_client.py::test_full"
167 ;; Tries to read from stdin.
168 "--deselect=tests/test_failqueue.py::test_failqueue"))))
169 (propagated-inputs
170 (list aw-core
171 python-click
172 python-persist-queue
173 python-requests
174 python-tabulate
175 python-typing-extensions))
176 (synopsis "Client library for ActivityWatch")
177 (description
178 "This package provides the c]lient library for @code{ActivityWatch}.")))
179
180(define-public aw-notify
181 (package/inherit aw-core
182 (name "aw-notify")
183 (version "0.0.0") ;unreleased.
184 (arguments
185 (substitute-keyword-arguments (package-arguments aw-core)
186 ((#:tests? tests? #t)
187 #f))) ;No tests.
188 (synopsis "Notify library for ActivityWatch")
189 (description
190 "This package provides the notify library for @code{ActivityWatch}.")))
191
192(define-public aw-qt
193 (package/inherit aw-core
194 (name "aw-qt")
195 (version "0.1.0")
196 (arguments
197 (substitute-keyword-arguments (package-arguments aw-core)
198 ((#:phases phases #~%standard-phases)
199 #~(modify-phases #$phases
200 ;; (delete 'sanity-check)
201 (add-before 'check 'start-xserver
202 (lambda* (#:key inputs #:allow-other-keys)
203 (let* ((Xvfb (search-input-file inputs "/bin/Xvfb"))
204 (display ":1")
205 (command (string-join (list Xvfb display "&") " ")))
206 (setenv "DISPLAY" display)
207 (zero? (system command)))))))
208 ((#:test-backend _ #f)
209 #~'custom)
210 ((#:test-flags _ #~(list))
211 #~(list "tests/integration_tests.py"))))
212 (native-inputs
213 (list python-poetry-core xorg-server-for-tests))
214 (propagated-inputs
215 (list aw-core python-click python-pyqt-6))
216 (synopsis "Trayicon for ActivityWatch")
217 (description
218 "This package provides a tray icon for @code{ActivityWatch}.")))
219
220(define-public aw-watcher-afk
221 (package/inherit aw-core
222 (name "aw-watcher-afk")
223 (version "0.2.0")
224 (arguments
225 (substitute-keyword-arguments (package-arguments aw-core)
226 ((#:tests? tests? #t)
227 #f) ;Most likely requires the server to run.
228 ((#:test-backend _ #f)
229 #~'custom)
230 ((#:test-flags _ #~(list))
231 #~(list "tests/test_continuous_events.py"))))
232 (propagated-inputs
233 (list aw-client python-pynput python-xlib))
234 (synopsis "AFK watcher for ActivityWatch")
235 (description
236 "This package provides a @acronym{AFK, away from keyboard} watcher for
237@code{ActivityWatch}.")))
238
239(define-public aw-watcher-input
240 (package/inherit aw-core
241 (name "aw-watcher-input")
242 (version "0.1.0")
243 (arguments
244 (substitute-keyword-arguments (package-arguments aw-core)
245 ((#:tests? tests? #t)
246 #f))) ;No tests.
247 (propagated-inputs
248 (list aw-client aw-watcher-afk))
249 (synopsis "Input watcher for ActivityWatch")
250 (description
251 "This package provide an input watcher for @code{ActivityWatch}.")))
252
253(define-public aw-watcher-window
254 (package/inherit aw-core
255 (name "aw-watcher-window")
256 (version "0.2.0")
257 (arguments
258 (substitute-keyword-arguments (package-arguments aw-core)
259 ((#:tests? tests? #t)
260 #f))) ;No tests.
261 (propagated-inputs
262 (list aw-client python-xlib))
263 (synopsis "X11 Window watcher for ActivityWatch")
264 (description
265 "This package provides a X11 window watcher for @code{ActivityWatch}.")))
89 266
90(define-public glances 267(define-public glances
91 (package 268 (package