Transmission: Advice the function to properly start the daemon on demand
parent
562e65d66a
commit
e796b4ec74
|
@ -336,8 +336,17 @@
|
|||
;;; Torrent
|
||||
(nconc package-selected-packages '(transmission))
|
||||
(with-eval-after-load 'transmission
|
||||
(call-process "transmission-daemon")
|
||||
(sleep-for 1)
|
||||
;; `transmission' will fail to start and will not run any hook if the daemon
|
||||
;; is not up yet.
|
||||
;; We need to advice the function :before to guarantee it starts.
|
||||
(defun transmission-start-daemon ()
|
||||
(unless (member "transmission-da"
|
||||
(mapcar
|
||||
(lambda (pid) (alist-get 'comm (process-attributes pid)))
|
||||
(list-system-processes)))
|
||||
(call-process "transmission-daemon")
|
||||
(sleep-for 1)))
|
||||
(advice-add 'transmission :before 'transmission-start-daemon)
|
||||
(setq transmission-refresh-modes '(transmission-mode transmission-files-mode transmission-info-mode transmission-peers-mode)
|
||||
transmission-refresh-interval 1))
|
||||
|
||||
|
|
Loading…
Reference in New Issue