+ (inputs (list bash-minimal python-nerd-dictation sox ydotool))
+ (build-system trivial-build-system)
+ (arguments
+ (list
+ #:modules '((guix build utils))
+ #:builder
+ #~(begin
+ (use-modules (guix build utils))
+ (let* ((out (assoc-ref %outputs "out"))
+ (exe (string-append out "/bin/nerd-dictation")))
+
+ (mkdir-p (dirname exe))
+ (call-with-output-file exe
+ (lambda (port)
+ (format port "#!~a
+if [ \"$1\" = begin ]
+ then
+ exec ~a $@ --input=SOX --simulate-input-tool=YDOTOOL
+ else
+ exec ~a $@
+fi"
+ #$(file-append bash-minimal "/bin/bash")
+ #$(file-append python-nerd-dictation
+ "/bin/nerd-dictation")
+ #$(file-append python-nerd-dictation
+ "/bin/nerd-dictation"))))
+ (chmod exe #o555)))))))