projects/guix·blob java-team · refs

1593 lines · 65.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2026 Sughosha <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages nwg-shell)
20 #:use-module (guix build-system copy)
21 #:use-module (guix build-system go)
22 #:use-module (guix build-system meson)
23 #:use-module (guix build-system pyproject)
24 #:use-module (guix gexp)
25 #:use-module (guix git-download)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages admin)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages bash)
32 #:use-module (gnu packages curl)
33 #:use-module (gnu packages cpp)
34 #:use-module (gnu packages fonts)
35 #:use-module (gnu packages freedesktop)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages geo)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages gnome-xyz)
40 #:use-module (gnu packages golang-graphics)
41 #:use-module (gnu packages golang-xyz)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages imagemagick)
45 #:use-module (gnu packages image-viewers)
46 #:use-module (gnu packages kde-frameworks)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages music)
49 #:use-module (gnu packages networking)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages pulseaudio)
52 #:use-module (gnu packages python-build)
53 #:use-module (gnu packages python-web)
54 #:use-module (gnu packages python-xyz)
55 #:use-module (gnu packages terminals)
56 #:use-module (gnu packages web)
57 #:use-module (gnu packages webkit)
58 #:use-module (gnu packages wm)
59 #:use-module (gnu packages xdisorg)
60 #:use-module (gnu packages xorg)
61 #:use-module (srfi srfi-1))
62
63(define-public nwg-shell-wallpapers
64 (package
65 (name "nwg-shell-wallpapers")
66 (version "1.5")
67 (source
68 (origin
69 (method git-fetch)
70 (uri (git-reference
71 (url "https://github.com/nwg-piotr/nwg-shell-wallpapers")
72 (commit (string-append "v" version))))
73 (file-name (git-file-name name version))
74 (sha256
75 (base32 "0b1k4fnkgzsnq64ziv5bhp930dplacpad6vzqf3w6pabp9xp3skv"))))
76 (build-system copy-build-system)
77 (arguments
78 (list
79 #:install-plan
80 #~`(("wallpapers" "share/backgrounds/nwg-shell")
81 ("README.md" "share/doc/nwg-shell-wallpapers"))))
82 (home-page "https://github.com/nwg-piotr/nwg-shell-wallpapers")
83 (synopsis "Selection of wallpapers contributed to the nwg-shell project")
84 (description
85 "nwg-shell-wallpapers is a selection of wallpapers contributed to the
86nwg-shell project.")
87 (license license:cc0)))
88
89(define-public nwg-hello
90 (package
91 (name "nwg-hello")
92 (version "0.4.4")
93 (source
94 (origin
95 (method git-fetch)
96 (uri (git-reference
97 (url "https://github.com/nwg-piotr/nwg-hello")
98 (commit (string-append "v" version))))
99 (file-name (git-file-name name version))
100 (sha256
101 (base32 "0di77z7sblphk755x96wrl1khfms57g7kvaqril87nxfwh9595aw"))
102 (modules '((guix build utils)))
103 ;; Replace systemd commands with elogind commands.
104 (snippet
105 '(substitute* '("nwg_hello/main.py"
106 "nwg-hello-default.json"
107 "sway-config")
108 (("\"systemctl (-i |)") "\"loginctl ")
109 (("'systemctl (-i |)") "'loginctl ")))))
110 (build-system pyproject-build-system)
111 (arguments
112 (list
113 #:tests? #f ;no tests exist in source
114 #:modules '((guix build pyproject-build-system)
115 (guix build utils)
116 (srfi srfi-26)) ;for cute
117 #:phases
118 #~(modify-phases %standard-phases
119 (delete 'sanity-check)
120 (add-after 'unpack 'patch-paths
121 (lambda _
122 ;; Set file name to the default config and stylesheet.
123 (substitute* "nwg_hello/main.py"
124 (("\\/etc\\/nwg-hello\\/nwg-hello-default\\.(css|json)" all)
125 (string-append #$output all)))
126 ;; Set file name to the default icons.
127 (substitute* "nwg_hello/ui.py"
128 (("\\/usr(.*\\{icon_name\\}-default\\.svg)" _ suffix)
129 (string-append #$output suffix)))
130 ;; Look for sessions, icons, backgrounds and commands in the
131 ;; system profile.
132 (substitute* '("nwg_hello/main.py"
133 "nwg_hello/tools.py"
134 "nwg_hello/ui.py"
135 "nwg-hello-default.css"
136 "nwg-hello-default.json")
137 (("\\/usr") "/run/current-system/profile"))
138 (substitute* '("nwg-hello-default.css"
139 "nwg-hello-default.json")
140 (("\\/usr") #$output))))
141 (add-after 'install 'install-data
142 (lambda _
143 (mkdir-p (string-append #$output "/share"))
144 (copy-recursively "img"
145 (string-append #$output "/share/nwg-hello"))
146 (install-file "nwg.jpg"
147 (string-append #$output "/share/nwg-hello"))
148 (for-each (cute install-file <>
149 (string-append #$output "/etc/nwg-hello"))
150 '("nwg-hello-default.json"
151 "nwg-hello-default.css"
152 "hyprland.conf"
153 "sway-config"))
154 (install-file "README.md"
155 (string-append #$output "/share/doc/nwg-hello"))))
156 (add-after 'create-entrypoints 'wrap-program
157 (lambda _
158 (wrap-program (string-append #$output "/bin/nwg-hello")
159 `("PATH" prefix
160 (,(dirname (which "getent"))))
161 `("GI_TYPELIB_PATH" =
162 (,(getenv "GI_TYPELIB_PATH")))))))))
163 (native-inputs
164 (list gobject-introspection
165 python-setuptools))
166 (inputs
167 (list bash-minimal
168 gtk+
169 gtk-layer-shell
170 python-pygobject))
171 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-hello")
172 (synopsis "GTK3-based greeter for greetd")
173 (description
174 "nwg-hello is a GTK3-based greeter for the @command{greetd} daemon, written
175in Python. It is meant to work under a Wayland compositor, like sway or
176Hyprland.
177
178This application is a part of the nwg-shell project.")
179 (license license:expat)))
180
181(define-public nwg-launchers
182 (package
183 (name "nwg-launchers")
184 (version "0.7.1.1")
185 (source (origin
186 (method git-fetch)
187 (uri (git-reference
188 (url "https://github.com/nwg-piotr/nwg-launchers")
189 (commit (string-append "v" version))))
190 (file-name (git-file-name name version))
191 (sha256
192 (base32
193 "0hq2qiqxvrw3g515ywcb676ljc8mdw3pyslgxr3vahizfljah1pv"))))
194 (build-system meson-build-system)
195 (native-inputs
196 (list nlohmann-json
197 pkg-config))
198 (inputs
199 (list gtk-layer-shell
200 gtkmm-3
201 (librsvg-for-system)))
202 (home-page "https://github.com/nwg-piotr/nwg-launchers")
203 (synopsis "Application launchers for wlroots")
204 (description
205 "This package provides an application grid, button bar, and dmenu
206applications for Sway and other wlroots-based Wayland compositors.")
207 (license license:gpl3+)))
208
209(define-public nwg-bar
210 (package
211 (name "nwg-bar")
212 (version "0.1.6")
213 (source
214 (origin
215 (method git-fetch)
216 (uri (git-reference
217 (url "https://github.com/nwg-piotr/nwg-bar")
218 (commit (string-append "v" version))))
219 (file-name (git-file-name name version))
220 (sha256
221 (base32 "0yds8sivilirw2cqkq621z731l4hragzgpajjls79f4zkwlrdpz4"))
222 (patches
223 (search-patches
224 ;; TODO: Remove this patch in the next update.
225 "nwg-bar-0.1.6-fix-silent-errors.patch"
226 "nwg-bar-0.1.6-fallback-paths.patch"))
227 (modules '((guix build utils)))
228 ;; Replace systemd commands with elogind commands.
229 (snippet
230 '(substitute* "config/bar.json"
231 (("\"systemctl (-i |)") "\"loginctl ")))))
232 (build-system go-build-system)
233 (arguments
234 (list
235 #:install-source? #f
236 #:import-path "github.com/nwg-piotr/nwg-bar"
237 #:phases
238 #~(modify-phases %standard-phases
239 (add-after 'unpack 'patch-paths
240 (lambda _
241 (with-directory-excursion "src/github.com/nwg-piotr/nwg-bar"
242 (substitute* '("tools.go" "config/bar.json")
243 (("\\/usr\\/share") (string-append #$output "/share"))))))
244 (add-after 'install 'install-data
245 (lambda _
246 (mkdir-p (string-append #$output "/share"))
247 (with-directory-excursion (string-append "src/github.com/"
248 "nwg-piotr/nwg-bar")
249 (copy-recursively "config"
250 (string-append #$output "/share/nwg-bar"))
251 (copy-recursively "images"
252 (string-append #$output "/share/nwg-bar/"
253 "images"))
254 (install-file "README.md"
255 (string-append #$output "/share/doc/nwg-bar")))))
256 (add-after 'install 'wrap-program
257 (lambda _
258 (wrap-program (string-append #$output "/bin/nwg-bar")
259 `("GI_TYPELIB_PATH" =
260 (,(getenv "GI_TYPELIB_PATH")))))))))
261 (native-inputs
262 (list gobject-introspection
263 go-github-com-allan-simon-go-singleinstance
264 go-github-com-dlasky-gotk3-layershell
265 go-github-com-gotk3-gotk3
266 go-github-com-joshuarubin-go-sway
267 pkg-config))
268 (inputs
269 (list bash-minimal
270 gtk+
271 gtk-layer-shell))
272 (home-page "https://github.com/nwg-piotr/nwg-bar")
273 (synopsis "GTK3-based button bar for wlroots-based compositors")
274 (description
275 "nwg-bar is a Golang replacement to the @command{nwgbar} command (a part of
276nwg-launchers), with some improvements. Originally aimed at sway, works with
277wlroots-based compositors only.
278
279This application is a part of the nwg-shell project.")
280 (license license:expat)))
281
282(define-public nwg-drawer
283 (package
284 (name "nwg-drawer")
285 (version "0.7.5")
286 (source
287 (origin
288 (method git-fetch)
289 (uri (git-reference
290 (url "https://github.com/nwg-piotr/nwg-drawer")
291 (commit (string-append "v" version))))
292 (file-name (git-file-name name version))
293 (sha256
294 (base32 "1f347n1f9nzqr2ryc49nv74kz6qyh6yk8g2b0rdbd3flgx4kap8v"))
295 (patches
296 (search-patches "nwg-drawer-0.7.5-fallback-paths.patch"))))
297 (build-system go-build-system)
298 (arguments
299 (list
300 #:install-source? #f
301 #:import-path "github.com/nwg-piotr/nwg-drawer"
302 #:phases
303 #~(modify-phases %standard-phases
304 (add-after 'unpack 'patch-paths
305 (lambda* (#:key inputs #:allow-other-keys)
306 (with-directory-excursion "src/github.com/nwg-piotr/nwg-drawer"
307 (substitute* '("main.go" "tools.go")
308 (("\\/usr\\/bin\\/env") (search-input-file inputs "/bin/env"))
309 (("\\/usr\\/share") (string-append #$output "/share"))))))
310 (add-after 'install 'install-data
311 (lambda _
312 (mkdir-p (string-append #$output "/share/nwg-drawer"))
313 (with-directory-excursion (string-append "src/github.com/"
314 "nwg-piotr/"
315 "nwg-drawer")
316 (copy-recursively "desktop-directories"
317 (string-append #$output "/share/"
318 "nwg-drawer/"
319 "desktop-directories"))
320 (copy-recursively "img"
321 (string-append #$output "/share/"
322 "nwg-drawer/img"))
323 (install-file "drawer.css"
324 (string-append #$output "/share/nwg-drawer"))
325 (install-file "README.md"
326 (string-append #$output
327 "/share/doc/nwg-drawer")))))
328 (add-after 'install 'wrap-program
329 (lambda _
330 (wrap-program (string-append #$output "/bin/nwg-drawer")
331 `("PATH" prefix
332 (,(dirname (which "xdg-open"))))
333 `("GI_TYPELIB_PATH" =
334 (,(getenv "GI_TYPELIB_PATH")))))))))
335 (native-inputs
336 (list gobject-introspection
337 go-github-com-allan-simon-go-singleinstance
338 go-github-com-diamondburned-gotk4
339 go-github-com-diamondburned-gotk4-layer-shell
340 go-github-com-expr-lang-expr
341 go-github-com-fsnotify-fsnotify
342 go-github-com-google-shlex
343 go-github-com-joshuarubin-go-sway
344 go-github-com-sirupsen-logrus
345 pkg-config))
346 (inputs
347 (list bash-minimal
348 coreutils-minimal
349 gtk+
350 gtk-layer-shell
351 xdg-utils)) ;for 'xdg-open'
352 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-drawer")
353 (synopsis "Application drawer for wlroots-based Wayland compositors")
354 (description
355 "nwg-drawer is an application launcher. It's being developed with sway and
356Hyprland in mind, but should also work with other wlroots-based Wayland
357compositors.
358
359This application is a part of the nwg-shell project.")
360 (license license:expat)))
361
362(define-public nwg-menu
363 (package
364 (name "nwg-menu")
365 (version "0.1.9")
366 (source
367 (origin
368 (method git-fetch)
369 (uri (git-reference
370 (url "https://github.com/nwg-piotr/nwg-menu")
371 (commit (string-append "v" version))))
372 (file-name (git-file-name name version))
373 (sha256
374 (base32 "19z29v3iym9z0cpw2bhgvc2l5v0x6jgihvrri8ib78ghfgs7rwyx"))
375 (modules '((guix build utils)))
376 ;; Replace systemd commands with elogind commands.
377 (snippet
378 '(substitute* "main.go"
379 (("systemctl ((-i |)poweroff|reboot|suspend)" _ arg)
380 (string-append "loginctl " arg))))))
381 (build-system go-build-system)
382 (arguments
383 (list
384 #:install-source? #f
385 #:import-path "github.com/nwg-piotr/nwg-menu"
386 #:phases
387 #~(modify-phases %standard-phases
388 (add-after 'unpack 'patch-paths
389 (lambda* (#:key inputs #:allow-other-keys)
390 (with-directory-excursion (string-append "src/github.com/"
391 "nwg-piotr/nwg-menu")
392 (substitute* "main.go"
393 (("\\/usr(\\/share\\/nwg-menu)" _ suffix)
394 (string-append #$output suffix)))
395 (substitute* "tools.go"
396 (("\\/usr\\/bin\\/env") (search-input-file inputs "/bin/env"))
397 (("\\/usr\\/share") (string-append #$output "/share"))))))
398 (add-after 'install 'install-data
399 (lambda _
400 (mkdir-p (string-append #$output "/share/nwg-menu"))
401 (with-directory-excursion (string-append "src/github.com/"
402 "nwg-piotr/nwg-menu")
403 (copy-recursively "desktop-directories"
404 (string-append #$output "/share/nwg-menu/"
405 "desktop-directories"))
406 (install-file "menu-start.css"
407 (string-append #$output "/share/nwg-menu"))
408 (install-file "README.md"
409 (string-append #$output
410 "/share/doc/nwg-menu")))))
411
412 (add-after 'install 'wrap-program
413 (lambda _
414 (wrap-program (string-append #$output "/bin/nwg-menu")
415 `("GI_TYPELIB_PATH" =
416 (,(getenv "GI_TYPELIB_PATH")))))))))
417 (native-inputs
418 (list gobject-introspection
419 go-github-com-allan-simon-go-singleinstance
420 go-github-com-dlasky-gotk3-layershell
421 go-github-com-gotk3-gotk3
422 go-github-com-joshuarubin-go-sway
423 go-github-com-sirupsen-logrus
424 pkg-config))
425 (inputs
426 (list bash-minimal
427 coreutils-minimal
428 gtk+
429 gtk-layer-shell))
430 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-menu")
431 (synopsis "MenuStart plugin to nwg-panel")
432 (description
433 "nwg-menu provides the MenuStart plugin to nwg-panel. It also may be used
434standalone, however, with a little help from command line arguments.
435
436This application is a part of the nwg-shell project.")
437 (license license:expat)))
438
439(define-public azote
440 (package
441 (name "azote")
442 (version "1.16.0")
443 (source
444 (origin
445 (method git-fetch)
446 (uri (git-reference
447 (url "https://github.com/nwg-piotr/azote")
448 (commit (string-append "v" version))))
449 (file-name (git-file-name name version))
450 (sha256
451 (base32 "0ka1i3z6ycj8y74lpblxxbmjval8zbskgfs2gnpgwgsypxlqckg1"))))
452 (build-system pyproject-build-system)
453 (arguments
454 (list
455 #:tests? #f ;no tests exist in source
456 #:phases
457 #~(modify-phases %standard-phases
458 (add-after 'unpack 'patch-paths
459 (lambda _
460 (with-directory-excursion "azote"
461 (substitute* "main.py"
462 (("\\/usr\\/bin\\/env bash")
463 (string-append #$(this-package-input "bash-minimal")
464 "/bin/bash"))
465 (("\\/usr(\\/share\\/azote)" _ suffix)
466 (string-append #$output suffix))
467 (("\\/usr(\\/share\\/applications)" _ suffix)
468 (string-append #$output suffix)))
469 (substitute* "tools.py"
470 (("\\/usr(\\/share\\/backgrounds\\/sway)" _ suffix)
471 (string-append #$(this-package-input "sway") suffix))
472 (("\\/usr(\\/share\\/backgrounds\\/nwg-shell)" _ suffix)
473 (string-append #$(this-package-input "nwg-shell-wallpapers")
474 suffix))
475 ;; Looking for mimeinfo.cache in a single directory does not
476 ;; suite well with Guix. Preventing this, Azote uses of the
477 ;; default feh command to preview the wallpapers.
478 (("\\/usr(\\/share\\/applications)" _ suffix)
479 (string-append #$output suffix))))))
480 (add-after 'create-entrypoints 'install-data
481 (lambda _
482 (with-directory-excursion "dist"
483 (install-file "azote.desktop"
484 (string-append #$output "/share/applications"))
485 (install-file "azote.svg"
486 (string-append #$output "/share/pixmaps"))
487 (for-each (lambda (file)
488 (install-file file
489 (string-append #$output
490 "/share/azote")))
491 (find-files "." "indicator.*\\.png$")))
492 (install-file "README.md"
493 (string-append #$output "/share/doc/Azote"))))
494 (add-after 'create-entrypoints 'wrap-program
495 (lambda _
496 (wrap-program (string-append #$output "/bin/azote")
497 `("PATH" ":" prefix
498 (,(dirname (which "cp"))
499 ,(dirname (which "feh"))
500 ,(dirname (which "find"))
501 ,(dirname (which "grim"))
502 ;; TODO: The current version of imagemagick does not contain
503 ;; the magick command. Update it and then add this:
504 ;; ,(dirname (which "magick"))
505 ,(dirname (which "slurp"))
506 ,(dirname (which "swaybg"))
507 ,(dirname (which "wlr-randr"))))
508 `("GI_TYPELIB_PATH" =
509 (,(getenv "GI_TYPELIB_PATH")))))))))
510 ;; These packages are propagated for compositors like Sway or Hyprland to
511 ;; load the backgrounds set by Azote.
512 (propagated-inputs
513 (list gdk-pixbuf ;for GDK_PIXBUF_MODULE_FILE
514 `(,libavif "pixbuf-loader") ;for loading AVIF backgrounds
515 libheif ;for loading HEIF backgrounds
516 `(,libjxl "pixbuf-loader") ;for loading JXL backgrounds
517 swaybg)) ;for ~/.azotebg and ~/.azotebg-hyprland
518 (native-inputs
519 (list gobject-introspection
520 python-setuptools))
521 (inputs
522 (list bash-minimal
523 coreutils-minimal
524 feh
525 findutils
526 grim
527 gtk+
528 imagemagick
529 libappindicator
530 nwg-shell-wallpapers
531 python-pillow
532 python-pillow-avif-plugin
533 python-pillow-heif
534 python-pillow-jxl-plugin
535 python-pycairo
536 python-pygobject
537 python-send2trash
538 python-xlib
539 slurp
540 sway
541 swaybg
542 wlr-randr))
543 (home-page "https://nwg-piotr.github.io/nwg-shell/azote")
544 (synopsis "Wallpaper manager")
545 (description
546 "Azote is a GTK+ 3 based picture browser and background setter, as the
547frontend to the @command{swaybg} (sway/Wayland) and @command{feh} (X windows)
548commands.
549
550This application is a part of the nwg-shell project.")
551 (license (list license:gpl3
552 license:bsd-3)))) ;azote/colorthief.py
553
554(define-public nwg-look
555 (package
556 (name "nwg-look")
557 (version "1.0.6")
558 (source
559 (origin
560 (method git-fetch)
561 (uri (git-reference
562 (url "https://github.com/nwg-piotr/nwg-look")
563 (commit (string-append "v" version))))
564 (file-name (git-file-name name version))
565 (sha256
566 (base32 "1z4hybdfd8d98hy8az7z580a0fx4laf0vfrknjnlpk6xss159mbh"))))
567 (build-system go-build-system)
568 (arguments
569 (list
570 ;Tests fail due to a call having arguments but no formatting
571 ;; directives and wrong types of int and float64.
572 #:tests? #f
573 #:install-source? #f
574 #:import-path "github.com/nwg-piotr/nwg-look"
575 #:phases
576 #~(modify-phases %standard-phases
577 (add-after 'unpack 'patch-paths
578 (lambda _
579 (substitute* "src/github.com/nwg-piotr/nwg-look/tools.go"
580 (("\\/usr\\/share") (string-append #$output "/share")))))
581 (add-after 'install 'install-data
582 (lambda _
583 (with-directory-excursion (string-append "src/github.com/"
584 "nwg-piotr/nwg-look")
585 (install-file "stuff/main.glade"
586 (string-append #$output "/share/nwg-look"))
587 (install-file "stuff/nwg-look.desktop"
588 (string-append #$output "/share/applications"))
589 (install-file "stuff/nwg-look.svg"
590 (string-append #$output "/share/pixmaps"))
591 (copy-recursively "langs"
592 (string-append #$output "/share/nwg-look/"
593 "langs"))
594 (install-file "README.md"
595 (string-append #$output
596 "/share/doc/nwg-look")))))
597 (add-after 'install 'wrap-program
598 (lambda _
599 (wrap-program (string-append #$output "/bin/nwg-look")
600 `("PATH" ":" prefix
601 (,(dirname (which "gsettings"))
602 ,(dirname (which "xcur2png"))))
603 `("GI_TYPELIB_PATH" =
604 (,(getenv "GI_TYPELIB_PATH")))))))))
605 (native-inputs
606 (list gobject-introspection
607 go-github-com-gotk3-gotk3
608 go-github-com-sirupsen-logrus
609 pkg-config))
610 (inputs
611 (list bash-minimal
612 coreutils-minimal
613 `(,glib "bin") ;for 'gsettings'
614 gtk+
615 xcur2png))
616 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-look")
617 (synopsis "GTK3 settings editor for wlroots environment")
618 (description
619 "nwg-look is a GTK3 settings editor, designed to work properly in
620wlroots-based Wayland environment.
621
622This application is a part of the nwg-shell project.")
623 (license license:expat)))
624
625(define-public nwg-displays
626 (package
627 (name "nwg-displays")
628 (version "0.4.0")
629 (source
630 (origin
631 (method git-fetch)
632 (uri (git-reference
633 (url "https://github.com/nwg-piotr/nwg-displays")
634 (commit (string-append "v" version))))
635 (file-name (git-file-name name version))
636 (sha256
637 (base32 "1wgmj933fx4kl83q71phzm67wmkzfp543mb956dzbc5hkrac0nvv"))))
638 (build-system pyproject-build-system)
639 (arguments
640 (list
641 #:tests? #f ;no tests exist in source
642 #:phases
643 #~(modify-phases %standard-phases
644 (delete 'sanity-check)
645 (add-after 'unpack 'patch-paths
646 (lambda _
647 (with-directory-excursion "nwg_displays"
648 (substitute* "tools.py"
649 (("\\//usr(.*nwg-displays\\/.svg)" _ suffix)
650 (string-append #$output suffix)))
651 (substitute* "wallpaper_manager/wallpaper_manager.py"
652 (("\\/usr\\/bin\\/env bash")
653 (string-append #$(this-package-input "bash-minimal")
654 "/bin/bash"))))))
655 (add-after 'create-entrypoints 'install-data
656 (lambda _
657 (install-file "nwg-displays.desktop"
658 (string-append #$output "/share/applications"))
659 (install-file "nwg-displays.svg"
660 (string-append #$output "/share/pixmaps"))
661 (install-file "README.md"
662 (string-append #$output
663 "/share/doc/nwg-displays"))))
664 (add-after 'create-entrypoints 'wrap-programs
665 (lambda _
666 (for-each (lambda (file)
667 (wrap-program file
668 `("PATH" ":" prefix
669 (,(dirname (which "notify-send"))
670 ,(dirname (which "swaybg"))))
671 `("GI_TYPELIB_PATH" =
672 (,(getenv "GI_TYPELIB_PATH")))))
673 (find-files (string-append #$output "/bin"))))))))
674 (native-inputs
675 (list gobject-introspection))
676 (inputs
677 (list bash-minimal
678 gtk+
679 gtk-layer-shell
680 libnotify
681 python-pygobject
682 python-i3ipc
683 swaybg))
684 (home-page "https://github.com/nwg-piotr/nwg-displays")
685 (synopsis "GUI display configuration tool for wlroots compositors")
686 (description
687 "nwg-displays is an output management utility for sway and Hyprland Wayland
688compositor, inspired by wdisplays and wlay.")
689 (license license:expat)))
690
691(define-public nwg-readme-browser
692 (package
693 (name "nwg-readme-browser")
694 (version "0.1.7")
695 (source
696 (origin
697 (method git-fetch)
698 (uri (git-reference
699 (url "https://github.com/nwg-piotr/nwg-readme-browser")
700 (commit (string-append "v" version))))
701 (file-name (git-file-name name version))
702 (sha256
703 (base32 "039f8xdm2i2dyvhk8nw7z3pl552mfg7ncl2amsfqpnn8v6y6vd1q"))))
704 (build-system pyproject-build-system)
705 (arguments
706 (list
707 #:tests? #f ;no tests exist in source
708 #:phases
709 #~(modify-phases %standard-phases
710 (add-after 'unpack 'patch-paths
711 (lambda _
712 ;; Set the default doc directory to the system doc directory.
713 (substitute* "nwg_readme_browser/main.py"
714 (("\\/usr") "/run/current-system/profile"))))
715 (add-after 'create-entrypoints 'install-data
716 (lambda _
717 (install-file "nwg-readme-browser.desktop"
718 (string-append #$output "/share/applications"))
719 (install-file "nwg-readme-browser.svg"
720 (string-append #$output "/share/pixmaps"))
721 (install-file "README.md"
722 (string-append #$output
723 "/share/doc/nwg-readme-browser"))))
724 (add-after 'create-entrypoints 'wrap-program
725 (lambda _
726 (wrap-program (string-append #$output "/bin/nwg-readme-browser")
727 `("GI_TYPELIB_PATH" =
728 (,(getenv "GI_TYPELIB_PATH"))))))
729 (add-before 'sanity-check 'check-setup
730 (lambda _
731 (setenv "HOME" (getcwd)))))))
732 (native-inputs
733 (list gobject-introspection
734 python-setuptools))
735 (inputs
736 (list adwaita-icon-theme
737 bash-minimal
738 gtk+
739 python-docutils
740 python-markdown2
741 python-pygobject
742 webkitgtk-for-gtk3))
743 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-readme-browser")
744 (synopsis "WebKitGTK-based README file browser")
745 (description
746 "nwg-readme-browser was conceived as @acronym{RTFM, Read The Fucking
747Manual} with a graphical user interface. It searches a configurable path for
748@file{README.*} files, and displays them in @code{WebKit2.WebView}. It supports
749@file{.md}, @file{.rst}, @file{.html} and plain text. It does not support
750@file{.pdf} format. Although the program was written with nwg-shell for sway
751and Hyprland in mind, it may also be used standalone.
752
753This application is a part of the nwg-shell project.")
754 (license license:expat)))
755
756(define-public nwg-clipman
757 (package
758 (name "nwg-clipman")
759 (version "0.2.8")
760 (source
761 (origin
762 (method git-fetch)
763 (uri (git-reference
764 (url "https://github.com/nwg-piotr/nwg-clipman")
765 (commit (string-append "v" version))))
766 (file-name (git-file-name name version))
767 (sha256
768 (base32 "1ha3yvdxcid0fgsx28cibc6n20qikc1x9y9hpjv26jc2dkikql0r"))))
769 (build-system pyproject-build-system)
770 (arguments
771 (list
772 #:tests? #f ;no tests exist in source
773 #:phases
774 #~(modify-phases %standard-phases
775 (add-after 'create-entrypoints 'install-data
776 (lambda _
777 (install-file "nwg-clipman.desktop"
778 (string-append #$output "/share/applications"))
779 (install-file "nwg-clipman.svg"
780 (string-append #$output "/share/pixmaps"))
781 (install-file "README.md"
782 (string-append #$output
783 "/share/doc/nwg-clipman"))))
784 (add-after 'create-entrypoints 'wrap-program
785 (lambda _
786 (wrap-program (string-append #$output "/bin/nwg-clipman")
787 `("PATH" ":" prefix
788 (,(dirname (which "cliphist"))
789 ,(dirname (which "wl-copy"))))
790 `("GI_TYPELIB_PATH" =
791 (,(getenv "GI_TYPELIB_PATH"))))))
792 (add-before 'sanity-check 'check-setup
793 (lambda _
794 (setenv "HOME" (getcwd)))))))
795 (native-inputs
796 (list gobject-introspection
797 python-setuptools))
798 (inputs
799 (list bash-minimal
800 cliphist
801 gtk+
802 gtk-layer-shell
803 python-pygobject
804 wl-clipboard))
805 (home-page "https://github.com/nwg-piotr/nwg-clipman")
806 (synopsis "Clipboard manager for nwg-shell")
807 (description
808 "nwg-clipman is a GTK3-based GUI for @command{cliphist}. It provides
809access to previously copied items, as well as management of the clipboard
810history from a window opened on @code{gtk-layer-shell}. The program is intended
811for use with sway, Hyprland and other wlroots-based Wayland compositors.
812
813This application is a part of the nwg-shell project.")
814 (license license:expat)))
815
816(define-public nwg-icon-picker
817 (package
818 (name "nwg-icon-picker")
819 (version "0.1.1")
820 (source
821 (origin
822 (method git-fetch)
823 (uri (git-reference
824 (url "https://github.com/nwg-piotr/nwg-icon-picker")
825 (commit (string-append "v" version))))
826 (file-name (git-file-name name version))
827 (sha256
828 (base32 "0b7mds438br3labjl2c3lpgga5xmypp1a58ygf96kawy5s2wjv8s"))))
829 (build-system pyproject-build-system)
830 (arguments
831 (list
832 #:tests? #f ;no tests exist in source
833 #:phases
834 #~(modify-phases %standard-phases
835 (add-after 'create-entrypoints 'install-data
836 (lambda _
837 (install-file "nwg-icon-picker.desktop"
838 (string-append #$output "/share/applications"))
839 (install-file "nwg-icon-picker.svg"
840 (string-append #$output "/share/pixmaps"))
841 (install-file "README.md"
842 (string-append #$output
843 "/share/doc/nwg-icon-picker"))))
844 (add-after 'create-entrypoints 'wrap-program
845 (lambda _
846 (wrap-program (string-append #$output "/bin/nwg-icon-picker")
847 `("XDG_DATA_DIRS" prefix
848 (,(string-append #$output "/share")))
849 `("GI_TYPELIB_PATH" =
850 (,(getenv "GI_TYPELIB_PATH")))))))))
851 (propagated-inputs
852 (list hicolor-icon-theme))
853 (native-inputs
854 (list gobject-introspection
855 python-setuptools))
856 (inputs
857 (list bash-minimal
858 gtk+
859 python-pygobject))
860 (home-page "https://github.com/nwg-piotr/nwg-icon-picker")
861 (synopsis "GTK icon chooser with a text search option")
862 (description
863 "nwg-icon-picker is intended to work as the icon picker for nwg-panel, but
864it may be used standalone. It displays a window to choose an icon with a
865textual search entry, and returns the icon name. You can also open a file from
866the search result in GIMP or Inkscape, if installed.
867
868This application is a part of the nwg-shell project.")
869 (license license:expat)))
870
871(define-public gopsuinfo
872 (package
873 (name "gopsuinfo")
874 (version "0.1.9")
875 (source
876 (origin
877 (method git-fetch)
878 (uri (git-reference
879 (url "https://github.com/nwg-piotr/gopsuinfo")
880 (commit (string-append "v" version))))
881 (file-name (git-file-name name version))
882 (sha256
883 (base32 "1nv70mgnmq941cc8wldk59kmdkjmwz2bga2f1v5qh3c3p8ww7c64"))))
884 (build-system go-build-system)
885 (arguments
886 (list
887 #:install-source? #f
888 #:import-path "github.com/nwg-piotr/gopsuinfo"
889 #:phases
890 #~(modify-phases %standard-phases
891 (add-after 'unpack 'patch-paths
892 (lambda* (#:key inputs #:allow-other-keys)
893 (substitute* "src/github.com/nwg-piotr/gopsuinfo/gopsuinfo.go"
894 (("\\/usr") #$output))))
895 (add-after 'install 'install-data
896 (lambda _
897 (mkdir-p (string-append #$output "/share/gopsuinfo"))
898 (with-directory-excursion (string-append "src/github.com/"
899 "nwg-piotr/gopsuinfo")
900 (copy-recursively "icons_dark"
901 (string-append #$output "/share/gopsuinfo/"
902 "icons_dark"))
903 (copy-recursively "icons_light"
904 (string-append #$output "/share/gopsuinfo/"
905 "icons_light"))
906 (install-file "README.md"
907 (string-append #$output
908 "/share/doc/gopsuinfo"))))))))
909 (native-inputs
910 (list go-github-com-shirou-gopsutil))
911 (home-page "https://github.com/nwg-piotr/gopsuinfo")
912 (synopsis "Display system usage info as text")
913 (description
914 "gopsuinfo is a Go version of the @command{psuinfo} python script. It
915provides @command{gopsuinfo}, a gopsutil-based command, to display system usage
916info as text in panels like Waybar or icon/text in tint2 and nwg-panel
917executors.
918
919This application is a part of the nwg-shell project.")
920 (license (list license:bsd-2 license:expat)))) ;dual-licensed
921
922(define-public nwg-panel
923 (package
924 (name "nwg-panel")
925 (version "0.10.13")
926 (source
927 (origin
928 (method git-fetch)
929 (uri (git-reference
930 (url "https://github.com/nwg-piotr/nwg-panel")
931 (commit (string-append "v" version))))
932 (file-name (git-file-name name version))
933 (sha256
934 (base32 "1iy528zvk26k48dd8rd1qr69y52nvvhvfv4zfvf821n26r33dwad"))
935 (modules '((guix build utils)))
936 ;; Replace systemd commands with elogind commands.
937 (snippet
938 '(substitute* '("nwg_panel/config.py"
939 "nwg_panel/main.py"
940 "nwg_panel/config/config"
941 "nwg_panel/modules/menu_start.py")
942 (("\"systemctl (-i |)") "\"loginctl ")))))
943 (build-system pyproject-build-system)
944 (arguments
945 (list
946 #:tests? #f ;no tests exist in source
947 #:modules '((guix build pyproject-build-system)
948 (guix build utils)
949 (srfi srfi-26)) ;for cute
950 #:phases
951 #~(modify-phases %standard-phases
952 ;; Sanity check requires a running sway or Hyprland session.
953 (delete 'sanity-check)
954 (add-after 'unpack 'patch-paths
955 (lambda* (#:key inputs #:allow-other-keys)
956 ;; Set default backgrounds directory.
957 (substitute* "nwg_panel/config.py"
958 (("\\/usr(\\/share\\/backgrounds)" _ suffix)
959 (string-append #$(this-package-input "nwg-shell-wallpapers")
960 suffix)))
961 ;; Patch the default data directory.
962 (substitute* '("nwg_panel/icons.py"
963 "nwg_panel/modules/pinned.py")
964 (("\\/usr\\/share") (string-append #$output "/share")))
965 ;; Fix the dbus service.
966 (substitute* "nwg-panel.service"
967 (("\\/bin\\/sh") (search-input-file inputs "/bin/bash"))
968 (("\\/usr") #$output))))
969 (add-after 'create-entrypoints 'install-data
970 (lambda _
971 (for-each (cute install-file <>
972 (string-append #$output "/share/applications"))
973 '("nwg-panel-config.desktop" "nwg-processes.desktop"))
974 (for-each (cute install-file <>
975 (string-append #$output "/share/pixmaps"))
976 '("nwg-panel.svg" "nwg-shell.svg" "nwg-processes.svg"))
977 (install-file "nwg-panel.service"
978 (string-append #$output "/share/dbus-1/services"))
979 (install-file "README.md"
980 (string-append #$output "/share/doc/nwg-panel"))))
981 (add-after 'create-entrypoints 'wrap-programs
982 (lambda _
983 (for-each (lambda (file)
984 (wrap-program file
985 `("PATH" ":" prefix
986 (,(dirname (which "brightnessctl"))
987 ,(dirname (which "curl"))
988 ,(dirname (which "foot"))
989 ,(dirname (which "gopsuinfo"))
990 ,(dirname (which "htop"))
991 ,(dirname (which "nwg-icon-picker"))
992 ,(dirname (which "nwg-menu"))
993 ,(dirname (which "notify-send"))
994 ,(dirname (which "pactl"))
995 ,(dirname (which "pkill"))
996 ,(dirname (which "playerctl"))
997 ,(dirname (which "swaync-client"))
998 ,(dirname (which "wlr-randr"))))
999 `("GI_TYPELIB_PATH" =
1000 (,(getenv "GI_TYPELIB_PATH")))))
1001 (find-files (string-append #$output "/bin"))))))))
1002 (native-inputs
1003 (list gobject-introspection
1004 python-setuptools))
1005 (inputs
1006 (list bash-minimal
1007 curl ;for the default executors
1008 brightnessctl ;for controlling brightness
1009 foot ;for the default executors
1010 gopsuinfo ;for the default executors
1011 gtk+
1012 gtk-layer-shell
1013 hicolor-icon-theme
1014 htop ;for the default executors
1015 libappindicator
1016 libdbusmenu
1017 libnotify
1018 nwg-icon-picker ;for chosing icons for buttons
1019 nwg-menu ;optional plugin
1020 nwg-shell-wallpapers ;for random wallpaper module
1021 playerctl ;optional plugin
1022 procps
1023 pulseaudio ;for controlling audio
1024 python-pycairo
1025 python-dasbus
1026 python-i3ipc
1027 python-psutil
1028 python-pygobject
1029 python-requests
1030 swaynotificationcenter
1031 wlr-randr))
1032 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-panel")
1033 (synopsis "GTK3-based panel for sway and Hyprland")
1034 (description
1035 "nwg-panel is a GTK3-based panel for sway and Hyprland Wayland compositors.
1036The panel is equipped with a graphical configuration program that frees the user
1037from the need to manually edit configuration files.
1038
1039This application is a part of the nwg-shell project.")
1040 (license license:expat)))
1041
1042(define-public nwg-dock
1043 (package
1044 (name "nwg-dock")
1045 (version "0.4.3")
1046 (source
1047 (origin
1048 (method git-fetch)
1049 (uri (git-reference
1050 (url "https://github.com/nwg-piotr/nwg-dock")
1051 (commit (string-append "v" version))))
1052 (file-name (git-file-name name version))
1053 (sha256
1054 (base32 "1gagfm2igbwdsi9f4gs7lmvqjmxvdp0zkm6yl9b0qi7wjnb3hsb2"))
1055 (patches
1056 (search-patches "nwg-dock-0.4.3-fallback-paths.patch"))))
1057 (build-system go-build-system)
1058 (arguments
1059 (list
1060 ;; XXX: nwg-dock/tools.go:980:15: github.com/sirupsen/logrus.Errorf call
1061 ;; has arguments but no formatting directives
1062 #:tests? #f
1063 #:install-source? #f
1064 #:import-path "github.com/nwg-piotr/nwg-dock"
1065 #:phases
1066 #~(modify-phases %standard-phases
1067 (add-after 'unpack 'patch-paths
1068 (lambda _
1069 (with-directory-excursion "src/github.com/nwg-piotr/nwg-dock"
1070 (substitute* '("main.go" "tools.go")
1071 (("\\/usr\\/share") (string-append #$output "/share"))))))
1072 (add-after 'install 'install-data
1073 (lambda _
1074 (mkdir-p (string-append #$output "/share"))
1075 (with-directory-excursion (string-append "src/github.com/"
1076 "nwg-piotr/nwg-dock")
1077 (copy-recursively "config"
1078 (string-append #$output "/share/nwg-dock"))
1079 (copy-recursively "images"
1080 (string-append #$output
1081 "/share/nwg-dock/images"))
1082 (install-file "README.md"
1083 (string-append #$output
1084 "/share/doc/nwg-dock")))))
1085 (add-after 'install 'wrap-program
1086 (lambda _
1087 (wrap-program (string-append #$output "/bin/nwg-dock")
1088 `("GI_TYPELIB_PATH" =
1089 (,(getenv "GI_TYPELIB_PATH")))))))))
1090 (native-inputs
1091 (list gobject-introspection
1092 go-github-com-allan-simon-go-singleinstance
1093 go-github-com-dlasky-gotk3-layershell
1094 go-github-com-gotk3-gotk3
1095 go-github-com-joshuarubin-go-sway
1096 go-github-com-sirupsen-logrus
1097 pkg-config))
1098 (inputs
1099 (list bash-minimal
1100 gtk+
1101 gtk-layer-shell))
1102 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-dock")
1103 (synopsis "GTK3 based dock for sway")
1104 (description
1105 "nwg-dock is a fully configurable (w/ command line arguments and CSS) GTK3
1106based dock, written in Go, aimed exclusively at sway Wayland compositor. It
1107features pinned buttons, task buttons, the workspace switcher and the launcher
1108button.
1109
1110This application is a part of the nwg-shell project.")
1111 (license license:expat)))
1112
1113(define-public nwg-dock-hyprland
1114 (package
1115 (name "nwg-dock-hyprland")
1116 (version "0.4.8")
1117 (source
1118 (origin
1119 (method git-fetch)
1120 (uri (git-reference
1121 (url "https://github.com/nwg-piotr/nwg-dock-hyprland")
1122 (commit (string-append "v" version))))
1123 (file-name (git-file-name name version))
1124 (sha256
1125 (base32 "1cfbrapdiw8qwfcbmyqz6k0q5ny8balzmpwsnp9b3rny2w0cvqkb"))
1126 (patches
1127 (search-patches "nwg-dock-hyprland-0.4.8-fallback-paths.patch"))))
1128 (build-system go-build-system)
1129 (arguments
1130 (list
1131 ;Tests fail due to a call having arguments but no formatting
1132 ;; directives.
1133 #:tests? #f
1134 #:install-source? #f
1135 #:import-path "github.com/nwg-piotr/nwg-dock-hyprland"
1136 #:phases
1137 #~(modify-phases %standard-phases
1138 (add-after 'unpack 'patch-paths
1139 (lambda _
1140 (with-directory-excursion (string-append "src/github.com/"
1141 "nwg-piotr/"
1142 "nwg-dock-hyprland")
1143 (substitute* '("main.go" "tools.go")
1144 (("\\/usr\\/share") (string-append #$output "/share"))))))
1145 (add-after 'install 'install-data
1146 (lambda _
1147 (mkdir-p (string-append #$output "/share"))
1148 (with-directory-excursion (string-append "src/github.com/"
1149 "nwg-piotr/"
1150 "nwg-dock-hyprland")
1151 (copy-recursively "config"
1152 (string-append #$output
1153 "/share/nwg-dock-hyprland"))
1154 (copy-recursively "images"
1155 (string-append #$output "/share/"
1156 "nwg-dock-hyprland/images"))
1157 (install-file "README.md"
1158 (string-append #$output "/share/doc/"
1159 "nwg-dock-hyprland")))))
1160 (add-after 'install 'wrap-program
1161 (lambda _
1162 (wrap-program (string-append #$output "/bin/nwg-dock-hyprland")
1163 `("GI_TYPELIB_PATH" =
1164 (,(getenv "GI_TYPELIB_PATH")))))))))
1165 (native-inputs
1166 (list gobject-introspection
1167 go-github-com-allan-simon-go-singleinstance
1168 go-github-com-diamondburned-gotk4
1169 go-github-com-diamondburned-gotk4-layer-shell
1170 go-github-com-sirupsen-logrus
1171 pkg-config))
1172 (inputs
1173 (list bash-minimal
1174 gtk+
1175 gtk-layer-shell))
1176 (home-page "https://github.com/nwg-piotr/nwg-dock-hyprland")
1177 (synopsis "GTK3 based dock for Hyprland")
1178 (description
1179 "nwg-dock-hyprland is a fully configurable (w/ command line arguments and
1180CSS) GTK3 based dock, written in Go, aimed exclusively at Hyprland Wayland
1181compositor. It features pinned buttons, task buttons, the workspace switcher
1182and the launcher button.
1183
1184This application is a part of the nwg-shell project.")
1185 (license license:expat)))
1186
1187(define-public typobuster
1188 (package
1189 (name "typobuster")
1190 (version "1.0.0")
1191 (source
1192 (origin
1193 (method git-fetch)
1194 (uri (git-reference
1195 (url "https://github.com/nwg-piotr/typobuster")
1196 (commit (string-append "v" version))))
1197 (file-name (git-file-name name version))
1198 (sha256
1199 (base32 "1n8nqfwj9ih1vdzvmlnjp463rnr66ca30sdc7a82g42brmlkk5wv"))))
1200 (build-system pyproject-build-system)
1201 (arguments
1202 (list
1203 #:tests? #f ;no tests exist in source
1204 #:phases
1205 #~(modify-phases %standard-phases
1206 (add-after 'unpack 'patch-paths
1207 (lambda _
1208 (substitute* "typobuster/tools.py"
1209 (("\\/usr\\/share") (string-append #$output "/share")))))
1210 (add-after 'create-entrypoints 'install-data
1211 (lambda _
1212 (install-file "typobuster.desktop"
1213 (string-append #$output "/share/applications"))
1214 (install-file "typobuster.svg"
1215 (string-append #$output "/share/pixmaps"))
1216 (install-file "README.md"
1217 (string-append #$output "/share/doc/typobuster"))))
1218 (add-after 'create-entrypoints 'wrap-program
1219 (lambda _
1220 (wrap-program (string-append #$output "/bin/typobuster")
1221 `("PATH" prefix
1222 (,(dirname (which "gsettings"))))
1223 `("GI_TYPELIB_PATH" prefix
1224 (,(getenv "GI_TYPELIB_PATH")))
1225 `("XDG_DATA_DIRS" prefix
1226 (,(string-append #$(this-package-input "gtksourceview")
1227 "/share")))))))))
1228 (propagated-inputs
1229 ;; avoid runtime error:
1230 ;; No such schema “org.gnome.desktop.interface”
1231 (list gsettings-desktop-schemas))
1232 (native-inputs
1233 (list gobject-introspection
1234 python-setuptools))
1235 (inputs
1236 (list bash-minimal
1237 `(,glib "bin") ;for gsettings
1238 gtk+
1239 gtksourceview-4
1240 python-pycairo
1241 python-pygobject))
1242 (home-page "https://nwg-piotr.github.io/nwg-shell/typobuster")
1243 (synopsis "Text editor with text transformations and auto-correction")
1244 (description
1245 "Typobuster is a simplified text editor with a wide selection of
1246transformations and automatic correction of common typos.
1247
1248This application is a part of the nwg-shell project.")
1249 (license license:gpl3)))
1250
1251(define-public nwg-shell-config
1252 (package
1253 (name "nwg-shell-config")
1254 (version "0.5.64")
1255 (source
1256 (origin
1257 (method git-fetch)
1258 (uri (git-reference
1259 (url "https://github.com/nwg-piotr/nwg-shell-config")
1260 (commit (string-append "v" version))))
1261 (file-name (git-file-name name version))
1262 (sha256
1263 (base32 "0sfh4sbpjf7bf5r2n96jwafzmwwc8yfhlfn5lsms5fq2f3srxyk2"))
1264 (modules '((guix build utils)))
1265 ;; Replace systemd commands with elogind commands.
1266 (snippet
1267 '(with-directory-excursion "nwg_shell_config"
1268 ;; The skeleton files in the store directory is read-only, so do not
1269 ;; install them preserving file permissions.
1270 (substitute* '("hud.py" "tools.py")
1271 (("copy2") "copyfile"))
1272 (substitute* '("locker.py"
1273 "main_hyprland.py"
1274 "main_sway.py"
1275 "ui_components.py"
1276 "shell/custom"
1277 "shell/custom-hyprland"
1278 "shell/settings"
1279 "shell/settings-hyprland")
1280 (("\"systemctl (-i |)") "\"loginctl ")
1281 (("'systemctl (-i |)") "'loginctl "))
1282 ;; Add support for icecat.
1283 (substitute* "ui_components.py"
1284 (("(.*)\"firefox\": \"(MOZ_ENABLE_WAYLAND=1 )firefox\"," all
1285 indent env)
1286 (string-append all "\n" indent "\"icecat\": \"" env "icecat\","))
1287 (("\"firefox\", " all) (string-append all "\"icecat\", ")))))))
1288 (build-system pyproject-build-system)
1289 (arguments
1290 (list
1291 #:tests? #f ;no tests exist in source
1292 #:modules '((guix build pyproject-build-system)
1293 (guix build utils)
1294 (srfi srfi-26)) ;for cute
1295 #:phases
1296 #~(modify-phases %standard-phases
1297 ;; Sanity check requires a running sway or Hyprland session.
1298 (delete 'sanity-check)
1299 (add-after 'unpack 'patch-paths
1300 (lambda _
1301 (with-directory-excursion "nwg_shell_config"
1302 ;; Replace the default backgrounds directory.
1303 (substitute* '("locker.py"
1304 "main_hyprland.py"
1305 "main_sway.py"
1306 "tools.py"
1307 "shell/settings"
1308 "shell/settings-hyprland")
1309 (("\\/usr(\\/share\\/backgrounds)" _ suffix)
1310 (string-append #$(this-package-input "nwg-shell-wallpapers")
1311 suffix)))
1312 ;; Patch path to the pixmaps directory.
1313 (substitute* "tools.py"
1314 (("\\/usr\\/share\\/pixmaps")
1315 (string-append #$output "/share/pixmaps")))
1316 ;; Patch path to swaync
1317 (substitute* '("main_sway.py" "main_hyprland.py")
1318 (("\\/etc\\/xdg\\/swaync" all)
1319 (string-append #$(this-package-input
1320 "swaynotificationcenter") all))))))
1321 (add-after 'install 'install-data
1322 (lambda _
1323 (install-file "nwg-shell-config.desktop"
1324 (string-append #$output "/share/applications"))
1325 (for-each (cute install-file <>
1326 (string-append #$output "/share/pixmaps"))
1327 '("nwg-shell-config.svg"
1328 "nwg-shell-update.svg"
1329 "nwg-shell-translate.svg"
1330 "nwg-update-noupdate.svg"
1331 "nwg-update-available.svg"
1332 "nwg-update-checking.svg"
1333 "nwg-screenshot.svg"
1334 "nwg-3.svg"
1335 "nwg-2.svg"
1336 "nwg-1.svg"
1337 "nwg-workspace.svg"))
1338 (install-file "README.md"
1339 (string-append #$output
1340 "/share/doc/nwg-shell-config"))))
1341 (add-after 'create-entrypoints 'wrap-programs
1342 (lambda _
1343 (with-directory-excursion (string-append #$output "/bin")
1344 (for-each (lambda (file)
1345 (wrap-program file
1346 `("PATH" ":" prefix
1347 (,(string-append #$output "/bin")
1348 ,(dirname (which "foot"))
1349 ,(dirname (which "gtklock"))
1350 ,(dirname (which "killall"))
1351 ,(dirname (which "notify-send"))
1352 ,(dirname (which "pkill"))
1353 ,(dirname (which "playerctl"))
1354 ,(dirname (which "swappy"))
1355 ,(dirname (which "swayidle"))
1356 ,(dirname (which "swaync"))
1357 ,(dirname (which "wlsunset"))))
1358 `("GI_TYPELIB_PATH" =
1359 (,(getenv "GI_TYPELIB_PATH")))))
1360 (find-files "." "nwg.*")))))
1361 (add-after 'wrap 'install-nwg-system-update
1362 (lambda _
1363 ;; TODO: Add an argument to nwg-system-update for updating
1364 ;; Guix and then add a code for it in
1365 ;; nwg_shell_config/update_indicator.py.
1366 (install-file "nwg-system-update"
1367 (string-append #$output "/bin")))))))
1368 (native-inputs
1369 (list gobject-introspection
1370 python-setuptools))
1371 (inputs
1372 (list bash-minimal
1373 foot
1374 gtk+
1375 gtk-layer-shell
1376 gtklock
1377 libappindicator
1378 libnotify
1379 nwg-shell-wallpapers
1380 playerctl
1381 procps
1382 psmisc
1383 python-geopy
1384 python-i3ipc
1385 python-pygobject
1386 python-psutil
1387 python-requests
1388 swappy
1389 swayidle
1390 swaynotificationcenter
1391 wlsunset))
1392 (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-shell-config")
1393 (synopsis "nwg-shell configuration utility")
1394 (description
1395 "nwg-shell-config utility provides a graphical user interface for
1396configuring sway and Hyprland Wayland compositors in nwg-shell.
1397
1398This application is a part of the nwg-shell project.")
1399 (license license:expat)))
1400
1401;; nwg-shell meta package
1402(define-public nwg-shell
1403 (package
1404 (name "nwg-shell")
1405 (version "0.5.50")
1406 (source
1407 (origin
1408 (method git-fetch)
1409 (uri (git-reference
1410 (url "https://github.com/nwg-piotr/nwg-shell")
1411 (commit (string-append "v" version))))
1412 (file-name (git-file-name name version))
1413 (sha256
1414 (base32 "1qb4k1w3ycp0n8gwfnk2nmxn8gxa6aab1hg3527x514yck3w1zcp"))
1415 (modules '((guix build utils)))
1416 (snippet
1417 '(with-directory-excursion "nwg_shell"
1418 ;; The skeleton files in /gnu/store directory are read-only, so make
1419 ;; the installer install the configuration files without preserving
1420 ;; permissions and then make make azotebg executable.
1421 (substitute* "installer.py"
1422 (("copy, copy2") "copyfile, copy")
1423 (("copy\\(") "copyfile(")
1424 (("copy2\\(") "copyfile(")
1425 (("import os" all) (string-append all "\nimport stat"))
1426 (("(.* )copyfile\\(.*\\(.*\"azotebg\"\\), bcg\\)" all indent)
1427 (string-append all "\n" indent "st = os.stat(bcg)" "\n" indent
1428 "os.chmod(bcg, st.st_mode | stat.S_IEXEC)"))
1429 ;; Copy .azotebg to .azotebg-hyprland preserving permissions.
1430 (("copyfile(\\(.*\"\\.azotebg-hyprland\"\\))" _ suffix)
1431 (string-append "copy" suffix)))
1432 ;; Replace systemd commands with elogind commands.
1433 (substitute* '("installer.py"
1434 "skel/data/nwg-shell-config/settings"
1435 "skel/data/nwg-shell-config/settings-hyprland"
1436 "skel/config/sway/config"
1437 "skel/config/nwg-panel/hyprland-0"
1438 "skel/config/nwg-panel/hyprland-1"
1439 "skel/config/nwg-panel/hyprland-2"
1440 "skel/config/nwg-panel/hyprland-3"
1441 "skel/config/nwg-panel/preset-0"
1442 "skel/config/nwg-panel/preset-1"
1443 "skel/config/nwg-panel/preset-2"
1444 "skel/config/nwg-panel/preset-3"
1445 "skel/config/hypr/hyprland.conf")
1446 (("\"systemctl (-i |)") "\"loginctl "))
1447 (substitute* '("skel/config/sway/config"
1448 "skel/config/hypr/hyprland.conf")
1449 ;; Disable importing environment variables for systemd.
1450 ((".*systemctl --user import-environment.*") "")
1451 ;; Disable updating environment variables for systemd.
1452 ((".*dbus-update-activation-environment --systemd.*") "")
1453 ;; Disable executing polkit-gnome-authentication-agent-1. Since it
1454 ;; is not available in $PATH, it is difficult to predict in which
1455 ;; profile it is installed. So let users enable it and set the
1456 ;; path manually.
1457 (("exec (= |)\\/usr\\/lib\\/polkit-gnome" all)
1458 (string-append "#" all)))
1459 ;; Replace firefox with icecat.
1460 (substitute* '("skel/config/foot/foot.ini"
1461 "skel/config/sway/config")
1462 (("firefox") "icecat"))
1463 (substitute* "installer.py"
1464 ;; Add an entry for icecat browser.
1465 (("\"firefox\", " all) (string-append all "\"icecat\", "))
1466 ;; Add support to the icecat browser.
1467 ((" \"firefox\": \"firefox\"," all)
1468 (string-append all "\n \"icecat\": \"icecat\",\n"))
1469 ;; Remove Arch Linux related line from the warning.
1470 ((".*on a fresh Arch Linux installation.*") ""))))))
1471 (build-system pyproject-build-system)
1472 (arguments
1473 (list
1474 #:tests? #f ;no tests exist in source
1475 #:phases
1476 #~(modify-phases %standard-phases
1477 (add-after 'unpack 'patch-paths
1478 (lambda _
1479 (with-directory-excursion "nwg_shell/skel"
1480 ;; Patch path to the nwg-shell backgrounds directory.
1481 (substitute* '("data/nwg-shell-config/settings"
1482 "data/nwg-shell-config/settings-hyprland"
1483 "config/nwg-panel/hyprland-0"
1484 "config/nwg-panel/preset-0")
1485 (("\\/usr(\\/share\\/backgrounds\\/nwg-shell)" _ suffix)
1486 (string-append #$(this-package-input "nwg-shell-wallpapers")
1487 suffix)))
1488 ;; Patch path to backgrounds directory.
1489 (substitute* "stuff/azotebg"
1490 (("\\/usr") #$output)))))
1491 (add-after 'create-entrypoints 'install-scripts
1492 (lambda _
1493 (install-file "scripts/screenshot"
1494 (string-append #$output "/bin"))))
1495 (add-after 'install-scripts 'install-data
1496 (lambda _
1497 (install-file "nwg-shell.jpg"
1498 (string-append #$output "/share/backgrounds"))
1499 (install-file "README.md"
1500 (string-append #$output
1501 "/share/doc/nwg-shell"))))
1502 (add-after 'install-data 'wrap-programs
1503 (lambda _
1504 (with-directory-excursion (string-append #$output "/bin")
1505 (wrap-program "nwg-shell-installer"
1506 `("PATH" prefix
1507 (,(dirname (which "localectl")))))
1508 (wrap-program (string-append #$output "/bin/screenshot")
1509 `("PATH" ":" prefix
1510 (,(dirname (which "echo"))
1511 ,(dirname (which "grim"))
1512 ,(dirname (which "jq"))
1513 ,(dirname (which "notify-send"))
1514 ,(dirname (which "slurp"))
1515 ,(dirname (which "swappy"))
1516 ,(dirname (which "wl-copy"))
1517 ,(dirname (which "xdg-user-dir"))))))
1518 )))))
1519 (propagated-inputs
1520 (list adwaita-icon-theme
1521 azote
1522 blueman
1523 brightnessctl
1524 cliphist
1525 font-abattis-cantarell
1526 foot
1527 gdk-pixbuf ;for GDK_PIXBUF_MODULE_FILE
1528 gnome-themes-extra
1529 gopsuinfo
1530 gsettings-desktop-schemas
1531 gtklock
1532 i3-autotiling
1533 kstatusnotifieritem
1534 `(,libavif "pixbuf-loader") ;for loading AVIF backgrounds
1535 libheif ;for loading HEIF backgrounds
1536 `(,libjxl "pixbuf-loader") ;for loading JXL backgrounds
1537 network-manager-applet
1538 nwg-bar
1539 nwg-clipman
1540 nwg-displays
1541 nwg-dock
1542 nwg-dock-hyprland
1543 nwg-drawer
1544 nwg-icon-picker
1545 nwg-look
1546 nwg-menu
1547 nwg-panel
1548 nwg-readme-browser
1549 nwg-shell-config
1550 nwg-shell-wallpapers
1551 papirus-icon-theme
1552 pulseaudio
1553 playerctl
1554 swaybg
1555 swayidle
1556 swaynotificationcenter
1557 wl-clipboard
1558 wlsunset))
1559 (native-inputs
1560 (list python-setuptools))
1561 (inputs
1562 (list bash-minimal
1563 coreutils-minimal
1564 grim
1565 jq
1566 libnotify
1567 localed
1568 slurp
1569 swappy
1570 wl-clipboard
1571 xdg-user-dirs))
1572 (home-page "https://nwg-piotr.github.io/nwg-shell/")
1573 (synopsis "GTK3-based shell for sway and Hyprland Wayland compositors")
1574 (description
1575 "nwg-shell is a GTK3-based shell for sway and Hyprland Wayland compositors.
1576The project provides a common configuration tool (nwg-shell-config) that allows
1577you to configure the system in a graphical UI, and a range of components such as
1578nwg-panel (system panel), nwg-drawer (application launcher), nwg-dock (system
1579dock) or nwg-menu (XDG-style menu). It also includes several native tools as
1580nwg-look (look and feel GTK settings editor), nwg-displays (display
1581configuration tool), Azote (wallpaper manager), nwg-clipman (clipboard history
1582manager), nwg-icon-picker (icon browser with textual search), nwg-readme-browser
1583(documentation viewer) and nwg-hello (login manager). Scripts and utilities
1584such as autotiling (script for sway to automatically switch the horizontal /
1585vertical window split orientation) and gopsuinfo (a command to display system
1586usage info) are used in the background. The shell also utilizes third party
1587software as swaync (notification center), gtklock / swaylock (screen lockers)
1588and more.
1589
1590This package acts as a metapackage and installer of default configuration
1591files.")
1592 (license (list license:expat
1593 license:cc-by4.0)))) ;for the graphics