Read wal input file from StumpWM using rofi
This commit is contained in:
parent
fac1f72529
commit
26c220f39d
@ -101,6 +101,17 @@
|
||||
(format nil "SUDO_ASKPASS=~~/bin/stumpwm-sudo.sh sudo -A ~S" ,cmd)
|
||||
,collect-output-p))
|
||||
|
||||
;; Input utilities
|
||||
(defun rofi-completing-read (prompt completions)
|
||||
(string-trim '(#\newline)
|
||||
(run-shell-command
|
||||
(concatenate 'string
|
||||
"echo -e "
|
||||
"'" (format nil "~{~A~^\\n~}" completions) "' "
|
||||
"| rofi -dmenu -p "
|
||||
"'" (string-right-trim ": " prompt) "'")
|
||||
t)))
|
||||
|
||||
;; Commands
|
||||
(defvar desktop-images-dir
|
||||
(uiop:native-namestring "~/Dropbox/pictures/desktop/"))
|
||||
@ -108,7 +119,7 @@
|
||||
(define-stumpwm-type :desktop-image (input prompt)
|
||||
(or (argument-pop-rest input)
|
||||
(concatenate 'string desktop-images-dir
|
||||
(completing-read (current-screen)
|
||||
(rofi-completing-read
|
||||
prompt
|
||||
(mapcar 'file-namestring
|
||||
(uiop:directory-files desktop-images-dir))))))
|
||||
|
Loading…
Reference in New Issue
Block a user