ENH move device directory

This commit is contained in:
Nathan Dwarshuis 2020-12-11 16:11:41 -05:00
parent 2ad4386db4
commit abcf0b601a
1 changed files with 7 additions and 6 deletions

View File

@ -233,7 +233,7 @@ desktop file exec directive."
(defconst nd/device-mount-dirs
(list
(f-join "/media" (user-login-name))
(f-join "/tmp/media" (user-login-name))
(f-join "/run" "media" (user-login-name))))
(defun nd/get-mounted-directories ()
@ -3483,11 +3483,12 @@ I handle device mounting using rofi and a custom mounting script (elsewhere in m
(defun nd/find-devices ()
"Navigate to mounted devices."
(interactive)
(let ((mounted (-annotate #'f-filename (nd/get-mounted-directories))))
(-when-let (dev (completing-read "Go to device: " mounted))
(-if-let (path (alist-get dev mounted nil nil #'equal))
(find-file path)
(message "Invalid device: %s" dev)))))
(-if-let (mounted (-annotate #'f-filename (nd/get-mounted-directories)))
(-when-let (dev (completing-read "Go to device: " mounted))
(-if-let (path (alist-get dev mounted nil nil #'equal))
(find-file path)
(message "Invalid device: %s" dev)))
(message "No devices to mount")))
#+END_SRC
*** filtering
:PROPERTIES: