diff mbox series

[bug#44920] : Add fcitx5.

Message ID 86sg8gegjh.fsf@163.com
State Accepted
Headers show
Series [bug#44920] : Add fcitx5. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Zhu Zihao Dec. 8, 2020, 10:30 a.m. UTC
Thanks to upstream maintainer, Fcitx5 now allow us to install addon in
separated prefix without many hacks. (Though some are still needed)

Comments

宋文武 Dec. 8, 2020, 12:43 p.m. UTC | #1
Zhu Zihao <all_but_last@163.com> writes:

> Thanks to upstream maintainer, Fcitx5 now allow us to install addon in
> separated prefix without many hacks. (Though some are still needed)
>

Oh, sorry for my ignorance, I missed this one, as the previous patches
already pushed, could you rebase this patch for master?

Thank you!
diff mbox series

Patch

From d5089c5300a905bd50c1d58c0d0ec71334632945 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Mon, 7 Dec 2020 22:45:06 +0800
Subject: [PATCH 10/10] gnu: Add fcitx5-material-color-theme.

* gnu/packages/fcitx5.scm(fcitx5-material-color-theme): New variable.
---
 gnu/packages/fcitx5.scm | 70 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm
index 19d0f55a7c..0a6a2c45e5 100644
--- a/gnu/packages/fcitx5.scm
+++ b/gnu/packages/fcitx5.scm
@@ -374,3 +374,73 @@  including input methods previous bundled inside Fcitx 4:
    (description "Fcitx5-configtool is a graphical configuration tool
 to manage different input methods in Fcitx 5.")
    (license license:gpl2+)))
+
+(define-public fcitx5-material-color-theme
+  (package
+    (name "fcitx5-material-color-theme")
+    (version "0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hosxy/Fcitx5-Material-Color")
+             (commit version)))
+       (sha256
+        (base32 "1mgc722521jmfx0xc3ibmiycd3q2w7xg2956xcpc07kz90gcdjaa"))))
+    (build-system copy-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (use-modules (srfi srfi-26))
+
+             (let* ((out (assoc-ref outputs "out"))
+                    (assets-dir (string-append
+                                 out "/share/fcitx5-material-color-theme"))
+                    (themes-prefix (string-append out "/share/fcitx5/themes")))
+
+               (define (install-theme-variant variant target)
+                 (let ((dir (string-append themes-prefix "/" target))
+                       (png (string-append "panel-" variant ".png"))
+                       (conf (string-append "theme-" variant ".conf")))
+                   (format #t "install: Installing color variant \"~a\" to ~a~%"
+                           variant dir)
+                   (substitute* conf
+                     (("^Name=.*")
+                      (string-append "Name=" target "\n")))
+                   (mkdir-p dir)
+                   (install-file png dir)
+                   (copy-file conf (string-append dir "/theme.conf"))
+                   (symlink (string-append assets-dir "/arrow.png")
+                            (string-append dir "/arrow.png"))))
+
+               (mkdir-p assets-dir)
+               (install-file "arrow.png" assets-dir)
+               (for-each
+                (lambda (x)
+                  (install-theme-variant
+                   x (string-append "Material-Color-" (string-capitalize x))))
+                '("black" "blue" "brown" "indigo"
+                  "orange" "pink" "red" "teal"))
+
+               (install-theme-variant
+                "deepPurple" "Material-Color-DeepPurple")
+               #t))))))
+    (home-page "https://github.com/hosxy/Fcitx5-Material-Color")
+    (synopsis "Material Design for Fcitx 5")
+    (description "Fcitx5-material-color-theme is a Material Design theme
+for Fcitx 5 with following color variants:
+
+@itemize
+@item Black
+@item Blue
+@item Brown
+@item Indigo
+@item Orange
+@item Pink
+@item Red
+@item teal
+@item DeepPurple
+@end itemize\n")
+    (license license:asl2.0)))
-- 
2.29.2