summaryrefslogtreecommitdiff
path: root/gnu/packages/nwg-shell.scm
blob: 5627e0c50cf4e9e4212f52f7602e1cdd2a41bd17 (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2026 Sughosha <sughosha@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages nwg-shell)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system go)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system pyproject)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages fonts)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages geo)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnome-xyz)
  #:use-module (gnu packages golang-graphics)
  #:use-module (gnu packages golang-xyz)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages image)
  #:use-module (gnu packages imagemagick)
  #:use-module (gnu packages image-viewers)
  #:use-module (gnu packages kde-frameworks)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages music)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python-build)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages terminals)
  #:use-module (gnu packages web)
  #:use-module (gnu packages webkit)
  #:use-module (gnu packages wm)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xorg)
  #:use-module (srfi srfi-1))

(define-public nwg-shell-wallpapers
  (package
    (name "nwg-shell-wallpapers")
    (version "1.5")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-shell-wallpapers")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0b1k4fnkgzsnq64ziv5bhp930dplacpad6vzqf3w6pabp9xp3skv"))))
    (build-system copy-build-system)
    (arguments
     (list
      #:install-plan
      #~`(("wallpapers" "share/backgrounds/nwg-shell")
          ("README.md" "share/doc/nwg-shell-wallpapers"))))
    (home-page "https://github.com/nwg-piotr/nwg-shell-wallpapers")
    (synopsis "Selection of wallpapers contributed to the nwg-shell project")
    (description
     "nwg-shell-wallpapers is a selection of wallpapers contributed to the
nwg-shell project.")
    (license license:cc0)))

