summaryrefslogtreecommitdiff
path: root/px/packages/desktop.scm
blob: e0af64a47912f3328c54669316e8f852a135919c (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
;;; Desktop related packages Module for PantherX
;;; Reza Alizadeh Majd <r.majd@pantherc.org>
;;; Franz Geffke <franz@pantherx.org>

(define-module (px packages desktop)
  #:use-module ((guix licenses)
                #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (gnu system)
  #:use-module (guix utils)
  #:use-module (guix build-system trivial)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system qt)
  #:use-module (gnu packages)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages aspell)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bittorrent)
  #:use-module ((gnu packages compression)
                #:prefix compression:)
  #:use-module (gnu packages compton)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages fonts)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages image)
  #:use-module (gnu packages jami)
  #:use-module (gnu packages kde-pim)
  #:use-module (gnu packages kde-frameworks)
  #:use-module (gnu packages kde-plasma)
  #:use-module (gnu packages kde-utils)
  #:use-module (gnu packages libreoffice)
  #:use-module (gnu packages lxde)
  #:use-module (gnu packages lxqt)
  #:use-module (gnu packages music)
  #:use-module (gnu packages mail)
  #:use-module (gnu packages maths)
  #:use-module (gnu packages openbox)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages security-token)
  #:use-module (gnu packages suckless)
  #:use-module (gnu packages video)
  #:use-module (gnu packages wget)
  #:use-module (gnu packages wm)
  #:use-module (gnu packages xfce)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages pdf)
  #:use-module (gnu packages syncthing)
  #:use-module (gnu packages xdisorg)
  #:use-module (nongnu packages compression)
  #:use-module (nongnu packages mozilla)
  #:use-module (px packages accounts)
  #:use-module (px packages atril-thumbnailer)
  #:use-module (px packages backup)
  #:use-module (px packages common)
  #:use-module (px packages contacts-calendar)
  #:use-module (px packages desktop-tools)
  #:use-module (px packages document)
  #:use-module (px packages hub)
  #:use-module (px packages kde-frameworks)
  #:use-module (px packages library)
  #:use-module (px packages lxqt-dev)
  #:use-module (px packages matrix-client)
  #:use-module (px packages package-management)
  #:use-module (px packages pantherx-panel)
  #:use-module (px packages px-themes)
  #:use-module (px packages settings)
  #:use-module (px packages setup)
  #:use-module (px packages software)
  #:use-module (px packages images)
  #:use-module (px packages themes)
  #:use-module (px packages backup)
  #:use-module (px packages user-services)
  #:use-module (px packages wiki)
  #:use-module (px packages device)
  #:use-module (px packages time-tracking)
  #:use-module (srfi srfi-1)
  #:export (%common-desktop-applications 
            %gtk-desktop-applications
            %qt-desktop-applications

            lxqt-modified
            ;; TODO: This should probably go into px/services/desktop
            px-desktop-defaults))

;; Currently only lxqt-modified
(define-public openbox-modified
  (package
    (inherit openbox)
    (name "openbox-modified")
    (arguments
     (list
      #:phases #~(modify-phases %standard-phases
                   (add-after 'unpack 'force-reconfigure
                     ;; This is made necessary by the openbox-python3 patch.
                     (lambda _
                       (delete-file "configure")))
                   (add-after 'unpack 'patch-config-file
                     (lambda _
                       (substitute* "data/rc.xml"
                         (("Clearlooks")
                          "Arc-Dark")))))))))

