diff options
-rw-r--r-- | .emacs.d/init.el | 158 | ||||
-rwxr-xr-x | org/emacs.org | 214 |
2 files changed, 151 insertions, 221 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b71310a..68e6213 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -5,56 +5,54 @@ browse-url-generic-program "mullvad-browser") (defconst my-package-list '(org-snooze - all-the-icons - all-the-icons-dired - all-the-icons-ivy-rich - dap-mode - toc-org - emojify - general - doom-themes - gruvbox-theme - doom-modeline - counsel - which-key - ivy - ivy-rich - helpful - password-store - org - org-modern - visual-fill-column - rainbow-delimiters - flycheck - lsp-mode - lsp-ui - json-mode - rjsx-mode - typescript-mode - python-mode - pyvenv - company - company-box - magit - elfeed - elfeed-goodies - paredit - corfu - monkeytype - sudo-edit - exwm - exwm-mff - ;; exwm-firefox-core - consult - alsamixer - simple-httpd - circe - eshell-syntax-highlighting -; pdf-tools - org-superstar - mastodon - dashboard - org-auto-tangle)) + all-the-icons + all-the-icons-dired + all-the-icons-ivy-rich + dap-mode + toc-org + emojify + general + doom-themes + gruvbox-theme + doom-modeline + counsel + which-key + ivy + ivy-rich + helpful + password-store + org + org-modern + visual-fill-column + rainbow-delimiters + flycheck + lsp-mode + lsp-ui + json-mode + rjsx-mode + typescript-mode + python-mode + pyvenv + company + company-box + magit + elfeed + elfeed-goodies + paredit + corfu + monkeytype + sudo-edit + exwm + exwm-mff + ;; exwm-firefox-core + consult + alsamixer + simple-httpd + eshell-syntax-highlighting + org-superstar + mastodon + dashboard + org-auto-tangle)) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") @@ -175,7 +173,7 @@ Contains the list of packages that need to be installed.") :v-adjust -0.05 :face 'font-lock-keyword-face)) -(load-theme 'gruvbox-dark-hard t) +(load-theme 'doom-ayu-dark t) (doom-modeline-mode 1) (setq doom-modeline-height 35) @@ -212,8 +210,6 @@ Contains the list of packages that need to be installed.") ([remap describe-variable] . counsel-describe-variable) ([remap describe-key] . helpful-key)) -(define-key dired-mode-map "b" 'dired-up-directory) - ;;; all-the-icons-dired.el --- Shows icons for each file in dired mode -*- lexical-binding: t; -*- ;;; Code: @@ -367,7 +363,7 @@ Contains the list of packages that need to be installed.") <title>My Title</title> <link rel=\"stylesheet\" href=\"./style.css\"> <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\"> - </head> + p </head> <body> <main> <h1>Starting point</h1> @@ -461,10 +457,14 @@ Contains the list of packages that need to be installed.") (switch-to-buffer (get-buffer-create "*Keimenografos*")) (text-mode)) +(define-key dired-mode-map "b" 'dired-up-directory) + (global-set-key (kbd "<escape>") 'keyboard-escape-quit) -(global-set-key (kbd "s-=") 'text-scale-increase) -(global-set-key (kbd "s--") 'text-scale-decrease) + +(global-set-key (kbd "C-=") 'text-scale-increase) +(global-set-key (kbd "C--") 'text-scale-decrease) (global-set-key (kbd "C-k") 'copy-region-as-kill) + ;; Pass (global-set-key (kbd "C-c p i") 'password-store-insert) (global-set-key (kbd "C-c p e") 'password-store-edit) @@ -516,12 +516,9 @@ Contains the list of packages that need to be installed.") "l" 'display-line-numbers-mode "v" 'multi-vterm "e" 'eshell - "i" 'circe "c" 'apollo/center-buffer "m" 'mu4e - "f" 'elfeed - "C-t" 'telega - "g" 'guix) + "f" 'elfeed) ;;pdf-tools (general-define-key @@ -932,3 +929,44 @@ Contains the list of packages that need to be installed.") (setq message-send-mail-function 'smtpmail-send-it smtpmail-stream-type 'ssl)) + +(add-to-list 'load-path "~/dotfiles/.emacs.d/lisp/") +(require 'erc-sasl) +;; Add SASL server to list of SASL servers (start a new list, if it did not exist) +(add-to-list 'erc-sasl-server-regexp-list "irc\\.libera\\.chat") + +;; Redefine/Override the erc-login() function from the erc package, so that +;; it now uses SASL +(defun erc-login () + "Perform user authentication at the IRC server. (PATCHED)" + (erc-log (format "login: nick: %s, user: %s %s %s :%s" + (erc-current-nick) + (user-login-name) + (or erc-system-name (system-name)) + erc-session-server + erc-session-user-full-name)) + (if erc-session-password + (erc-server-send (format "PASS %s" erc-session-password)) + (message "Logging in without password")) + (when (and (featurep 'erc-sasl) (erc-sasl-use-sasl-p)) + (erc-server-send "CAP REQ :sasl")) + (erc-server-send (format "NICK %s" (erc-current-nick))) + (erc-server-send + (format "USER %s %s %s :%s" + ;; hacked - S.B. + (if erc-anonymous-login erc-email-userid (user-login-name)) + "0" "*" + erc-session-user-full-name)) + (erc-update-mode-line)) + +(erc-tls :server "irc.libera.chat" :port 6697 :nick "thanos_apollo" + :full-name "thanos_apollo" + :password (password-store-get "liberachat/thanos_apollo")) + +;; (defun erc-connect () +;; (interactive) +;; (erc-tls :server "irc.libera.chat" :port 6697 :nick "thanos" +;; :full-name "thanos_apollo" +;; :password (password-store-get "liberachat/thanos_apollo"))) + +;; ;; diff --git a/org/emacs.org b/org/emacs.org index 18ddd86..10ebc67 100755 --- a/org/emacs.org +++ b/org/emacs.org @@ -62,9 +62,7 @@ Request the following packages: consult alsamixer simple-httpd - circe eshell-syntax-highlighting - ; pdf-tools org-superstar mastodon dashboard @@ -202,7 +200,7 @@ Fonts and basic appearance settings #+end_src ** Theme & modeline #+begin_src emacs-lisp - (load-theme 'gruvbox-dark-hard t) + (load-theme 'doom-ayu-dark t) (doom-modeline-mode 1) (setq doom-modeline-height 35) @@ -244,10 +242,6 @@ Fonts and basic appearance settings ([remap describe-key] . helpful-key)) #+end_src * Dired -** Keys -#+begin_src emacs-lisp -(define-key dired-mode-map "b" 'dired-up-directory) -#+end_src ** All-the-icons.el #+begin_src emacs-lisp ;;; all-the-icons-dired.el --- Shows icons for each file in dired mode -*- lexical-binding: t; -*- @@ -414,7 +408,7 @@ Hook with ~dired-mode~ <title>My Title</title> <link rel=\"stylesheet\" href=\"./style.css\"> <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\"> - </head> + p </head> <body> <main> <h1>Starting point</h1> @@ -508,12 +502,16 @@ Hook with ~dired-mode~ (switch-to-buffer (get-buffer-create "*Keimenografos*")) (text-mode)) #+end_src -** Key-bindings +** Keybindings #+begin_src emacs-lisp + (define-key dired-mode-map "b" 'dired-up-directory) + (global-set-key (kbd "<escape>") 'keyboard-escape-quit) - (global-set-key (kbd "s-=") 'text-scale-increase) - (global-set-key (kbd "s--") 'text-scale-decrease) + + (global-set-key (kbd "C-=") 'text-scale-increase) + (global-set-key (kbd "C--") 'text-scale-decrease) (global-set-key (kbd "C-k") 'copy-region-as-kill) + ;; Pass (global-set-key (kbd "C-c p i") 'password-store-insert) (global-set-key (kbd "C-c p e") 'password-store-edit) @@ -568,12 +566,9 @@ Hook with ~dired-mode~ "l" 'display-line-numbers-mode "v" 'multi-vterm "e" 'eshell - "i" 'circe "c" 'apollo/center-buffer "m" 'mu4e - "f" 'elfeed - "C-t" 'telega - "g" 'guix) + "f" 'elfeed) ;;pdf-tools (general-define-key @@ -978,7 +973,7 @@ Hook with ~dired-mode~ (add-hook 'pdf-view-mode-hook 'pdf-view-midnight-minor-mode) (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode)) #+end_src -* mu4e | Email Configuration +* mu4e #+begin_src emacs-lisp ;; Check if we have mu4e available @@ -1041,149 +1036,46 @@ Hook with ~dired-mode~ #+end_src -* EXWM -EXWM configuration is tangled with ~.exwm~ -+ In GuixSD ~emacs-exwm~ package will look for ~~/.exwm~ - -#+begin_src emacs-lisp :tangle ../.exwm.el - - (defun apollo/exwm-init-hook () - "Do this upon start." - (if (string= (system-name) "fsociety") ;; Check if it's my desktop, otherwise display battery - (display-battery-mode 0) - (display-battery-mode 1)) - - (setq display-time-day-and-date t) - (display-time-mode 1) - - (exwm-firefox-holyK-mode 1) - - ;;Launch apps that will run in the background - ;; (apollo/run-in-background "blueman-applet") - (apollo/run-in-background "picom") - ;; (apollo/run-in-background "nm-applet") - (apollo/emacs-keys) - (apollo/restore-wallpaper) - ) - - (defun apollo/exwm-update-class () - (exwm-workspace-rename-buffer exwm-class-name)) - - - (setq exwm-workspace-number 6) - ;; When window "class" updates, use it to set the buffer name - (add-hook 'exwm-update-class-hook #'apollo/exwm-update-class) - - ;;When EXWM starts up, run this hook - (add-hook 'exwm-init-hook #'apollo/exwm-init-hook) - (start-process-shell-command - "xrandr" nil "xrandr --output DisplayPort-0 --primary --mode 2560x1440 --pos 1930x0 --rotate normal --output DisplayPort-1 --off --output DisplayPort-2 --off --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal") - - ;; Set the screen resolution - - (require 'exwm-randr) - (setq exwm-randr-workspace-monitor-plist '(0 "DP-1" 2 "HDMI-A-0")) - (add-hook 'exwm-randr-screen-change-hook - (lambda () - (start-process-shell-command - "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal" ))) - (exwm-randr-enable) - - - ;; Load the system tray before exwm-init - (require 'exwm-systemtray) - (exwm-systemtray-enable) - - ;; These keys should always pass through to Emacs - (setq exwm-input-prefix-keys - '(?\C-x - ?\C-u - ?\C-h - ?\C-w - ?\M-x - ?\M-` - ?\M-& - ?\M-: - ?\s-d - ?\C-\M-j ;; Buffer list - ?\C-\ - ?\C-k - ?\C-y - ?\C-n - ?\C-p - ?\C-f - ?\C-b - ?\C-s - ?\M-f - ?\M-b - ?\M-< - ?\M->)) - - ;; Ctrl+Q will enable the next key to be sent directly - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) - - ;; Set up global key bindings. These always work, no matter the input state! - ;; Keep in mind that changing this list after EXWM initializes has no effect. - (setq exwm-input-global-keys - `( - - ([?\s-r] . exwm-reset) - - - - ;; ;; Launch applications via shell command - ;; ([?\s-&] . (lambda (command) - ;; (interactive (list (read-shell-command "$ "))) - ;; (start-process-shell-command command nil command))) - - ;; Switch workspace - ([?\s-e] . exwm-workspace-switch) - ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0))) - ([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 1))) - ([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 2))) - ([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 3))) - ([?\s-5] . (lambda () (interactive) (exwm-workspace-switch-create 4))) - - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)))) - - (defun exwm-enlarge-horizontally-50 () - (interactive) - (exwm-layout-enlarge-window-horizontally 50)) - - (defun exwm-shrink-horizontally-50 () - "Shrink window horizontally by 10" - (interactive) - (exwm-layout-shrink-window-horizontally 50)) - - (defun exwm-shrink-vertically-50 () - "Shrink window by 50." - (interactive) - (exwm-layout-shrink-window 50)) - - (defun exwm-enlarge-vertically-50 () - "Enlarge window by 50." - (interactive) - (exwm-layout-enlarge-window 50)) - - (exwm-input-set-key (kbd "C-c d") 'dmenu) - (exwm-input-set-key (kbd "s-<tab>") 'rofi) - (exwm-input-set-key (kbd "s-Q") 'kill-emacs) - (exwm-input-set-key (kbd "<XF86AudioRaiseVolume>") 'apollo/volume-increase) - (exwm-input-set-key (kbd "<XF86AudioLowerVolume>") 'apollo/volume-decrease) - (exwm-input-set-key (kbd "s-0") 'apollo/emacs-keys) - (exwm-input-set-key (kbd "s-9") 'apollo/greek-keyboard) - (exwm-input-set-key (kbd "C-c C-<left>") 'exwm-shrink-horizontally-50) - (exwm-input-set-key (kbd "C-c C-<right>") 'exwm-enlarge-horizontally-50) - (exwm-input-set-key (kbd "C-c C-<up>") 'exwm-shrink-vertically-50) - (exwm-input-set-key (kbd "C-c C-<down>") 'exwm-enlarge-vertically-50) - (exwm-input-set-key (kbd "C-c C-e") 'exwm-layout-toggle-fullscreen) - - - (exwm-enable) +* ERC +#+begin_src emacs-lisp + (add-to-list 'load-path "~/dotfiles/.emacs.d/lisp/") + (require 'erc-sasl) + ;; Add SASL server to list of SASL servers (start a new list, if it did not exist) + (add-to-list 'erc-sasl-server-regexp-list "irc\\.libera\\.chat") + + ;; Redefine/Override the erc-login() function from the erc package, so that + ;; it now uses SASL + (defun erc-login () + "Perform user authentication at the IRC server. (PATCHED)" + (erc-log (format "login: nick: %s, user: %s %s %s :%s" + (erc-current-nick) + (user-login-name) + (or erc-system-name (system-name)) + erc-session-server + erc-session-user-full-name)) + (if erc-session-password + (erc-server-send (format "PASS %s" erc-session-password)) + (message "Logging in without password")) + (when (and (featurep 'erc-sasl) (erc-sasl-use-sasl-p)) + (erc-server-send "CAP REQ :sasl")) + (erc-server-send (format "NICK %s" (erc-current-nick))) + (erc-server-send + (format "USER %s %s %s :%s" + ;; hacked - S.B. + (if erc-anonymous-login erc-email-userid (user-login-name)) + "0" "*" + erc-session-user-full-name)) + (erc-update-mode-line)) + + (erc-tls :server "irc.libera.chat" :port 6697 :nick "thanos_apollo" + :full-name "thanos_apollo" + :password (password-store-get "liberachat/thanos_apollo")) + + ;; (defun erc-connect () + ;; (interactive) + ;; (erc-tls :server "irc.libera.chat" :port 6697 :nick "thanos" + ;; :full-name "thanos_apollo" + ;; :password (password-store-get "liberachat/thanos_apollo"))) + + ;; ;; #+end_src - |