diff options
-rwxr-xr-x | emacs.org | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -325,7 +325,7 @@ Generate a random password between 20 and 40 characters (call-process-shell-command (format "feh --bg-scale %s" (dired-get-filename)) nil 0)) - (defun delete-files-except () + (defun dired-delete-files-except () "Delete all files inside directory except match." (interactive) (let* ((directory (read-directory-name "Select directory: ")) @@ -334,8 +334,18 @@ Generate a random password between 20 and 40 characters (dolist (file files) (unless (or (string= "." (substring file -1)) (string= ".." (substring file -2)) - (string-match except-match file) - (dired-delete-file file t)))))) + (string-match except-match file)) + (dired-delete-file file t))))) + + (defun dired-delete-file-match () + "Delete all files inside directory except match." + (interactive) + (let* ((directory (read-directory-name "Select directory: ")) + (files (directory-files directory t)) + (match (read-string "Delete files that match: "))) + (dolist (file files) + (when (string-match-p match file) + (dired-delete-file file t))))) #+end_src ** Keybindings #+begin_src emacs-lisp @@ -344,7 +354,7 @@ Generate a random password between 20 and 40 characters (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) - (define-key global-map (kbd "C-c d") 'delete-files-except) + (define-key global-map (kbd "C-c d") 'dired-delete-files-except) #+end_src ** All-the-icons #+begin_src emacs-lisp @@ -744,7 +754,7 @@ Generate a random password between 20 and 40 characters ("https://drewdevault.com/blog/index.xml" sourcehut drewdevault) ("https://spacepub.space/feeds/videos.xml?videoChannelId=2" - drewdevault youtube) + drewdevault video) ("https://odysee.com/$/rss/@DistroTube:2" video dt) ("https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA" @@ -868,7 +878,8 @@ Create function to watch videos using ~mpv~ '(("/Public/Inbox" . ?I) ("/Inbox" . ?i) ("/Sent" . ?s) - ("/Guix" . ?g))) + ("/Emacs/dev" . ?e) + ("/Guix/dev" . ?g))) (setq mu4e-contexts (list @@ -1261,8 +1272,8 @@ Set aliases for emacs functions and ~PATH~ (define-key thanos/yeetube (kbd "s") 'yeetube-search) (define-key thanos/yeetube (kbd "b") 'yeetube-play-saved-video) (define-key thanos/yeetube (kbd "d") 'yeetube-download-videos) - (define-key thanos/yeetube (kbd "p") 'yeetube-toggle-pause-mpv) - (define-key thanos/yeetube (kbd "C-p") 'yeetube-toggle-video-mpv) + (define-key thanos/yeetube (kbd "p") 'yeetube-mpv-toggle-pause) + (define-key thanos/yeetube (kbd "C-p") 'yeetube-mpv-toggle-video) (define-key thanos/yeetube (kbd "k") 'yeetube-remove-saved-video) (define-key thanos/yeetube (kbd "u") 'yeetube-change-platform) |