(define-public nwg-hello
  (package
    (name "nwg-hello")
    (version "0.4.4")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-hello")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0di77z7sblphk755x96wrl1khfms57g7kvaqril87nxfwh9595aw"))
       (modules '((guix build utils)))
       ;; Replace systemd commands with elogind commands.
       (snippet
        '(substitute* '("nwg_hello/main.py"
                        "nwg-hello-default.json"
                        "sway-config")
           (("\"systemctl (-i |)") "\"loginctl ")
           (("'systemctl (-i |)") "'loginctl ")))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:modules '((guix build pyproject-build-system)
                  (guix build utils)
                  (srfi srfi-26))                     ;for cute
      #:phases
      #~(modify-phases %standard-phases
          (delete 'sanity-check)
          (add-after 'unpack 'patch-paths
            (lambda _
              ;; Set file name to the default config and stylesheet.
              (substitute* "nwg_hello/main.py"
                (("\\/etc\\/nwg-hello\\/nwg-hello-default\\.(css|json)" all)
                 (string-append #$output all)))
              ;; Set file name to the default icons.
              (substitute* "nwg_hello/ui.py"
                (("\\/usr(.*\\{icon_name\\}-default\\.svg)" _ suffix)
                 (string-append #$output suffix)))
              ;; Look for sessions, icons, backgrounds and commands in the
              ;; system profile.
              (substitute* '("nwg_hello/main.py"
                             "nwg_hello/tools.py"
                             "nwg_hello/ui.py"
                             "nwg-hello-default.css"
                             "nwg-hello-default.json")
                (("\\/usr") "/run/current-system/profile"))
              (substitute* '("nwg-hello-default.css"
                             "nwg-hello-default.json")
                (("\\/usr") #$output))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share"))
              (copy-recursively "img"
                                (string-append #$output "/share/nwg-hello"))
              (install-file "nwg.jpg"
                            (string-append #$output "/share/nwg-hello"))
              (for-each (cute install-file <>
                              (string-append #$output "/etc/nwg-hello"))
                        '("nwg-hello-default.json"
                          "nwg-hello-default.css"
                          "hyprland.conf"
                          "sway-config"))
              (install-file "README.md"
                            (string-append #$output "/share/doc/nwg-hello"))))
          (add-after 'create-entrypoints 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-hello")
                `("PATH" prefix
                  (,(dirname (which "getent"))))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           gtk+
           gtk-layer-shell
           python-pygobject))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-hello")
    (synopsis "GTK3-based greeter for greetd")
    (description
     "nwg-hello is a GTK3-based greeter for the @command{greetd} daemon, written
in Python.  It is meant to work under a Wayland compositor, like sway or
Hyprland.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-launchers
  (package
    (name "nwg-launchers")
    (version "0.7.1.1")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/nwg-piotr/nwg-launchers")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0hq2qiqxvrw3g515ywcb676ljc8mdw3pyslgxr3vahizfljah1pv"))))
    (build-system meson-build-system)
    (native-inputs
     (list nlohmann-json
           pkg-config))
    (inputs
     (list gtk-layer-shell
           gtkmm-3
           (librsvg-for-system)))
    (home-page "https://github.com/nwg-piotr/nwg-launchers")
    (synopsis "Application launchers for wlroots")
    (description
     "This package provides an application grid, button bar, and dmenu
applications for Sway and other wlroots-based Wayland compositors.")
    (license license:gpl3+)))

(define-public nwg-bar
  (package
    (name "nwg-bar")
    (version "0.1.6")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-bar")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0yds8sivilirw2cqkq621z731l4hragzgpajjls79f4zkwlrdpz4"))
       (patches
        (search-patches
         ;; TODO: Remove this patch in the next update.
         "nwg-bar-0.1.6-fix-silent-errors.patch"
         "nwg-bar-0.1.6-fallback-paths.patch"))
       (modules '((guix build utils)))
       ;; Replace systemd commands with elogind commands.
       (snippet
        '(substitute* "config/bar.json"
           (("\"systemctl (-i |)") "\"loginctl ")))))
    (build-system go-build-system)
    (arguments
     (list
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/nwg-bar"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion "src/github.com/nwg-piotr/nwg-bar"
                (substitute* '("tools.go" "config/bar.json")
                  (("\\/usr\\/share") (string-append #$output "/share"))))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share"))
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/nwg-bar")
                (copy-recursively "config"
                                  (string-append #$output "/share/nwg-bar"))
                (copy-recursively "images"
                                  (string-append #$output "/share/nwg-bar/"
                                                 "images"))
                (install-file "README.md"
                              (string-append #$output "/share/doc/nwg-bar")))))
          (add-after 'install 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-bar")
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
     (list gobject-introspection
           go-github-com-allan-simon-go-singleinstance
           go-github-com-dlasky-gotk3-layershell
           go-github-com-gotk3-gotk3
           go-github-com-joshuarubin-go-sway
           pkg-config))
    (inputs
     (list bash-minimal
           gtk+
           gtk-layer-shell))
    (home-page "https://github.com/nwg-piotr/nwg-bar")
    (synopsis "GTK3-based button bar for wlroots-based compositors")
    (description
     "nwg-bar is a Golang replacement to the @command{nwgbar} command (a part of
nwg-launchers), with some improvements.  Originally aimed at sway, works with
wlroots-based compositors only.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-drawer
  (package
    (name "nwg-drawer")
    (version "0.7.5")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-drawer")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1f347n1f9nzqr2ryc49nv74kz6qyh6yk8g2b0rdbd3flgx4kap8v"))
       (patches
        (search-patches "nwg-drawer-0.7.5-fallback-paths.patch"))))
    (build-system go-build-system)
    (arguments
     (list
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/nwg-drawer"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion "src/github.com/nwg-piotr/nwg-drawer"
                (substitute* '("main.go" "tools.go")
                  (("\\/usr\\/bin\\/env") (search-input-file inputs "/bin/env"))
                  (("\\/usr\\/share") (string-append #$output "/share"))))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share/nwg-drawer"))
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/"
                                                       "nwg-drawer")
                (copy-recursively "desktop-directories"
                                  (string-append #$output "/share/"
                                                 "nwg-drawer/"
                                                 "desktop-directories"))
                (copy-recursively "img"
                                  (string-append #$output "/share/"
                                                 "nwg-drawer/img"))
                (install-file "drawer.css"
                              (string-append #$output "/share/nwg-drawer"))
                (install-file "README.md"
                              (string-append #$output
                                             "/share/doc/nwg-drawer")))))
          (add-after 'install 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-drawer")
                `("PATH" prefix
                  (,(dirname (which "xdg-open"))))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
     (list gobject-introspection
           go-github-com-allan-simon-go-singleinstance
           go-github-com-diamondburned-gotk4
           go-github-com-diamondburned-gotk4-layer-shell
           go-github-com-expr-lang-expr
           go-github-com-fsnotify-fsnotify
           go-github-com-google-shlex
           go-github-com-joshuarubin-go-sway
           go-github-com-sirupsen-logrus
           pkg-config))
    (inputs
     (list bash-minimal
           coreutils-minimal
           gtk+
           gtk-layer-shell
           xdg-utils))       ;for 'xdg-open'
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-drawer")
    (synopsis "Application drawer for wlroots-based Wayland compositors")
    (description
     "nwg-drawer is an application launcher.  It's being developed with sway and
Hyprland in mind, but should also work with other wlroots-based Wayland
compositors.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-menu
  (package
    (name "nwg-menu")
    (version "0.1.9")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-menu")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "19z29v3iym9z0cpw2bhgvc2l5v0x6jgihvrri8ib78ghfgs7rwyx"))
       (modules '((guix build utils)))
       ;; Replace systemd commands with elogind commands.
       (snippet
        '(substitute* "main.go"
           (("systemctl ((-i |)poweroff|reboot|suspend)" _ arg)
            (string-append "loginctl " arg))))))
    (build-system go-build-system)
    (arguments
     (list
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/nwg-menu"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/nwg-menu")
                (substitute* "main.go"
                  (("\\/usr(\\/share\\/nwg-menu)" _ suffix)
                   (string-append #$output suffix)))
                (substitute* "tools.go"
                  (("\\/usr\\/bin\\/env") (search-input-file inputs "/bin/env"))
                  (("\\/usr\\/share") (string-append #$output "/share"))))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share/nwg-menu"))
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/nwg-menu")
                (copy-recursively "desktop-directories"
                                  (string-append #$output "/share/nwg-menu/"
                                                 "desktop-directories"))
                (install-file "menu-start.css"
                              (string-append #$output "/share/nwg-menu"))
                (install-file "README.md"
                              (string-append #$output
                                             "/share/doc/nwg-menu")))))

          (add-after 'install 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-menu")
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
     (list gobject-introspection
           go-github-com-allan-simon-go-singleinstance
           go-github-com-dlasky-gotk3-layershell
           go-github-com-gotk3-gotk3
           go-github-com-joshuarubin-go-sway
           go-github-com-sirupsen-logrus
           pkg-config))
    (inputs
     (list bash-minimal
           coreutils-minimal
           gtk+
           gtk-layer-shell))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-menu")
    (synopsis "MenuStart plugin to nwg-panel")
    (description
     "nwg-menu provides the MenuStart plugin to nwg-panel.  It also may be used
standalone, however, with a little help from command line arguments.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public azote
  (package
    (name "azote")
    (version "1.16.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/azote")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0ka1i3z6ycj8y74lpblxxbmjval8zbskgfs2gnpgwgsypxlqckg1"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion "azote"
                (substitute* "main.py"
                  (("\\/usr\\/bin\\/env bash")
                   (string-append #$(this-package-input "bash-minimal")
                                  "/bin/bash"))
                  (("\\/usr(\\/share\\/azote)" _ suffix)
                   (string-append #$output suffix))
                  (("\\/usr(\\/share\\/applications)" _ suffix)
                   (string-append #$output suffix)))
                (substitute* "tools.py"
                  (("\\/usr(\\/share\\/backgrounds\\/sway)" _ suffix)
                   (string-append #$(this-package-input "sway") suffix))
                  (("\\/usr(\\/share\\/backgrounds\\/nwg-shell)" _ suffix)
                   (string-append #$(this-package-input "nwg-shell-wallpapers")
                                  suffix))
                  ;; Looking for mimeinfo.cache in a single directory does not
                  ;; suite well with Guix.  Preventing this, Azote uses of the
                  ;; default feh command to preview the wallpapers.
                  (("\\/usr(\\/share\\/applications)" _ suffix)
                   (string-append #$output suffix))))))
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (with-directory-excursion "dist"
                (install-file "azote.desktop"
                              (string-append #$output "/share/applications"))
                (install-file "azote.svg"
                              (string-append #$output "/share/pixmaps"))
                (for-each (lambda (file)
                            (install-file file
                                          (string-append #$output
                                                         "/share/azote")))
                          (find-files "." "indicator.*\\.png$")))
              (install-file "README.md"
                            (string-append #$output "/share/doc/Azote"))))
          (add-after 'create-entrypoints 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/azote")
                `("PATH" ":" prefix
                  (,(dirname (which "cp"))
                   ,(dirname (which "feh"))
                   ,(dirname (which "find"))
                   ,(dirname (which "grim"))
                   ;; TODO: The current version of imagemagick does not contain
                   ;; the magick command.  Update it and then add this:
                   ;; ,(dirname (which "magick"))
                   ,(dirname (which "slurp"))
                   ,(dirname (which "swaybg"))
                   ,(dirname (which "wlr-randr"))))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    ;; These packages are propagated for compositors like Sway or Hyprland to
    ;; load the backgrounds set by Azote.
    (propagated-inputs
     (list gdk-pixbuf                  ;for GDK_PIXBUF_MODULE_FILE
           `(,libavif "pixbuf-loader") ;for loading AVIF backgrounds
           libheif                     ;for loading HEIF backgrounds
           `(,libjxl "pixbuf-loader")  ;for loading JXL backgrounds
           swaybg))                    ;for ~/.azotebg and ~/.azotebg-hyprland
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           coreutils-minimal
           feh
           findutils
           grim
           gtk+
           imagemagick
           libappindicator
           nwg-shell-wallpapers
           python-pillow
           python-pillow-avif-plugin
           python-pillow-heif
           python-pillow-jxl-plugin
           python-pycairo
           python-pygobject
           python-send2trash
           python-xlib
           slurp
           sway
           swaybg
           wlr-randr))
    (home-page "https://nwg-piotr.github.io/nwg-shell/azote")
    (synopsis "Wallpaper manager")
    (description
     "Azote is a GTK+ 3 based picture browser and background setter, as the
frontend to the @command{swaybg} (sway/Wayland) and @command{feh} (X windows)
commands.

This application is a part of the nwg-shell project.")
    (license (list license:gpl3
                   license:bsd-3)))) ;azote/colorthief.py

(define-public nwg-look
  (package
    (name "nwg-look")
    (version "1.0.6")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-look")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1z4hybdfd8d98hy8az7z580a0fx4laf0vfrknjnlpk6xss159mbh"))))
    (build-system go-build-system)
    (arguments
     (list
       ;Tests fail due to a call having arguments but no formatting
      ;; directives and wrong types of int and float64.
      #:tests? #f
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/nwg-look"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (substitute* "src/github.com/nwg-piotr/nwg-look/tools.go"
                (("\\/usr\\/share") (string-append #$output "/share")))))
          (add-after 'install 'install-data
            (lambda _
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/nwg-look")
                (install-file "stuff/main.glade"
                              (string-append #$output "/share/nwg-look"))
                (install-file "stuff/nwg-look.desktop"
                              (string-append #$output "/share/applications"))
                (install-file "stuff/nwg-look.svg"
                              (string-append #$output "/share/pixmaps"))
                (copy-recursively "langs"
                                  (string-append #$output "/share/nwg-look/"
                                                 "langs"))
                (install-file "README.md"
                              (string-append #$output
                                             "/share/doc/nwg-look")))))
          (add-after 'install 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-look")
                `("PATH" ":" prefix
                  (,(dirname (which "gsettings"))
                   ,(dirname (which "xcur2png"))))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
     (list gobject-introspection
           go-github-com-gotk3-gotk3
           go-github-com-sirupsen-logrus
           pkg-config))
    (inputs
     (list bash-minimal
           coreutils-minimal
           `(,glib "bin")    ;for 'gsettings'
           gtk+
           xcur2png))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-look")
    (synopsis "GTK3 settings editor for wlroots environment")
    (description
     "nwg-look is a GTK3 settings editor, designed to work properly in
wlroots-based Wayland environment.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-displays
  (package
    (name "nwg-displays")
    (version "0.4.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-displays")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1wgmj933fx4kl83q71phzm67wmkzfp543mb956dzbc5hkrac0nvv"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (delete 'sanity-check)
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion "nwg_displays"
                (substitute* "tools.py"
                  (("\\//usr(.*nwg-displays\\/.svg)" _ suffix)
                   (string-append #$output suffix)))
                (substitute* "wallpaper_manager/wallpaper_manager.py"
                  (("\\/usr\\/bin\\/env bash")
                   (string-append #$(this-package-input "bash-minimal")
                                  "/bin/bash"))))))
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (install-file "nwg-displays.desktop"
                            (string-append #$output "/share/applications"))
              (install-file "nwg-displays.svg"
                            (string-append #$output "/share/pixmaps"))
              (install-file "README.md"
                            (string-append #$output
                                           "/share/doc/nwg-displays"))))
          (add-after 'create-entrypoints 'wrap-programs
            (lambda _
              (for-each (lambda (file)
                          (wrap-program file
                            `("PATH" ":" prefix
                              (,(dirname (which "notify-send"))
                               ,(dirname (which "swaybg"))))
                            `("GI_TYPELIB_PATH" =
                              (,(getenv "GI_TYPELIB_PATH")))))
                        (find-files (string-append #$output "/bin"))))))))
    (native-inputs
     (list gobject-introspection))
    (inputs
     (list bash-minimal
           gtk+
           gtk-layer-shell
           libnotify
           python-pygobject
           python-i3ipc
           swaybg))
    (home-page "https://github.com/nwg-piotr/nwg-displays")
    (synopsis "GUI display configuration tool for wlroots compositors")
    (description
     "nwg-displays is an output management utility for sway and Hyprland Wayland
compositor, inspired by wdisplays and wlay.")
    (license license:expat)))

(define-public nwg-readme-browser
  (package
    (name "nwg-readme-browser")
    (version "0.1.7")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-readme-browser")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "039f8xdm2i2dyvhk8nw7z3pl552mfg7ncl2amsfqpnn8v6y6vd1q"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              ;; Set the default doc directory to the system doc directory.
              (substitute* "nwg_readme_browser/main.py"
                (("\\/usr") "/run/current-system/profile"))))
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (install-file "nwg-readme-browser.desktop"
                            (string-append #$output "/share/applications"))
              (install-file "nwg-readme-browser.svg"
                            (string-append #$output "/share/pixmaps"))
              (install-file "README.md"
                            (string-append #$output
                                           "/share/doc/nwg-readme-browser"))))
          (add-after 'create-entrypoints 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-readme-browser")
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH"))))))
          (add-before 'sanity-check 'check-setup
            (lambda _
              (setenv "HOME" (getcwd)))))))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list adwaita-icon-theme
           bash-minimal
           gtk+
           python-docutils
           python-markdown2
           python-pygobject
           webkitgtk-for-gtk3))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-readme-browser")
    (synopsis "WebKitGTK-based README file browser")
    (description
     "nwg-readme-browser was conceived as @acronym{RTFM, Read The Fucking
Manual} with a graphical user interface.  It searches a configurable path for
@file{README.*} files, and displays them in @code{WebKit2.WebView}.  It supports
@file{.md}, @file{.rst}, @file{.html} and plain text.  It does not support
@file{.pdf} format.  Although the program was written with nwg-shell for sway
and Hyprland in mind, it may also be used standalone.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-clipman
  (package
    (name "nwg-clipman")
    (version "0.2.8")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-clipman")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1ha3yvdxcid0fgsx28cibc6n20qikc1x9y9hpjv26jc2dkikql0r"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (install-file "nwg-clipman.desktop"
                            (string-append #$output "/share/applications"))
              (install-file "nwg-clipman.svg"
                            (string-append #$output "/share/pixmaps"))
              (install-file "README.md"
                            (string-append #$output
                                           "/share/doc/nwg-clipman"))))
          (add-after 'create-entrypoints 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-clipman")
                `("PATH" ":" prefix
                  (,(dirname (which "cliphist"))
                   ,(dirname (which "wl-copy"))))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH"))))))
          (add-before 'sanity-check 'check-setup
            (lambda _
              (setenv "HOME" (getcwd)))))))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           cliphist
           gtk+
           gtk-layer-shell
           python-pygobject
           wl-clipboard))
    (home-page "https://github.com/nwg-piotr/nwg-clipman")
    (synopsis "Clipboard manager for nwg-shell")
    (description
     "nwg-clipman is a GTK3-based GUI for @command{cliphist}.  It provides
access to previously copied items, as well as management of the clipboard
history from a window opened on @code{gtk-layer-shell}.  The program is intended
for use with sway, Hyprland and other wlroots-based Wayland compositors.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-icon-picker
  (package
    (name "nwg-icon-picker")
    (version "0.1.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-icon-picker")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0b7mds438br3labjl2c3lpgga5xmypp1a58ygf96kawy5s2wjv8s"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (install-file "nwg-icon-picker.desktop"
                            (string-append #$output "/share/applications"))
              (install-file "nwg-icon-picker.svg"
                            (string-append #$output "/share/pixmaps"))
              (install-file "README.md"
                            (string-append #$output
                                           "/share/doc/nwg-icon-picker"))))
          (add-after 'create-entrypoints 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-icon-picker")
                `("XDG_DATA_DIRS" prefix
                  (,(string-append #$output "/share")))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (propagated-inputs
     (list hicolor-icon-theme))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           gtk+
           python-pygobject))
    (home-page "https://github.com/nwg-piotr/nwg-icon-picker")
    (synopsis "GTK icon chooser with a text search option")
    (description
     "nwg-icon-picker is intended to work as the icon picker for nwg-panel, but
it may be used standalone.  It displays a window to choose an icon with a
textual search entry, and returns the icon name.  You can also open a file from
the search result in GIMP or Inkscape, if installed.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public gopsuinfo
  (package
    (name "gopsuinfo")
    (version "0.1.9")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/gopsuinfo")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1nv70mgnmq941cc8wldk59kmdkjmwz2bga2f1v5qh3c3p8ww7c64"))))
    (build-system go-build-system)
    (arguments
     (list
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/gopsuinfo"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "src/github.com/nwg-piotr/gopsuinfo/gopsuinfo.go"
                (("\\/usr") #$output))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share/gopsuinfo"))
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/gopsuinfo")
                (copy-recursively "icons_dark"
                                  (string-append #$output "/share/gopsuinfo/"
                                                 "icons_dark"))
                (copy-recursively "icons_light"
                                  (string-append #$output "/share/gopsuinfo/"
                                                 "icons_light"))
                (install-file "README.md"
                              (string-append #$output
                                             "/share/doc/gopsuinfo"))))))))
    (native-inputs
     (list go-github-com-shirou-gopsutil))
    (home-page "https://github.com/nwg-piotr/gopsuinfo")
    (synopsis "Display system usage info as text")
    (description
     "gopsuinfo is a Go version of the @command{psuinfo} python script.  It
provides @command{gopsuinfo}, a gopsutil-based command, to display system usage
info as text in panels like Waybar or icon/text in tint2 and nwg-panel
executors.

This application is a part of the nwg-shell project.")
    (license (list license:bsd-2 license:expat)))) ;dual-licensed

(define-public nwg-panel
  (package
    (name "nwg-panel")
    (version "0.10.13")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-panel")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1iy528zvk26k48dd8rd1qr69y52nvvhvfv4zfvf821n26r33dwad"))
       (modules '((guix build utils)))
       ;; Replace systemd commands with elogind commands.
       (snippet
        '(substitute* '("nwg_panel/config.py"
                        "nwg_panel/main.py"
                        "nwg_panel/config/config"
                        "nwg_panel/modules/menu_start.py")
           (("\"systemctl (-i |)") "\"loginctl ")))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:modules '((guix build pyproject-build-system)
                  (guix build utils)
                  (srfi srfi-26))                     ;for cute
      #:phases
      #~(modify-phases %standard-phases
          ;; Sanity check requires a running sway or Hyprland session.
          (delete 'sanity-check)
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Set default backgrounds directory.
              (substitute* "nwg_panel/config.py"
                (("\\/usr(\\/share\\/backgrounds)" _ suffix)
                 (string-append #$(this-package-input "nwg-shell-wallpapers")
                                suffix)))
              ;; Patch the default data directory.
              (substitute* '("nwg_panel/icons.py"
                             "nwg_panel/modules/pinned.py")
                (("\\/usr\\/share") (string-append #$output "/share")))
              ;; Fix the dbus service.
              (substitute* "nwg-panel.service"
                (("\\/bin\\/sh") (search-input-file inputs "/bin/bash"))
                (("\\/usr") #$output))))
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (for-each (cute install-file <>
                              (string-append #$output "/share/applications"))
                        '("nwg-panel-config.desktop" "nwg-processes.desktop"))
              (for-each (cute install-file <>
                              (string-append #$output "/share/pixmaps"))
                        '("nwg-panel.svg" "nwg-shell.svg" "nwg-processes.svg"))
              (install-file "nwg-panel.service"
                            (string-append #$output "/share/dbus-1/services"))
              (install-file "README.md"
                            (string-append #$output "/share/doc/nwg-panel"))))
          (add-after 'create-entrypoints 'wrap-programs
            (lambda _
              (for-each (lambda (file)
                          (wrap-program file
                            `("PATH" ":" prefix
                              (,(dirname (which "brightnessctl"))
                               ,(dirname (which "curl"))
                               ,(dirname (which "foot"))
                               ,(dirname (which "gopsuinfo"))
                               ,(dirname (which "htop"))
                               ,(dirname (which "nwg-icon-picker"))
                               ,(dirname (which "nwg-menu"))
                               ,(dirname (which "notify-send"))
                               ,(dirname (which "pactl"))
                               ,(dirname (which "pkill"))
                               ,(dirname (which "playerctl"))
                               ,(dirname (which "swaync-client"))
                               ,(dirname (which "wlr-randr"))))
                            `("GI_TYPELIB_PATH" =
                              (,(getenv "GI_TYPELIB_PATH")))))
                        (find-files (string-append #$output "/bin"))))))))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           curl                 ;for the default executors
           brightnessctl        ;for controlling brightness
           foot                 ;for the default executors
           gopsuinfo            ;for the default executors
           gtk+
           gtk-layer-shell
           hicolor-icon-theme
           htop                 ;for the default executors
           libappindicator
           libdbusmenu
           libnotify
           nwg-icon-picker      ;for chosing icons for buttons
           nwg-menu             ;optional plugin
           nwg-shell-wallpapers ;for random wallpaper module
           playerctl            ;optional plugin
           procps
           pulseaudio           ;for controlling audio
           python-pycairo
           python-dasbus
           python-i3ipc
           python-psutil
           python-pygobject
           python-requests
           swaynotificationcenter
           wlr-randr))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-panel")
    (synopsis "GTK3-based panel for sway and Hyprland")
    (description
     "nwg-panel is a GTK3-based panel for sway and Hyprland Wayland compositors.
The panel is equipped with a graphical configuration program that frees the user
from the need to manually edit configuration files.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-dock
  (package
    (name "nwg-dock")
    (version "0.4.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-dock")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1gagfm2igbwdsi9f4gs7lmvqjmxvdp0zkm6yl9b0qi7wjnb3hsb2"))
       (patches
        (search-patches "nwg-dock-0.4.3-fallback-paths.patch"))))
    (build-system go-build-system)
    (arguments
     (list
      ;; XXX: nwg-dock/tools.go:980:15: github.com/sirupsen/logrus.Errorf call
      ;; has arguments but no formatting directives
      #:tests? #f
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/nwg-dock"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion "src/github.com/nwg-piotr/nwg-dock"
                (substitute* '("main.go" "tools.go")
                  (("\\/usr\\/share") (string-append #$output "/share"))))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share"))
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/nwg-dock")
                (copy-recursively "config"
                                  (string-append #$output "/share/nwg-dock"))
                (copy-recursively "images"
                                  (string-append #$output
                                                 "/share/nwg-dock/images"))
                (install-file "README.md"
                              (string-append #$output
                                             "/share/doc/nwg-dock")))))
          (add-after 'install 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-dock")
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
    (list gobject-introspection
          go-github-com-allan-simon-go-singleinstance
          go-github-com-dlasky-gotk3-layershell
          go-github-com-gotk3-gotk3
          go-github-com-joshuarubin-go-sway
          go-github-com-sirupsen-logrus
          pkg-config))
    (inputs
     (list bash-minimal
           gtk+
           gtk-layer-shell))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-dock")
    (synopsis "GTK3 based dock for sway")
    (description
     "nwg-dock is a fully configurable (w/ command line arguments and CSS) GTK3
based dock, written in Go, aimed exclusively at sway Wayland compositor.  It
features pinned buttons, task buttons, the workspace switcher and the launcher
button.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public nwg-dock-hyprland
  (package
    (name "nwg-dock-hyprland")
    (version "0.4.8")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-dock-hyprland")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1cfbrapdiw8qwfcbmyqz6k0q5ny8balzmpwsnp9b3rny2w0cvqkb"))
       (patches
        (search-patches "nwg-dock-hyprland-0.4.8-fallback-paths.patch"))))
    (build-system go-build-system)
    (arguments
     (list
       ;Tests fail due to a call having arguments but no formatting
      ;; directives.
      #:tests? #f
      #:install-source? #f
      #:import-path "github.com/nwg-piotr/nwg-dock-hyprland"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/"
                                                       "nwg-dock-hyprland")
                (substitute* '("main.go" "tools.go")
                  (("\\/usr\\/share") (string-append #$output "/share"))))))
          (add-after 'install 'install-data
            (lambda _
              (mkdir-p (string-append #$output "/share"))
              (with-directory-excursion (string-append "src/github.com/"
                                                       "nwg-piotr/"
                                                       "nwg-dock-hyprland")
                (copy-recursively "config"
                                  (string-append #$output
                                                 "/share/nwg-dock-hyprland"))
                (copy-recursively "images"
                                  (string-append #$output "/share/"
                                                 "nwg-dock-hyprland/images"))
                (install-file "README.md"
                              (string-append #$output "/share/doc/"
                                             "nwg-dock-hyprland")))))
          (add-after 'install 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/nwg-dock-hyprland")
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))))))
    (native-inputs
     (list gobject-introspection
           go-github-com-allan-simon-go-singleinstance
           go-github-com-diamondburned-gotk4
           go-github-com-diamondburned-gotk4-layer-shell
           go-github-com-sirupsen-logrus
           pkg-config))
    (inputs
     (list bash-minimal
           gtk+
           gtk-layer-shell))
    (home-page "https://github.com/nwg-piotr/nwg-dock-hyprland")
    (synopsis "GTK3 based dock for Hyprland")
    (description
     "nwg-dock-hyprland is a fully configurable (w/ command line arguments and
CSS) GTK3 based dock, written in Go, aimed exclusively at Hyprland Wayland
compositor.  It features pinned buttons, task buttons, the workspace switcher
and the launcher button.

This application is a part of the nwg-shell project.")
    (license license:expat)))

(define-public typobuster
  (package
    (name "typobuster")
    (version "1.0.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/typobuster")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1n8nqfwj9ih1vdzvmlnjp463rnr66ca30sdc7a82g42brmlkk5wv"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (substitute* "typobuster/tools.py"
                (("\\/usr\\/share") (string-append #$output "/share")))))
          (add-after 'create-entrypoints 'install-data
            (lambda _
              (install-file "typobuster.desktop"
                            (string-append #$output "/share/applications"))
              (install-file "typobuster.svg"
                            (string-append #$output "/share/pixmaps"))
              (install-file "README.md"
                            (string-append #$output "/share/doc/typobuster"))))
          (add-after 'create-entrypoints 'wrap-program
            (lambda _
              (wrap-program (string-append #$output "/bin/typobuster")
                `("PATH" prefix
                  (,(dirname (which "gsettings"))))
                `("GI_TYPELIB_PATH" prefix
                  (,(getenv "GI_TYPELIB_PATH")))
                `("XDG_DATA_DIRS" prefix
                  (,(string-append #$(this-package-input "gtksourceview")
                                   "/share")))))))))
    (propagated-inputs
     ;; avoid runtime error:
     ;; No such schema “org.gnome.desktop.interface”
     (list gsettings-desktop-schemas))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           `(,glib "bin")     ;for gsettings
           gtk+
           gtksourceview-4
           python-pycairo
           python-pygobject))
    (home-page "https://nwg-piotr.github.io/nwg-shell/typobuster")
    (synopsis "Text editor with text transformations and auto-correction")
    (description
     "Typobuster is a simplified text editor with a wide selection of
transformations and automatic correction of common typos.

This application is a part of the nwg-shell project.")
    (license license:gpl3)))

(define-public nwg-shell-config
  (package
    (name "nwg-shell-config")
    (version "0.5.64")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-shell-config")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0sfh4sbpjf7bf5r2n96jwafzmwwc8yfhlfn5lsms5fq2f3srxyk2"))
       (modules '((guix build utils)))
       ;; Replace systemd commands with elogind commands.
       (snippet
        '(with-directory-excursion "nwg_shell_config"
           ;; The skeleton files in the store directory is read-only, so do not
           ;; install them preserving file permissions.
           (substitute* '("hud.py" "tools.py")
             (("copy2") "copyfile"))
           (substitute* '("locker.py"
                          "main_hyprland.py"
                          "main_sway.py"
                          "ui_components.py"
                          "shell/custom"
                          "shell/custom-hyprland"
                          "shell/settings"
                          "shell/settings-hyprland")
             (("\"systemctl (-i |)") "\"loginctl ")
             (("'systemctl (-i |)") "'loginctl "))
           ;; Add support for icecat.
           (substitute* "ui_components.py"
             (("(.*)\"firefox\": \"(MOZ_ENABLE_WAYLAND=1 )firefox\"," all
               indent env)
              (string-append all "\n" indent "\"icecat\": \"" env "icecat\","))
             (("\"firefox\", " all) (string-append all "\"icecat\", ")))))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:modules '((guix build pyproject-build-system)
                  (guix build utils)
                  (srfi srfi-26))                     ;for cute
      #:phases
      #~(modify-phases %standard-phases
          ;; Sanity check requires a running sway or Hyprland session.
          (delete 'sanity-check)
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion "nwg_shell_config"
                ;; Replace the default backgrounds directory.
                (substitute* '("locker.py"
                               "main_hyprland.py"
                               "main_sway.py"
                               "tools.py"
                               "shell/settings"
                               "shell/settings-hyprland")
                  (("\\/usr(\\/share\\/backgrounds)" _ suffix)
                   (string-append #$(this-package-input "nwg-shell-wallpapers")
                                  suffix)))
                ;; Patch path to the pixmaps directory.
                (substitute* "tools.py"
                  (("\\/usr\\/share\\/pixmaps")
                   (string-append #$output "/share/pixmaps")))
                ;; Patch path to swaync
                (substitute* '("main_sway.py" "main_hyprland.py")
                  (("\\/etc\\/xdg\\/swaync" all)
                   (string-append #$(this-package-input
                                     "swaynotificationcenter") all))))))
          (add-after 'install 'install-data
            (lambda _
              (install-file "nwg-shell-config.desktop"
                            (string-append #$output "/share/applications"))
              (for-each (cute install-file <>
                              (string-append #$output "/share/pixmaps"))
                        '("nwg-shell-config.svg"
                          "nwg-shell-update.svg"
                          "nwg-shell-translate.svg"
                          "nwg-update-noupdate.svg"
                          "nwg-update-available.svg"
                          "nwg-update-checking.svg"
                          "nwg-screenshot.svg"
                          "nwg-3.svg"
                          "nwg-2.svg"
                          "nwg-1.svg"
                          "nwg-workspace.svg"))
              (install-file "README.md"
                            (string-append #$output
                                           "/share/doc/nwg-shell-config"))))
          (add-after 'create-entrypoints 'wrap-programs
            (lambda _
              (with-directory-excursion (string-append #$output "/bin")
                (for-each (lambda (file)
                            (wrap-program file
                              `("PATH" ":" prefix
                                (,(string-append #$output "/bin")
                                 ,(dirname (which "foot"))
                                 ,(dirname (which "gtklock"))
                                 ,(dirname (which "killall"))
                                 ,(dirname (which "notify-send"))
                                 ,(dirname (which "pkill"))
                                 ,(dirname (which "playerctl"))
                                 ,(dirname (which "swappy"))
                                 ,(dirname (which "swayidle"))
                                 ,(dirname (which "swaync"))
                                 ,(dirname (which "wlsunset"))))
                              `("GI_TYPELIB_PATH" =
                                (,(getenv "GI_TYPELIB_PATH")))))
                          (find-files "." "nwg.*")))))
          (add-after 'wrap 'install-nwg-system-update
            (lambda _
              ;; TODO: Add an argument to nwg-system-update for updating
              ;; Guix and then add a code for it in
              ;; nwg_shell_config/update_indicator.py.
              (install-file "nwg-system-update"
                            (string-append #$output "/bin")))))))
    (native-inputs
     (list gobject-introspection
           python-setuptools))
    (inputs
     (list bash-minimal
           foot
           gtk+
           gtk-layer-shell
           gtklock
           libappindicator
           libnotify
           nwg-shell-wallpapers
           playerctl
           procps
           psmisc
           python-geopy
           python-i3ipc
           python-pygobject
           python-psutil
           python-requests
           swappy
           swayidle
           swaynotificationcenter
           wlsunset))
    (home-page "https://nwg-piotr.github.io/nwg-shell/nwg-shell-config")
    (synopsis "nwg-shell configuration utility")
    (description
     "nwg-shell-config utility provides a graphical user interface for
configuring sway and Hyprland Wayland compositors in nwg-shell.

This application is a part of the nwg-shell project.")
    (license license:expat)))

;; nwg-shell meta package
(define-public nwg-shell
  (package
    (name "nwg-shell")
    (version "0.5.50")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/nwg-piotr/nwg-shell")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1qb4k1w3ycp0n8gwfnk2nmxn8gxa6aab1hg3527x514yck3w1zcp"))
       (modules '((guix build utils)))
       (snippet
        '(with-directory-excursion "nwg_shell"
           ;; The skeleton files in /gnu/store directory are read-only, so make
           ;; the installer install the configuration files without preserving
           ;; permissions and then make make azotebg executable.
           (substitute* "installer.py"
             (("copy, copy2") "copyfile, copy")
             (("copy\\(") "copyfile(")
             (("copy2\\(") "copyfile(")
             (("import os" all) (string-append all "\nimport stat"))
             (("(.* )copyfile\\(.*\\(.*\"azotebg\"\\), bcg\\)" all indent)
              (string-append all "\n" indent "st = os.stat(bcg)" "\n" indent
                             "os.chmod(bcg, st.st_mode | stat.S_IEXEC)"))
             ;; Copy .azotebg to .azotebg-hyprland preserving permissions.
             (("copyfile(\\(.*\"\\.azotebg-hyprland\"\\))" _ suffix)
              (string-append "copy" suffix)))
           ;; Replace systemd commands with elogind commands.
           (substitute* '("installer.py"
                          "skel/data/nwg-shell-config/settings"
                          "skel/data/nwg-shell-config/settings-hyprland"
                          "skel/config/sway/config"
                          "skel/config/nwg-panel/hyprland-0"
                          "skel/config/nwg-panel/hyprland-1"
                          "skel/config/nwg-panel/hyprland-2"
                          "skel/config/nwg-panel/hyprland-3"
                          "skel/config/nwg-panel/preset-0"
                          "skel/config/nwg-panel/preset-1"
                          "skel/config/nwg-panel/preset-2"
                          "skel/config/nwg-panel/preset-3"
                          "skel/config/hypr/hyprland.conf")
             (("\"systemctl (-i |)") "\"loginctl "))
           (substitute* '("skel/config/sway/config"
                          "skel/config/hypr/hyprland.conf")
             ;; Disable importing environment variables for systemd.
             ((".*systemctl --user import-environment.*") "")
             ;; Disable updating environment variables for systemd.
             ((".*dbus-update-activation-environment --systemd.*") "")
             ;; Disable executing polkit-gnome-authentication-agent-1.  Since it
             ;; is not available in $PATH, it is difficult to predict in which
             ;; profile it is installed.  So let users enable it and set the
             ;; path manually.
             (("exec (= |)\\/usr\\/lib\\/polkit-gnome" all)
              (string-append "#" all)))
           ;; Replace firefox with icecat.
           (substitute* '("skel/config/foot/foot.ini"
                          "skel/config/sway/config")
             (("firefox") "icecat"))
           (substitute* "installer.py"
             ;; Add an entry for icecat browser.
             (("\"firefox\", " all) (string-append all "\"icecat\", "))
             ;; Add support to the icecat browser.
             (("    \"firefox\": \"firefox\"," all)
              (string-append all "\n    \"icecat\": \"icecat\",\n"))
             ;; Remove Arch Linux related line from the warning.
             ((".*on a fresh Arch Linux installation.*") ""))))))
    (build-system pyproject-build-system)
    (arguments
     (list
      #:tests? #f ;no tests exist in source
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda _
              (with-directory-excursion "nwg_shell/skel"
                ;; Patch path to the nwg-shell backgrounds directory.
                (substitute* '("data/nwg-shell-config/settings"
                               "data/nwg-shell-config/settings-hyprland"
                               "config/nwg-panel/hyprland-0"
                               "config/nwg-panel/preset-0")
                  (("\\/usr(\\/share\\/backgrounds\\/nwg-shell)" _ suffix)
                   (string-append #$(this-package-input "nwg-shell-wallpapers")
                                  suffix)))
                ;; Patch path to backgrounds directory.
                (substitute* "stuff/azotebg"
                  (("\\/usr") #$output)))))
          (add-after 'create-entrypoints 'install-scripts
            (lambda _
              (install-file "scripts/screenshot"
                            (string-append #$output "/bin"))))
          (add-after 'install-scripts 'install-data
            (lambda _
              (install-file "nwg-shell.jpg"
                            (string-append #$output "/share/backgrounds"))
              (install-file "README.md"
                            (string-append #$output
                                           "/share/doc/nwg-shell"))))
          (add-after 'install-data 'wrap-programs
            (lambda _
              (with-directory-excursion (string-append #$output "/bin")
                (wrap-program "nwg-shell-installer"
                 `("PATH" prefix
                   (,(dirname (which "localectl")))))
                (wrap-program (string-append #$output "/bin/screenshot")
                 `("PATH" ":" prefix
                   (,(dirname (which "echo"))
                    ,(dirname (which "grim"))
                    ,(dirname (which "jq"))
                    ,(dirname (which "notify-send"))
                    ,(dirname (which "slurp"))
                    ,(dirname (which "swappy"))
                    ,(dirname (which "wl-copy"))
                    ,(dirname (which "xdg-user-dir"))))))
              )))))
    (propagated-inputs
     (list adwaita-icon-theme
           azote
           blueman
           brightnessctl
           cliphist
           font-abattis-cantarell
           foot
           gdk-pixbuf                  ;for GDK_PIXBUF_MODULE_FILE
           gnome-themes-extra
           gopsuinfo
           gsettings-desktop-schemas
           gtklock
           i3-autotiling
           kstatusnotifieritem
           `(,libavif "pixbuf-loader") ;for loading AVIF backgrounds
           libheif                     ;for loading HEIF backgrounds
           `(,libjxl "pixbuf-loader")  ;for loading JXL backgrounds
           network-manager-applet
           nwg-bar
           nwg-clipman
           nwg-displays
           nwg-dock
           nwg-dock-hyprland
           nwg-drawer
           nwg-icon-picker
           nwg-look
           nwg-menu
           nwg-panel
           nwg-readme-browser
           nwg-shell-config
           nwg-shell-wallpapers
           papirus-icon-theme
           pulseaudio
           playerctl
           swaybg
           swayidle
           swaynotificationcenter
           wl-clipboard
           wlsunset))
    (native-inputs
     (list python-setuptools))
    (inputs
     (list bash-minimal
           coreutils-minimal
           grim
           jq
           libnotify
           localed
           slurp
           swappy
           wl-clipboard
           xdg-user-dirs))
    (home-page "https://nwg-piotr.github.io/nwg-shell/")
    (synopsis "GTK3-based shell for sway and Hyprland Wayland compositors")
    (description
     "nwg-shell is a GTK3-based shell for sway and Hyprland Wayland compositors.
The project provides a common configuration tool (nwg-shell-config) that allows
you to configure the system in a graphical UI, and a range of components such as
nwg-panel (system panel), nwg-drawer (application launcher), nwg-dock (system
dock) or nwg-menu (XDG-style menu).  It also includes several native tools as
nwg-look (look and feel GTK settings editor), nwg-displays (display
configuration tool), Azote (wallpaper manager), nwg-clipman (clipboard history
manager), nwg-icon-picker (icon browser with textual search), nwg-readme-browser
(documentation viewer) and nwg-hello (login manager).  Scripts and utilities
such as autotiling (script for sway to automatically switch the horizontal /
vertical window split orientation) and gopsuinfo (a command to display system
usage info) are used in the background.  The shell also utilizes third party
software as swaync (notification center), gtklock / swaylock (screen lockers)
and more.

This package acts as a metapackage and installer of default configuration
files.")
    (license (list license:expat
                   license:cc-by4.0)))) ;for the graphics