summaryrefslogtreecommitdiff
path: root/emacs.org
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-09 04:16:46 +0300
committerThanos Apollo <[email protected]>2023-08-09 04:16:46 +0300
commit22b3b0504579e661321ad3fe2f16fd279b85a0b7 (patch)
treed1cd96e6cee4ccc170b115c95c360f740178c541 /emacs.org
parente007e631fd1c85ab0dc19d34969c0d45d0044359 (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
Diffstat (limited to 'emacs.org')
-rwxr-xr-xemacs.org17
1 files changed, 12 insertions, 5 deletions
diff --git a/emacs.org b/emacs.org
index 32b4934..d87e954 100755
--- a/emacs.org
+++ b/emacs.org
@@ -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