From b9fb53c365c64c66e3f7fea05b54bec7f7d68100 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 19 Aug 2023 15:35:54 +1000 Subject: Fix various download and incoming dirs --- emacs/.emacs.d/init/ycp-basic.el | 7 ++++--- emacs/.emacs.d/init/ycp-client.el | 9 ++++++--- emacs/.emacs.d/init/ycp-web.el | 7 +++++-- emacs/.emacs.d/lisp/my/my-utils.el | 5 +++++ 4 files changed, 20 insertions(+), 8 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el index 160c385..b03d0d4 100644 --- a/emacs/.emacs.d/init/ycp-basic.el +++ b/emacs/.emacs.d/init/ycp-basic.el @@ -51,15 +51,16 @@ (setq attempt-orderly-shutdown-on-fatal-signal nil) ) -(my-configure +(my-package my-utils (:delay 5) - (require 'my-utils) + (my-setq-from-local my-audio-incoming-dir my-video-incoming-dir + my-document-incoming-dir) (my-keybind global-map "C-c " #'my-rename-file-and-buffer "C-c " #'my-delete-file-and-kill-buffer "C-g" #'my-keyboard-quit-dwim ) -) + ) (provide 'ycp-basic) ;;; ycp-basic.el ends here diff --git a/emacs/.emacs.d/init/ycp-client.el b/emacs/.emacs.d/init/ycp-client.el index 437881f..fa6b809 100644 --- a/emacs/.emacs.d/init/ycp-client.el +++ b/emacs/.emacs.d/init/ycp-client.el @@ -75,16 +75,19 @@ (my-package wget (:delay 60) - (setq wget-download-directory "~/Downloads") + (require 'my-utils) + (setq wget-download-directory my-incoming-dir) (setq my-wget-size-threshold (* 20 1024 1024)) (require 'my-wget) (my-setq-from-local my-wget-video-archive-directory) (my-keybind eww-mode-map "s" #'my-eww-wget-save-page) -) + ) (my-package my-ytdl (:delay 60) - (my-setq-from-local my-ytdl-audio-download-dir my-ytdl-video-download-dir)) + (require 'my-utils) + (setq my-ytdl-audio-download-dir my-audio-incoming-dir + my-ytdl-video-download-dir my-video-incoming-dir)) (my-package my-media-segment (:delay 60)) diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el index 2f08a06..78c1ac2 100644 --- a/emacs/.emacs.d/init/ycp-web.el +++ b/emacs/.emacs.d/init/ycp-web.el @@ -97,7 +97,8 @@ (advice-add 'eww-browse-url :filter-args #'my-rewrite-url-advice) (advice-add 'eww :filter-args #'my-rewrite-url-advice) (setq eww-restore-desktop t) - (setq eww-download-directory (expand-file-name "~/Downloads")) + (require 'my-util) + (setq eww-download-directory my-incoming-dir) (setq eww-bookmarks-directory (locate-user-emacs-file "eww-bookmarks")) (setq eww-history-limit 150) (setq eww-use-external-browser-for-content-type @@ -171,9 +172,11 @@ (my-package my-libgen (:delay 60) + (require 'my-utils) (my-setq-from-local my-libgen-hosts my-libgen-alt-hosts my-libgen-library-hosts - my-libgen-download-dir) + ) + (setq my-libgen-download-dir my-document-incoming-dir) (my-libgen-set-random-hosts)) (my-package my-scihub diff --git a/emacs/.emacs.d/lisp/my/my-utils.el b/emacs/.emacs.d/lisp/my/my-utils.el index fcaba11..1012de8 100644 --- a/emacs/.emacs.d/lisp/my/my-utils.el +++ b/emacs/.emacs.d/lisp/my/my-utils.el @@ -280,6 +280,11 @@ (defun my-get-list-of-docs () (directory-files my-docs-root-dir nil directory-files-no-dot-files-regexp)) +(defvar my-incoming-dir "~/Downloads") +(defvar my-video-incoming-dir my-incoming-dir) +(defvar my-audio-incoming-dir my-incoming-dir) +(defvar my-document-incoming-dir my-incoming-dir) + (defmacro my-with-default-directory (dir &rest body) "Run BODY with the default directory." (declare (indent 1) (debug t)) -- cgit v1.2.3