diff options
author | Thanos Apollo <[email protected]> | 2023-08-09 04:16:46 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-08-09 04:16:46 +0300 |
commit | 22b3b0504579e661321ad3fe2f16fd279b85a0b7 (patch) | |
tree | d1cd96e6cee4ccc170b115c95c360f740178c541 | |
parent | e007e631fd1c85ab0dc19d34969c0d45d0044359 (diff) |
emacs: Update dired functions & keys
Add
- dired-watch-vivdeo: Watch video using mpv
- dired-set-wallpaper: Set image as wallpaper using feh
Add those 2 commands as keybindings in dired-mode-map
-rwxr-xr-x | emacs.org | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -310,15 +310,22 @@ Generate a random password between 20 and 40 characters #+begin_src emacs-lisp (defun dired-watch-video () (interactive) - (async-shell-command - (format "mpv \"%s\"" (dired-get-filename)))) + (call-process-shell-command + (format "mpv \"%s\"" (dired-get-filename)) nil 0)) + + (defun dired-set-wallpaper () + "Set NAME as wallpaper." + (interactive) + (call-process-shell-command + (format "feh --bg-scale %s" (dired-get-filename) nil 0))) #+end_src ** Keybindings #+begin_src emacs-lisp (require 'dired) - (define-key dired-mode-map "b" 'dired-up-directory) - (define-key dired-mode-map "v" 'dired-watch-video) - (define-key dired-mode-map "z" 'wdired-change-to-wdired-mode) + (define-key dired-mode-map (kbd "b") 'dired-up-directory) + (define-key dired-mode-map (kbd "v") 'dired-watch-video) + (define-key dired-mode-map (kbd "z") 'wdired-change-to-wdired-mode) + (define-key dired-mode-map (kbd "C-c w") 'dired-set-wallpaper) #+end_src ** All-the-icons #+begin_src emacs-lisp |