;; Currently only lxqt-modified
(define-public px-file-manager
  (package
    (inherit pcmanfm-qt)
    (name "px-file-manager")
    (source
     (origin
       (inherit (package-source pcmanfm-qt))
       (patches (search-patches "px-file-manager-0001-update-config.patch"))))
    (arguments
     (substitute-keyword-arguments (package-arguments pcmanfm-qt)
       ((#:phases phases)
        #~(modify-phases #$phases
            (add-before 'configure 'patch-settings.conf.in
              (lambda* (#:key inputs #:allow-other-keys)
                (let ((wallpaper (search-input-file inputs
                                  "share/lxqt/wallpapers/pantherx.jpg")))
                  (substitute* "config/pcmanfm-qt/lxqt/settings.conf.in"
                    (("Wallpaper=.*")
                     (string-append "Wallpaper=" wallpaper "\n")))
                  (substitute* '("config/pcmanfm-qt/lxqt/settings.conf.in")
                    (("WallpaperMode=stretch")
                     "WallpaperMode=zoom")
                    ;; Patch default font
                    (("Font=\"Sans Serif,10,-1,5,50,0,0,0,0,0\"")
                     "Font=\"IBM Plex Sans,10,-1,5,50,0,0,0,0,0,Regular\"")
                    ;; Patch default applications
                    (("TerminalDirCommand=xterm")
                     "TerminalDirCommand=qterminal")
                    (("TerminalExecCommand=xterm")
                     "TerminalExecCommand=qterminal")
                    ;; Patch thumbnail size
                    (("MaxThumbnailFileSize=4096")
                     "MaxThumbnailFileSize=30720")))))))))
    (inputs (list libfm-qt qtbase-5 qtx11extras px-lxqt-themes))
    (native-inputs
     (list pkg-config qttools-5 lxqt-build-tools))
    (propagated-inputs `(("atril-thumbnailer" ,atril-thumbnailer)
                         ("ffmpegthumbnailer" ,ffmpegthumbnailer)
                         ("freetype" ,freetype)
                         ("libgsf" ,libgsf)
                         ("tumbler" ,tumbler)))))

(define-public px-terminal-launcher
  (package
    (name "px-terminal-launcher")
    (version "v0.2.3")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://source.pantherx.org/" name "_" version
                           ".tgz"))
       (sha256
        (base32 "0fqlzbipnddn9cd0amjn9py7qzwnk5ir674lshpf7rsnv7fasalw"))))
    (build-system qt-build-system)
    (native-inputs (list qttools-5 pkg-config extra-cmake-modules))
    (inputs (list capnproto-0.9
                  qtbase-5
                  qtsvg-5
                  qtcharts
                  px-auth-library-cpp
                  networkmanager-qt))
    (propagated-inputs (list px-icons))
    (home-page "https://www.pantherx.dev")
    (synopsis "PantherX Terminal Launcher")
    (description "PantherX Terminal Launcher")
    (license license:expat)))

(define-public lxqt-modified
  (package
    (inherit lxqt)
    (name "lxqt-modified")
    (propagated-inputs `(;; Apply Arc-Dark to openbox:
                          ("openbox-modified" ,openbox-modified)
                         ;; Apply modified menu and others to lxqt-panel:
                         ;; TODO: FIX and restore
                         ;; ("pantherx-panel" ,pantherx-panel)
                         ;; ("libqtxdg" ,libqtxdg)
                         ;; Apply default wallpaper and so on to pcmanfm-qt:
                         ("px-file-manager" ,px-file-manager)
                         ;; ("px-icons" ,px-icons)
                         ;; ("px-lxqt-themes" ,px-lxqt-themes)
                         ;; "lxqt-panel"
                         ,@(fold alist-delete
                                 (package-propagated-inputs lxqt)
                                 '("lximage-qt" "pcmanfm-qt"))))))

;;
;; Desktop Configuration
;;

;; This goes straight into px/services/desktop (only LXQt)
(define-public px-desktop-defaults
  (package
    (name "px-desktop-defaults")
    (version "0.0.47")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://source.pantherx.org/px-desktop-defaults_"
                           version ".tgz"))
       (sha256
        (base32 "1y9wp2d35nrf72bkiv39k17paa6arxp2hpz2102mymj61zb96fvk"))))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder (begin
                   (use-modules (guix build utils))
                   (mkdir %output)
                   (setenv "PATH"
                           (string-append (assoc-ref %build-inputs "coreutils")
                                          "/bin"
                                          ":"
                                          (assoc-ref %build-inputs "tar")
                                          "/bin"
                                          ":"
                                          (assoc-ref %build-inputs "gzip")
                                          "/bin"))
                   (invoke "tar" "zxvf"
                           (assoc-ref %build-inputs "source"))
                   ;; (chdir (string-append (string-capitalize ,name) "-" ,version))
                   ;; (display (string-append ,name "_" ,version))
                   ;; (chdir (string-append ,name "_" ,version))
                   (let ((source (assoc-ref %build-inputs "source"))
                         (albert (assoc-ref %build-inputs "albert-launcher"))
                         (copyq (assoc-ref %build-inputs "copyq"))
                         (px-first-login-welcome-screen (assoc-ref
                                                         %build-inputs
                                                         "px-first-login-welcome-screen"))
                         (out (assoc-ref %outputs "out")))
                     (chdir ,name)
                     (substitute* '("etc/xdg/autostart/lxqt-copyq-autostart.desktop")
                       (("Exec=copyq")
                        (string-append "Exec=" copyq "/bin/copyq")))
                     (substitute* '("etc/xdg/autostart/albert.desktop")
                       (("Exec=albert")
                        (string-append "Exec=" albert "/bin/albert")))
                     (substitute* '("etc/xdg/autostart/px-first-login-welcome-screen.desktop")
                       (("Exec=px-first-login-welcome-screen")
                        (string-append "Exec=" px-first-login-welcome-screen
                                       "/bin/px-first-login-welcome-screen")))
                     (copy-recursively "." %output)
                     (chmod (string-append %output
                             "/etc/px-desktop/scripts/lxqt-switch-desktop.sh")
                            #o755)
                     #t))))
    (native-inputs `(("coreutils" ,coreutils)
                     ("tar" ,tar)
                     ("gzip" ,compression:gzip)))
    (propagated-inputs `(("albert-launcher" ,albert-launcher)
                         ;;("px-widget-style" ,px-widget-style) replaced with default 'breeze'
						 ("breeze", breeze)
						 ("px-icons" ,px-icons)
                         ("px-first-login-welcome-screen" ,px-first-login-welcome-screen)
                         ("px-openbox-theme" ,px-openbox-theme)
                         ("copyq" ,copyq)))
    (home-page "https://www.pantherx.org/")
    (synopsis "PantherX Default Configuration Package")
    (description "Default Configurations for PantherX Desktop")
    (license license:expat)))

;;
;; PantherX OS Desktop default Applications and Services
;;

(define %common-desktop-applications
  (list ;Default applications and so on...
        ;; px-contacts
        ;; px-backup
        ;; px-hub-gui
        ; px-software
        ; px-software-assets-meta

        ;; Browser
        firefox

        ;; Connectivity
        ;; qbittorrent

        ;; Office
        libreoffice
        aspell
        aspell-dict-en
        aspell-dict-de
        aspell-dict-uk

        ;; Look and Feel
        px-sddm-theme
        xcursor-themes
        gnome-themes-standard
        font-liberation
        font-adobe-source-sans-pro
        font-adobe-source-code-pro
        font-cns11643-swjz ;?
        font-wqy-zenhei ;?
        font-ibm-plex
        font-vazir
        font-openmoji

        ;; WIP
        ;; lxqt-arc-dark-theme
        
        ;; Utils
        ;; Userspace virtual file system for GIO
        gvfs
        print-manager

        ;; U2F
        pam-u2f
        libu2f-host
        libu2f-server

        ;; Compression
        compression:zip
        compression:unzip
        unrar

        ;; Command line utils
        curl
        neofetch
        wget
        xrandr

        ;; Secrets
        ;; Displaying certificates and accessing key stores
        gcr
        gnome-keyring
        ;; seahorse
        
        ;; Bluetooth
        blueman))

(define %gtk-desktop-applications
  (list

        ;; Excludes syncthingtray
        ;; Does not work on Gnome wayland
        px-user-services-gtk
        syncthing-gtk

        ;; PGP
        seahorse))

(define %qt-desktop-applications
  (list
   ;; Primarily for LXQt
	paper-icon-theme
	sddm-darkine-theme
    breeze-gtk
   

   ;; Includes syncthingtray (QT)
   px-user-services

   ;; Default applications and so on...
   px-first-login-welcome-screen
   px-desktop-wiki
   px-about
   lxqt-archiver
   px-settings-ui

   ;; Office
   speedcrunch

   ;; Multimedia
   qimgv
   strawberry
   mpv

   ;; Connectivity
   ;; This package contains a systray applet for NetworkManager
   ;; Does not work on Gnome wayland
   network-manager-applet
   featherpad
   qpdfview

   ;; Utils
   flameshot
   pinentry-qt
   lxmenu-data

   albert-launcher

   ;; PGP
   kleopatra

   ;; Clipboard manager
   copyq

   ;; Account Service Plugins
   ;; px-accounts-service-plugin-etesync  ;; TODO: uncomment whenever we had a working package for `px-contact-calendar`
   ;; px-accounts-service-plugin-activity-watch
   ;; px-accounts-service-plugin-claws-mail
   ;; px-accounts-service-plugin-github
   ;; px-accounts-service-plugin-gitlab
   ;; px-accounts-service-plugin-oauth2-github
   ;; px-accounts-service-plugin-oauth2-mastodon
   ;; px-accounts-service-plugin-oauth2-google
   ;; px-accounts-service-providers-mail
   ;; px-accounts-service-plugin-imap
   ;; px-accounts-service-plugin-maestral
   ;; px-accounts-service-plugin-smtp
   ;; px-accounts-service-plugin-carddav
   ;; px-accounts-service-plugin-s3
   ;; px-accounts-service-plugin-backup-local
   ;; px-accounts-service-plugin-etherscan
   ;; px-accounts-service-plugin-blockio
   ;; px-accounts-service-plugin-cryptocurrency
   ;; px-accounts-service-plugin-discourse
   
   ;; Hub Service Plugins
   ;; px-hub-service-plugin-claws-mail
   ;; px-hub-service-plugin-github
   ;; px-hub-service-plugin-gitlab
   ;; px-hub-service-plugin-discourse
   ;; px-hub-service-plugin-mastodon
   
   ;; Time Tracking Plugins
   ;; px-time-tracking-plugin-gitlab
   
   ;; Settings Service Plugins
   ;; px-settings-service-plugin-accounts
   px-settings-service-plugin-backup
   px-settings-service-plugin-desktop-search
   px-settings-service-plugin-maintenance
   px-settings-service-plugin-software
   px-settings-service-plugin-theme
   px-settings-service-plugin-theme-dark-bright))

; (define %pantherx-desktop-i3
;   (list i3-wm i3lock i3lock-fancy i3status
;         dmenu i3blocks))