aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules/bard-emacs-web.el
blob: 68fba76f391f72dd17c8ca7fb5aa13ca2f0b35c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
;;; IRC
(use-package circe
  :ensure t
  :config
  (setq auth-sources '("~/.authinfo.gpg"))

  (defun my-fetch-password (&rest params)
    (require 'auth-source)
    (let ((match (car (apply 'auth-source-search params))))
      (if match
          (let ((secret (plist-get match :secret)))
            (if (functionp secret)
                (funcall secret)
              secret))
        (error "Password not found for %S" params))))

  (defun my-nickserv-password (server)
    (my-fetch-password :user "bardman" :machine "irc.libera.chat"))

  (setq circe-network-options
        '(("Libera Chat"
           :nick "bardman"
           ;; :channels ("#emacs" "##anime" "#gentoo")
           :nickserv-password my-nickserv-password))))

(use-package elfeed
  :ensure t
  :config
  (require 'bard-web)
  (global-set-key (kbd "C-c r") 'elfeed)
  (setq elfeed-search-filter "+unread")

  :bind
  (:map elfeed-search-mode-map
        ;; C-p for play now
        ("C-c C-p" . bard/play-elfeed-video)
        ;; C-e for EMMS
        ("C-c C-e" . bard/add-video-emms-queue)
        ;; C-w for watch later
        ("C-c C-w" . bard/add-video-watch-later)
        ;; F is for fetch
        ("F"       . elfeed-update)))

(use-package elfeed-org
  :ensure t
  :init
  (elfeed-org)
  :config
  (setq rmh-elfeed-org-files (list "~/Notes/denote/feeds.org"
                                   "~/Notes/denote/youtube.org")))

(use-package eww
  :defer t
  :config
  (setq browse-url-handlers
        '(("wikipedia\\.org" . eww-browse-url)
          ("github" . browse-url-default-browser)
          ("youtube.com" . browse-url-default-browser)
          ("reddit.com" . browse-url-default-browser)))

  ;; shr optimizations
  (setq shr-use-colors nil)
  (setq shr-use-fonts nil)
  (setq shr-max-image-proportion 0.6)
  (setq shr-image-animate nil)
  (setq shr-width fill-column)
  (setq shr-max-width fill-column)
  (setq shr-discard-aria-hidden t)
  (setq shr-cookie-policy nil)

  ;; eww
  (setq eww-search-prefix "https://duckduckgo.com/html/?q=")
  (setq eww-history-limit 150)
  (setq eww-use-external-browser-for-content-type
        "\\`\\(video/\\|audio\\)")
  :bind
  ("C-c w" . eww))

(provide 'bard-emacs-web)
;;; bard-emacs-web.el ends here