summaryrefslogtreecommitdiff
path: root/tw/packages/catppuccin.scm
blob: ae2675e317412344bb5dfed2da056ab78b75d1f0 (about) (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
(define-module (tw packages catppuccin)
  #:use-module (guile)
  #:use-module ((gnu packages base)
                #:select (coreutils gnu-make findutils sed (which . which-package)))
  #:use-module (gnu packages bash)
  #:use-module (gnu packages gawk)
  #:use-module (gnu packages gnome-xyz)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages inkscape)
  #:use-module (gnu packages kde-frameworks)
  #:use-module (gnu packages kde-plasma)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xorg)
  #:use-module (guix build utils)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system qt)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages))

(define-public catppuccin-gtk-theme
  (package
   (name "catppuccin-gtk-theme")
   (version "0.2.7")
   (source
    (origin
      (method git-fetch)
      (uri (git-reference
            (url "https://github.com/catppuccin/gtk")
            (commit (string-append "v-" version))))
      (file-name (git-file-name name version))
      (sha256 (base32 "0k7vkqyhzikmmlv96h56n7zwxawzbhz3f0jf3r5ajnnc258iyc51"))))
   (inputs (list gtk-engines))
   (native-inputs (list bash-minimal coreutils sassc sed which-package))
   (build-system trivial-build-system)
   (arguments
    '(#:modules ((guix build utils))
      #:builder
      (begin
        (use-modules (guix build utils))
        (let* ((out (assoc-ref %outputs "out"))
               (configdir (string-append out "/etc/xdg"))
               (themesdir (string-append out "/share/themes")))
          (setenv "PATH" (string-trim-right
                          (apply string-append
                                 (map (lambda (input)
                                        (string-append (cdr input) "/bin:"))
                                      %build-inputs))
                          #\:))
          (copy-recursively (assoc-ref %build-inputs "source") (getcwd))
          (for-each make-file-writable (find-files (getcwd)))
          ;; clean-old-theme.sh is invoked by install.sh.
          (for-each patch-shebang '("build.sh" "install.sh" "clean-old-theme.sh"))
          ;; install.sh tries to install a bunch of stuff into $HOME/.config.
          ;; Make it install into /etc/xdg instead.
          (substitute* "install.sh"
            (("\\$\\{?HOME\\}?/\\.config")
             configdir))
          (invoke "./build.sh")
          (mkdir-p themesdir)
          (invoke "./install.sh" "-d" themesdir)
          ;; Instead of Tela-circle, use Papirus.
          ;; (for-each (lambda (file)
          ;;             (substitute* file
          ;;               (("Tela-circle") "Papirus")))
          ;;           (find-files themesdir "/share/themes/[^/]+/index\\.theme$"))
          #t))))
   (home-page "https://github.com/catppuccin/gtk")
   (synopsis "Soothing pastel theme for GTK")
   (description "Soothing pastel theme for GTK 3, GTK 2, GNOME-Shell
and other DEs (like XFCE) using the Catppuccin color palette.  This
theme is based on the Colloid theme made by Vinceliuice.")
   (license license:gpl3)))

(define-public catppuccin-mocha-dark-cursors
  (let ((commit "21942800ad34b357a12079718a1faa88f0bccf28")
        (revision "1")
        (variant "Mocha-Dark"))
    (package
     (name (string-append "catppuccin-" (string-downcase variant) "-cursors"))
     ;; See info '(guix)Version Numbers' for advice.
     (version (git-version "0.0.0" revision commit))
     (source
      (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/catppuccin/cursors")
             (commit commit)))
       (file-name (git-file-name name version))
       (sha256 (base32 "0ay415131hw1zk6aplmhm3vdmrb0rjw6qxz2svagy325jrfd79fk"))))
     (native-inputs (list bash-minimal coreutils findutils gawk gnu-make inkscape xcursorgen))
     (build-system trivial-build-system)
     (arguments
      `(#:modules ((guix build utils))
        #:builder
        (begin
          (use-modules (guix build utils))
          (let ((source (assoc-ref %build-inputs "source"))
                (out (assoc-ref %outputs "out")))
            (setenv "PATH" (string-trim-right
                            (apply string-append
                                   (map (lambda (input)
                                          (string-append (cdr input) "/bin:"))
                                        %build-inputs))
                            #\:))
            (mkdir-p "src")
            ;; Without pruning, there are 8832 .svgs to convert. This
            ;; takes too long. Just keep the ones I actually want.
            (for-each (lambda (item)
                        (copy-recursively (string-append source "/" item) item))
                      (list "AUTHORS" "LICENSE" "Makefile" "build.sh"
                            "src/config" "src/_svgo.yml" "src/cursorList"
                            (string-append "src/Catppuccin-" ,variant "-Cursors")))
            (for-each make-file-writable (find-files (getcwd)))
            (patch-shebang "build.sh")
            (invoke "make")
            (invoke "make" "install" (string-append "PREFIX=" out))
            #t))))
     (home-page "https://github.com/catppuccin/cursors")
     (synopsis "Soothing pastel mouse cursors")
     (description "Soothing pastel cursor theme using the Catppuccin
color palette.  This project is just a modification of Volantes
Cursors with a Catppuccin palettes.")
     (license license:gpl2))))

;; Based on the Arch package:
;; https://github.com/archlinux/svntogit-community/blob/packages/kvantum/trunk/PKGBUILD

;; Based on the "lightly-qt" AUR package:
;; https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lightly-qt
;; lightly is now packaged by Guix upstream
;; (define-public lightly
;;   (package
;;    (name "lightly")
;;    (version "0.4.1")
;;    (source
;;     (origin
;;      (method git-fetch)
;;      (uri (git-reference
;;            (url "https://github.com/Luwx/Lightly")
;;            (commit (string-append "v" version))))
;;      (file-name (git-file-name name version))
;;      (sha256 (base32 "0qkjzgjplgwczhk6959iah4ilvazpprv7yb809jy75kkp1jw8mwk"))))
;;    (build-system qt-build-system)  ; cmake-build-system should be fine too
;;    (native-inputs
;;     (list extra-cmake-modules qtbase-5 qtdeclarative-5 qtx11extras
;;           kconfigwidgets kcoreaddons kdecoration kguiaddons
;;           ki18n kiconthemes kwindowsystem
;;           kde-frameworkintegration  ; optional; Required to use KStyle convenience functionalities in style
;;           kcmutils                  ; optional; Required for lightly-settings5 application to build
;;           kwayland                  ; optional
;;           pkg-config))              ; optional
;;    (home-page "https://github.com/Luwx/Lightly")
;;    (synopsis "A modern style for qt applications")
;;    (description "Lightly is a fork of breeze theme style that aims
;; to be visually modern and minimalistic.")
;;    (license license:gpl2+)))

(define-public catppuccin-kde-theme
  (let ((commit "494c8576b17626a7b2c7a43cec8e6133a5e9c482")
        (revision "1"))
    (package
      (name "catppuccin-kde-theme")
      ;; See info '(guix)Version Numbers' for advice.
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/catppuccin/kde")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256 (base32 "07wizfbr0w23546n2skf8c33nayzxv044spbwrprjmh8sy7v6m7w"))))
      (build-system copy-build-system)
      (arguments
       '(#:install-plan
         '(("Frappe/CatppuccinFrappe.colors" "share/color-schemes/")
           ("Latte/CatppuccinLatte.colors" "share/color-schemes/")
           ("Macchiato/CatppuccinMacchiato.colors" "share/color-schemes/")
           ("Mocha/CatppuccinMocha.colors" "share/color-schemes/")
           ("LICENSE" "share/doc/catppuccin-kde-theme/"))))
      (home-page "https://github.com/catppuccin/cursors")
      (synopsis "Soothing pastel mouse cursors")
      (description "Soothing pastel cursor theme using the Catppuccin
color palette.  This project is just a modification of Volantes
Cursors with a Catppuccin palettes.")
      (license license:gpl2))))