summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-09 10:51:44 +0200
committerThanos Apollo <[email protected]>2023-12-09 10:56:59 +0200
commita5fef6324be38541e28bbf154f321cfa9087d1b1 (patch)
tree4b8d5fc594497bc36ae8b287de89343dc0d9534b
parentf74354ae3d2912686b87d20426d8155865939306 (diff)
emacs: Rewrite thanos/applications-map
- Use defvar-keymap - Rewrite it on thanos-commands.el
-rw-r--r--.emacs.d/init.el3
-rw-r--r--.emacs.d/modules/thanos-chat.el4
-rw-r--r--.emacs.d/modules/thanos-commands.el17
-rw-r--r--.emacs.d/modules/thanos-elfeed.el6
-rw-r--r--.emacs.d/modules/thanos-mu4e.el4
-rw-r--r--.emacs.d/modules/thanos-multimedia.el4
-rw-r--r--.emacs.d/modules/thanos-shells.el2
-rw-r--r--.emacs.d/modules/thanos-tools.el3
8 files changed, 23 insertions, 20 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 77afc00..167b01a 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -42,9 +42,6 @@
sentence-end-double-space nil)
-(define-prefix-command 'thanos/applications-map)
-(global-set-key (kbd "C-c a") 'thanos/applications-map)
-
(define-prefix-command 'Create)
(define-key 'thanos/applications-map (kbd "C-c") 'Create)
diff --git a/.emacs.d/modules/thanos-chat.el b/.emacs.d/modules/thanos-chat.el
index e880ee4..b4b6512 100644
--- a/.emacs.d/modules/thanos-chat.el
+++ b/.emacs.d/modules/thanos-chat.el
@@ -41,6 +41,7 @@
(define-key thanos/applications-map (kbd "M-e") 'ement-login)
;;; Code:
+;; ERC
(require 'erc)
(setf erc-modules
@@ -56,12 +57,11 @@
:user "thanosapollo"
:password (password-store-get "liberachat/thanos_apollo")))
-(define-key thanos/applications-map (kbd "i") 'erc-libera)
+;; Telega
(require 'telega)
(add-hook 'telega-root-mode-hook 'emojify-mode)
(add-hook 'telega-chat-mode-hook 'emojify-mode)
-
(provide 'thanos-chat)
;;; thanos-chat.el ends here
diff --git a/.emacs.d/modules/thanos-commands.el b/.emacs.d/modules/thanos-commands.el
index 7066c3e..6245098 100644
--- a/.emacs.d/modules/thanos-commands.el
+++ b/.emacs.d/modules/thanos-commands.el
@@ -90,6 +90,23 @@
memory cores image (when iso (concat "-cdrom " iso))))))
+(defun thanos/wallpaper-select ()
+ "Set wallpaper."
+ (interactive)
+ (let ((wallpaper (completing-read "Choose wallpaper: " (directory-files wallpapers-dir nil "^[^.].*"))))
+ (thanos/wallpaper-set wallpaper)))
+
+(defvar-keymap thanos/applications-map
+ :doc "Thanos commonly used programs"
+ "m" #'mu4e
+ "c" #'gptel-send
+ "f" #'elfeed
+ "e" #'emms-smart-browse
+ "i" #'erc-libera
+ "t" #'thanos/load-theme
+ "w" #'thanos/wallpaper-select
+ "C-c" 'thanos/create
+ "C-e" #'emms-pause)
(provide 'thanos-commands)
diff --git a/.emacs.d/modules/thanos-elfeed.el b/.emacs.d/modules/thanos-elfeed.el
index 377e510..ed5f4e0 100644
--- a/.emacs.d/modules/thanos-elfeed.el
+++ b/.emacs.d/modules/thanos-elfeed.el
@@ -69,7 +69,9 @@
("https://www.addtoany.com/add_to/feed?linkurl=http%3A%2F%2Fwww.thelancet.com%2Frssfeed%2Flancet_online.xml&type=feed&linkname=The%20Lancet%20Online%20First&linknote="
lancet medicine)
("https://www.addtoany.com/add_to/feed?linkurl=http%3A%2F%2Fwww.thelancet.com%2Frssfeed%2Flanhae_online.xml&type=feed&linkname=The%20Lancet%20Haematology%20Online%20First&linknote="
- lancet haematology medicine)))
+ lancet haematology medicine)
+ ("https://totsipaki.net/ikiwiki/nparafe/%CE%9C%CF%80%CE%BB%CE%BF%CE%B3%CE%BA/index.rss"
+ nikos fsf)))
(defun elfeed-mpv (&optional use-generic-p)
"Play video link with mpv."
@@ -85,10 +87,8 @@
(setf elfeed-goodies/entry-pane-size 0.55)
(elfeed-goodies/setup)
-(define-key thanos/applications-map (kbd "f") 'elfeed)
(define-key elfeed-search-mode-map (kbd "v") 'elfeed-mpv)
(define-key elfeed-search-mode-map (kbd "U") 'elfeed-update)
-(define-key thanos/applications-map (kbd "f") 'elfeed)
(provide 'thanos-elfeed)
;;; thanos-elfeed.el ends here
diff --git a/.emacs.d/modules/thanos-mu4e.el b/.emacs.d/modules/thanos-mu4e.el
index 8a09b95..8b2e372 100644
--- a/.emacs.d/modules/thanos-mu4e.el
+++ b/.emacs.d/modules/thanos-mu4e.el
@@ -120,15 +120,11 @@
(add-hook 'mu4e-main-mode-hook #'(lambda ()
(display-line-numbers-mode -1)
(auto-save-mode -1)))
-
-
;; Sign messages
(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)
(require 'mu4e-alert)
(mu4e-alert-enable-mode-line-display)
-(define-key thanos/applications-map (kbd "m") 'mu4e)
-
(provide 'thanos-mu4e)
;;; thanos-mu4e.el ends here
diff --git a/.emacs.d/modules/thanos-multimedia.el b/.emacs.d/modules/thanos-multimedia.el
index 4c2a847..4eb1769 100644
--- a/.emacs.d/modules/thanos-multimedia.el
+++ b/.emacs.d/modules/thanos-multimedia.el
@@ -32,8 +32,6 @@
;; EMMS
(require 'emms)
(autoload 'emms-smart-browse "emms-browser.el" "Browse with EMMS" t)
-(define-key thanos/applications-map (kbd "e") 'emms-smart-browse)
-(define-key thanos/applications-map (kbd "C-e") 'emms-pause)
(with-eval-after-load 'emms
(emms-all)
@@ -45,8 +43,6 @@
(setf emms-player-mpv-parameters "--gpu-context=x11")
(define-key emms-playlist-mode-map (kbd "A") #'emms-add-directory-tree)
-(define-key thanos/applications-map (kbd "e") 'emms-smart-browse)
-
(defun yeetube-download-vimeo-videos ()
"Download videos from vimeo services."
diff --git a/.emacs.d/modules/thanos-shells.el b/.emacs.d/modules/thanos-shells.el
index 545bd26..fdca336 100644
--- a/.emacs.d/modules/thanos-shells.el
+++ b/.emacs.d/modules/thanos-shells.el
@@ -170,4 +170,4 @@
(provide 'thanos-shells)
-;;; thanos-eshell.el ends here
+;;; thanos-shells.el ends here
diff --git a/.emacs.d/modules/thanos-tools.el b/.emacs.d/modules/thanos-tools.el
index 6be911c..41d4592 100644
--- a/.emacs.d/modules/thanos-tools.el
+++ b/.emacs.d/modules/thanos-tools.el
@@ -139,7 +139,6 @@
;; Python
(require 'python-mode)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
-(add-hook 'python-mode #'eglot)
;; json
(require 'json-mode)
@@ -148,8 +147,6 @@
;; ChatGPT
(require 'gptel)
-(define-key 'thanos/applications-map (kbd "c") 'gptel-send)
-
(setf gptel-api-key (password-store-get "chatgpt/api")
gptel-model 'gpt-4-32k)