From 32f4fef151807a0620fec7654094ed3945a02bcf Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Sat, 28 Nov 2020 13:27:08 +0800 Subject: [PATCH 9/9] 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 bc8fa5d7dc..80fb989408 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -421,3 +421,73 @@ including input methods previous bundled inside Fcitx 4: written in Qt, design for managing different input methods running under 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 "Fcitx 5 theme use Material Design") + (description "Fcitx5-material-color-theme contains Material Design theme +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