fixing corfu
This commit is contained in:
parent
441ab94891
commit
d038151f4f
60
README.org
60
README.org
|
@ -2716,8 +2716,14 @@ Trying out corfu instead of company
|
|||
;; Recommended: Enable Corfu globally.
|
||||
;; This is recommended since dabbrev can be used globally (M-/).
|
||||
:init
|
||||
(add-hook 'global-corfu-mode-hook #'evil-collection-corfu-setup)
|
||||
(global-corfu-mode)
|
||||
(corfu-echo-mode)
|
||||
(advice-remove 'corfu--setup 'evil-normalize-keymaps)
|
||||
(advice-remove 'corfu--teardown 'evil-normalize-keymaps)
|
||||
|
||||
(advice-add 'corfu--setup :after (lambda (&rest r) (evil-normalize-keymaps)))
|
||||
(advice-add 'corfu--teardown :after (lambda (&rest r) (evil-normalize-keymaps)))
|
||||
:general
|
||||
('corfu-map
|
||||
"C-j" 'corfu-next
|
||||
|
@ -4531,7 +4537,7 @@ With empv we can perhaps control mpv much more fine grainly and even search yout
|
|||
(general-def
|
||||
:states 'normal
|
||||
:keymaps 'empv-youtube-results-mode-map
|
||||
"q" 'quit-window
|
||||
"q" 'kill-this-buffer
|
||||
"RET" 'empv-youtube-results-play-or-enqueue-current
|
||||
"i" 'empv-youtube-results-inspect
|
||||
"d" 'chris/empv-yt-dlp
|
||||
|
@ -4615,6 +4621,9 @@ q quit-window
|
|||
} tabulated-list-widen-current-column
|
||||
|
||||
** Elfeed
|
||||
:PROPERTIES:
|
||||
:ID: 20240109T071148.947001
|
||||
:END:
|
||||
#+begin_src emacs-lisp
|
||||
(use-package elfeed
|
||||
:commands (elfeed)
|
||||
|
@ -4637,6 +4646,42 @@ q quit-window
|
|||
(empv-play-or-enqueue url)
|
||||
(elfeed-search-untag-all-unread)))
|
||||
|
||||
(defun chris/empv-ytdlp-play-or-enqueue (process signal video)
|
||||
"play or enqueue a video after ytdlp is done"
|
||||
(when (memq (process-status process) '(exit signal)
|
||||
(empv-play-or-enqueue video)
|
||||
(shell-command-sentinel process signal))))
|
||||
|
||||
(defun chris/elfeed-ytdlp-empv ()
|
||||
"Download the video at point and add to empv"
|
||||
(interactive)
|
||||
(let* ((entry (elfeed-search-selected :ignore-region))
|
||||
(link (elfeed-entry-link entry))
|
||||
(enclosure (elt (car (elfeed-entry-enclosures entry)) 0))
|
||||
(url (if (string-prefix-p "https://thumbnails" enclosure)
|
||||
link
|
||||
(if (string= enclosure nil)
|
||||
link
|
||||
enclosure)))
|
||||
(title (elfeed-entry-title entry))
|
||||
(output-buffer (generate-new-buffer "*yt-dlp*"))
|
||||
(proc (progn
|
||||
(message url)
|
||||
(make-process
|
||||
:name "yt-dlp"
|
||||
:buffer output-buffer
|
||||
:command `("yt-dlp"
|
||||
"-o" "/home/chris/vids/%(title)s.%(ext)s"
|
||||
,(cl-coerce url 'string)))
|
||||
(get-buffer-process output-buffer))))
|
||||
|
||||
(elfeed-search-untag-all-unread)
|
||||
(if (process-live-p proc)
|
||||
(set-process-sentinel
|
||||
proc #'(chris/empv-ytdlp-play-or-enqueue
|
||||
(concat "/home/chris/vids/" title ".webm")))
|
||||
(message "No process running"))))
|
||||
|
||||
(defun chris/elfeed-bongo-insert-item ()
|
||||
"Insert `elfeed' multimedia links in `bongo' playlist buffer.
|
||||
|
||||
|
@ -4758,7 +4803,8 @@ interfere with the default `bongo-playlist-buffer'."
|
|||
"v" 'chris/elfeed-empv-play
|
||||
"h" 'chris/elfeed-bongo-switch-to-playlist
|
||||
"b" 'chris/elfeed-eww-browse
|
||||
"o" 'chris/elfeed-org-view)
|
||||
"o" 'chris/elfeed-org-view
|
||||
"d" 'chris/elfeed-ytdlp-empv)
|
||||
(general-def 'normal elfeed-show-mode-map
|
||||
"o" 'chris/elfeed-org-view
|
||||
"b" 'eww))
|
||||
|
@ -5024,8 +5070,14 @@ Matrix.el is a decent enough matrix client built in emacs. Like it.
|
|||
"gr" 'ement-room-sync
|
||||
"R" 'ement-room-send-reaction)
|
||||
(chris/leader-keys
|
||||
"oM" 'ement-list-rooms))
|
||||
(ement-connect :uri-prefix "http://localhost:8008" :user-id "@chriscochrun:tfcconnection.org")
|
||||
"oM" 'ement-list-rooms
|
||||
"el" 'ement-list-rooms
|
||||
"ev" 'ement-view-room
|
||||
"es" 'ement-directory-search
|
||||
"em" 'ement-send-direct-message
|
||||
"en" 'ement-notifications))
|
||||
|
||||
(ement-connect :uri-prefix "http://127.0.0.1:8008" :user-id "@chriscochrun:tfcconnection.org" :password "UtK4ik#sRx^GVqr@J3YVZ@#m")
|
||||
#+end_src
|
||||
|
||||
** Mastodon
|
||||
|
|
57
init.el
57
init.el
|
@ -1920,8 +1920,14 @@ targets."
|
|||
;; Recommended: Enable Corfu globally.
|
||||
;; This is recommended since dabbrev can be used globally (M-/).
|
||||
:init
|
||||
(add-hook 'global-corfu-mode-hook #'evil-collection-corfu-setup)
|
||||
(global-corfu-mode)
|
||||
(corfu-echo-mode)
|
||||
(advice-remove 'corfu--setup 'evil-normalize-keymaps)
|
||||
(advice-remove 'corfu--teardown 'evil-normalize-keymaps)
|
||||
|
||||
(advice-add 'corfu--setup :after (lambda (&rest r) (evil-normalize-keymaps)))
|
||||
(advice-add 'corfu--teardown :after (lambda (&rest r) (evil-normalize-keymaps)))
|
||||
:general
|
||||
('corfu-map
|
||||
"C-j" 'corfu-next
|
||||
|
@ -3264,7 +3270,7 @@ targets."
|
|||
(general-def
|
||||
:states 'normal
|
||||
:keymaps 'empv-youtube-results-mode-map
|
||||
"q" 'quit-window
|
||||
"q" 'kill-this-buffer
|
||||
"RET" 'empv-youtube-results-play-or-enqueue-current
|
||||
"i" 'empv-youtube-results-inspect
|
||||
"d" 'chris/empv-yt-dlp
|
||||
|
@ -3291,6 +3297,42 @@ targets."
|
|||
(empv-play-or-enqueue url)
|
||||
(elfeed-search-untag-all-unread)))
|
||||
|
||||
(defun chris/empv-ytdlp-play-or-enqueue (process signal video)
|
||||
"play or enqueue a video after ytdlp is done"
|
||||
(when (memq (process-status process) '(exit signal)
|
||||
(empv-play-or-enqueue video)
|
||||
(shell-command-sentinel process signal))))
|
||||
|
||||
(defun chris/elfeed-ytdlp-empv ()
|
||||
"Download the video at point and add to empv"
|
||||
(interactive)
|
||||
(let* ((entry (elfeed-search-selected :ignore-region))
|
||||
(link (elfeed-entry-link entry))
|
||||
(enclosure (elt (car (elfeed-entry-enclosures entry)) 0))
|
||||
(url (if (string-prefix-p "https://thumbnails" enclosure)
|
||||
link
|
||||
(if (string= enclosure nil)
|
||||
link
|
||||
enclosure)))
|
||||
(title (elfeed-entry-title entry))
|
||||
(output-buffer (generate-new-buffer "*yt-dlp*"))
|
||||
(proc (progn
|
||||
(message url)
|
||||
(make-process
|
||||
:name "yt-dlp"
|
||||
:buffer output-buffer
|
||||
:command `("yt-dlp"
|
||||
"-o" "/home/chris/vids/%(title)s.%(ext)s"
|
||||
,(cl-coerce url 'string)))
|
||||
(get-buffer-process output-buffer))))
|
||||
|
||||
(elfeed-search-untag-all-unread)
|
||||
(if (process-live-p proc)
|
||||
(set-process-sentinel
|
||||
proc #'(chris/empv-ytdlp-play-or-enqueue
|
||||
(concat "/home/chris/vids/" title ".webm")))
|
||||
(message "No process running"))))
|
||||
|
||||
(defun chris/elfeed-bongo-insert-item ()
|
||||
"Insert `elfeed' multimedia links in `bongo' playlist buffer.
|
||||
|
||||
|
@ -3412,7 +3454,8 @@ interfere with the default `bongo-playlist-buffer'."
|
|||
"v" 'chris/elfeed-empv-play
|
||||
"h" 'chris/elfeed-bongo-switch-to-playlist
|
||||
"b" 'chris/elfeed-eww-browse
|
||||
"o" 'chris/elfeed-org-view)
|
||||
"o" 'chris/elfeed-org-view
|
||||
"d" 'chris/elfeed-ytdlp-empv)
|
||||
(general-def 'normal elfeed-show-mode-map
|
||||
"o" 'chris/elfeed-org-view
|
||||
"b" 'eww))
|
||||
|
@ -3626,8 +3669,14 @@ interfere with the default `bongo-playlist-buffer'."
|
|||
"gr" 'ement-room-sync
|
||||
"R" 'ement-room-send-reaction)
|
||||
(chris/leader-keys
|
||||
"oM" 'ement-list-rooms))
|
||||
(ement-connect :uri-prefix "http://localhost:8008" :user-id "@chriscochrun:tfcconnection.org")
|
||||
"oM" 'ement-list-rooms
|
||||
"el" 'ement-list-rooms
|
||||
"ev" 'ement-view-room
|
||||
"es" 'ement-directory-search
|
||||
"em" 'ement-send-direct-message
|
||||
"en" 'ement-notifications))
|
||||
|
||||
(ement-connect :uri-prefix "http://127.0.0.1:8008" :user-id "@chriscochrun:tfcconnection.org" :password "UtK4ik#sRx^GVqr@J3YVZ@#m")
|
||||
|
||||
(use-package mastodon
|
||||
:config
|
||||
|
|
Loading…
Reference in a new issue