aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-02 07:17:34 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-05 02:59:45 +0100
commit65aa56eee6bc5423569a605b08b66bdf8383e7c8 (patch)
treec14edba0405f0980155d1c57a49e560562bb71c3
parent1b3c266d7711dfa1fe04800fd558a2bf84d09819 (diff)
downloaddotfiles-65aa56eee6bc5423569a605b08b66bdf8383e7c8.tar.gz
dotfiles-65aa56eee6bc5423569a605b08b66bdf8383e7c8.tar.bz2
dotfiles-65aa56eee6bc5423569a605b08b66bdf8383e7c8.zip
+custom rss module
When using the inbuilt RSS module, this becomes my personal config for that module. However, when not using that and instead using the newsticker inbuilt for Emacs, I've got a config for that as well.
-rw-r--r--Doom/.doom.d/init.el1
-rw-r--r--Doom/.doom.d/modules/private/rss/README.org13
-rw-r--r--Doom/.doom.d/modules/private/rss/config.el50
-rw-r--r--Doom/.doom.d/modules/private/rss/packages.el4
-rw-r--r--Doom/.doom.d/org/config.org30
5 files changed, 73 insertions, 25 deletions
diff --git a/Doom/.doom.d/init.el b/Doom/.doom.d/init.el
index e5ddbed..79d57f9 100644
--- a/Doom/.doom.d/init.el
+++ b/Doom/.doom.d/init.el
@@ -11,6 +11,7 @@
(oreoline)
(gentemplate)
(ocaml +lsp)
+ (rss +elfeed)
:input
;;chinese
;;japanese
diff --git a/Doom/.doom.d/modules/private/rss/README.org b/Doom/.doom.d/modules/private/rss/README.org
new file mode 100644
index 0000000..3a025d4
--- /dev/null
+++ b/Doom/.doom.d/modules/private/rss/README.org
@@ -0,0 +1,13 @@
+#+TITLE: private/rss
+#+DATE: May 2, 2020
+
+* Description
+This module allows the manipulation and usage of the /newsticker/ system. This is a nice RSS reader inbuilt to Emacs.
+
+Use =+rss/set-feed-urls= to set the urls for use in newsticker. Bind
+=+rss/open-newsticker= =+rss/close-newsticker= to appropriate bindings.
+* Prerequisites
+None
+* Requirements
+- cl-lib
+- newsticker
diff --git a/Doom/.doom.d/modules/private/rss/config.el b/Doom/.doom.d/modules/private/rss/config.el
new file mode 100644
index 0000000..035c2d3
--- /dev/null
+++ b/Doom/.doom.d/modules/private/rss/config.el
@@ -0,0 +1,50 @@
+;;; private/rss/config.el -*- lexical-binding: t; -*-
+
+(require 'seq)
+(require 'cl-lib)
+
+(defvar +rss/feed-urls '(("Arch Linux" "https://www.archlinux.org/feeds/news/" Linux)
+ ("LEMMiNO" "https://www.youtube.com/feeds/videos.xml?channel_id=UCRcgy6GzDeccI7dkbbBna3Q" YouTube)
+ ("Gamer from Mars" "https://www.youtube.com/feeds/videos.xml?channel_id=UCJ6z_yj_dDNrhn-c8ZyKV4g" YouTube)
+ ("Pop Culture Detective" "https://www.youtube.com/feeds/videos.xml?channel_id=UCHiwtz2tCEfS17N9A-WoSSw" YouTube)
+ ("Dark Sominium" "https://www.youtube.com/feeds/videos.xml?channel_id=UC_e39rWdkQqo5-LbiLiU10g" YouTube)
+ ("Nexpo" "https://www.youtube.com/feeds/videos.xml?channel_id=UCpFFItkfZz1qz5PpHpqzYBw" YouTube)
+ ("Techquickie" "https://www.youtube.com/feeds/videos.xml?channel_id=UC0vBXGSyV14uvJ4hECDOl0Q" YouTube)
+ ("3B1B" "https://www.youtube.com/feeds/videos.xml?channel_id=UCYO_jab_esuFRV4b17AJtAw" YouTube)))
+
+
+(when (featurep! +elfeed)
+ (after! elfeed
+ (setq elfeed-feeds (cl-map 'list (lambda (item) (list (nth 1 item) (nth 2 item))) +rss/feed-urls))))
+
+(when (featurep! +newsticker)
+ (defun +rss/set-feed-urls (LIST)
+ "Set the newsticker-url-list to LIST. LIST should have format =(TAG URL START_TIME INTERVAL)="
+ (setq newsticker-url-list LIST))
+
+ (defun +rss/get-newsticker-buffers ()
+ "Using seq, filter the buffer list for newsticker buffers"
+ (seq-remove (lambda (buffer)
+ (not (and (cl-search "*Newsticker" (buffer-name buffer))
+ (= (cl-search "*Newsticker" (buffer-name buffer))))))
+ (buffer-list)))
+
+ (defun +rss/close-newsticker()
+ "Routine to close the newsticker system"
+ (interactive)
+ (newsticker-stop)
+ (dolist (buf (+rss/get-newsticker-buffers))
+ (kill-buffer buf))
+ (+workspace/delete "RSS"))
+
+ (use-package! newsticker
+ :config
+ (+rss/set-feed-urls ; Format is =(TAG URL START_TIME INTERVAL)=
+ (cl-map 'list (lambda (item) (list (nth 0 item) (nth 1 item) nil 3600)) +rss/feed-urls))
+
+ (defun +rss/open-newsticker ()
+ "Routine to start and open the newsticker"
+ (interactive)
+ (newsticker-start)
+ (+workspace/new "RSS")
+ (newsticker-treeview))))
diff --git a/Doom/.doom.d/modules/private/rss/packages.el b/Doom/.doom.d/modules/private/rss/packages.el
new file mode 100644
index 0000000..59d7afe
--- /dev/null
+++ b/Doom/.doom.d/modules/private/rss/packages.el
@@ -0,0 +1,4 @@
+;; -*- no-byte-compile: t; -*-
+;;; private/rss/packages.el
+
+(package! elfeed)
diff --git a/Doom/.doom.d/org/config.org b/Doom/.doom.d/org/config.org
index 9414dd6..49e4977 100644
--- a/Doom/.doom.d/org/config.org
+++ b/Doom/.doom.d/org/config.org
@@ -60,29 +60,6 @@ Easier to do than just running all those functions manually
:leader
:desc "Start debugging setup" "cD" #'dx:debug)
#+END_SRC
-** Elfeed
-Custom functions to work with elfeed, generating new feeds on demand and adding
-a keybind to help with that.
-*** Feeds
-Feeds for elfeed to download from.
-#+BEGIN_SRC elisp
-(setq elfeed-feeds
- '(("http://feeds.bbci.co.uk/news/rss.xml" news)
- ("http://www.technologyreview.com/rss")
- ("https://news.ycombinator.com/rss" news compsci)))
-#+END_SRC
-
-*** Keybinds
-Keybinds for elfeed locally and for the leader.
-#+BEGIN_SRC elisp
-(map!
- (:map elfeed-search-mode-map
- :localleader
- :desc "Update feeds" "u" #'elfeed-update)
- (:leader
- :prefix "o"
- :desc "Open RSS" "f" #'=rss))
-#+END_SRC
** Dashboard
My very own dashboard config using doom dashboard, with these features:
- Custom load message
@@ -530,8 +507,11 @@ General keymap
(:prefix ("f" . "files")
:desc "Open dotfiles" "p" #'(lambda () (interactive) (doom-project-find-file "~/Dotfiles")))
(:prefix ("o" . "open")
- :after org
- :desc "Calendar" "c" #'=calendar)
+ (:when (featurep! private rss newsticker)
+ :desc "Open newsticker" "n" #'+rss/open-newsticker
+ :desc "Close newsticker" "N" #'+rss/close-newsticker)
+ (:after org
+ :desc "Calendar" "c" #'=calendar))
(:prefix ("n" . "notes")
:desc "Open notes in dired" "-" #'(lambda () (interactive) (dired org-directory))))
#+END_SRC