summaryrefslogtreecommitdiff
path: root/os/custom/caps-brightness.scm
blob: dbae7484bda47f338034826a98353626452a625f (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
(define-module (caps-brightness)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix build-system trivial)
  #:use-module (gnu packages bash))

(define-public caps-brightness
  (let ((script-name "caps-brightness"))
    (package
     (name script-name)
     (version "0.1")
     (source (local-file "/home/mccd/system/os/custom/caps-brightness"))
     (build-system trivial-build-system)
     (arguments
      `(#:modules ((guix build utils))
	#:builder
	(begin
          (use-modules (guix build utils))
          (let* ((bin-dir  (string-append %output "/bin"))
                 (bin-file (string-append bin-dir "/" ,script-name))
                 (bash-bin (string-append (assoc-ref %build-inputs "bash")
                                          "/bin")))
            (mkdir-p bin-dir)
            (copy-file (assoc-ref %build-inputs "source") bin-file)
            (patch-shebang bin-file (list bash-bin))
            (chmod bin-file #o555)))))
     (inputs `(("bash" ,bash)))
     (home-page #f)
     (synopsis "Set capslock brightness to $1")
     (description "Set capslock brightness to $1")
     (license #f))))