summaryrefslogtreecommitdiff
path: root/px/packages/desktop.scm
blob: 4fe3e090f4bbc3ef6de0313aae17e56c7a28423c (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
;;; 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-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 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 xdisorg) ;; copyq
  #: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) ;; px-backup
  #:use-module (px packages common) ;; capnproto
  #:use-module (px packages contacts-calendar) ;; px-contacts
  #:use-module (px packages desktop-tools) ;; px-about
  #: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 multimedia)
  #: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) ;; px-remote-access
  #: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* (find-files "pcmanfm/translations" "\\.desktop.yaml")  
                              (("PCManFM-Qt File Manager") "File Manager"))
                          (substitute* '("config/pcmanfm-qt/lxqt/settings.conf.in")
                             (("WallpaperMode=stretch") "WallpaperMode=zoom")
                             ;; Patch 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 TUMBNAILS
                             (("MaxThumbnailFileSize=4096") "MaxThumbnailFileSize=30720"))
                          (substitute* '("config/CMakeLists.txt")
			                       (("\\$\\{CMAKE_INSTALL_DATADIR\\}") "etc/xdg"))
                          )))))))
   (inputs
     (list libfm-qt qtbase-5 qtx11extras px-lxqt-themes))
   (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.1.9")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://source.pantherx.org/" name "_" version ".tgz"))
        (sha256 (base32 "14b3kn9invpawynn3nxgwvyr1l8k796v3jjcq8rzjmbfc48qpxi6"))))
    (build-system qt-build-system)
    (arguments
     `(#:tests? #f ; no tests
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-source
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (substitute* "mainwindow.cpp"
               (("matrix-call-auto-accept-load-params.py") 
                (string-append (assoc-ref outputs "out") "/bin/matrix-call-auto-accept-load-params.py")))
             (substitute* "scripts/matrix-call-auto-accept-load-params.py"
               (("matrix-client-call-auto-accept") 
                (string-append (assoc-ref inputs "matrix-client-call-auto-accept") 
                  "/bin/matrix-client-call-auto-accept"))))))))
    (native-inputs
      (list qttools-5
            pkg-config
            extra-cmake-modules)
      )
    (inputs
     (list capnproto-0.9
           qtbase-5
           qtcharts
           px-auth-library-cpp
           matrix-client-call-auto-accept
           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)
      ;; Rename QTerminal to Terminal:
      ("px-terminal" ,px-terminal)
      ("px-icons" ,px-icons)
      ("px-lxqt-themes" ,px-lxqt-themes)
      ;; "lxqt-panel"
      ,@(fold alist-delete (package-propagated-inputs lxqt)
              '("lximage-qt" "pcmanfm-qt" "qterminal"
                "lxqt-themes"
                "breeze-icons"))))))

;;
;; Desktop Configuration
;;

;; This goes straight into px/services/desktop
(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)
      ("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 ; px-backup
        ; px-contacts
        px-first-login-welcome-screen
        ;; Default applications and so on...
        px-desktop-wiki
        px-software
        ; px-hub-gui
        px-software-assets-meta
        
        ;; Browser
        firefox

        ;; Connectivity
        qbittorrent

        ;; Office
        libreoffice
        speedcrunch
        aspell
        aspell-dict-en
        aspell-dict-de ;; :)
        aspell-dict-uk

        ;; Look and Feel
        paper-icon-theme
        sddm-darkine-theme
        px-sddm-theme
        xcursor-themes
        gnome-themes-standard
        font-liberation
        font-adobe-source-sans-pro
        font-adobe-source-code-pro
        breeze-gtk
        font-cns11643-swjz ;; ?
        font-wqy-zenhei ;; ?
        font-ibm-plex
        font-vazir
        font-openmoji
        
        ;; WIP
        ;; lxqt-arc-dark-theme

        ;; Multimedia
        px-image-viewer
        px-music-player
        px-video-player

        ;; Utils
        albert-launcher
        ;; Userspace virtual file system for GIO
        gvfs
        lxmenu-data
        flameshot
        pinentry-qt
        print-manager
        ;; CLipboard manager
        copyq

        ;; 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

        px-user-services

        ;; Bluetooth
        blueman

        ;; 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 %gtk-desktop-applications
  (list ))

(define %qt-desktop-applications
  (list
      px-about
      px-file-archiver
      px-settings-ui
      px-network-manager-applet
      featherpad
      qpdfview))

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