X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/3b98e899af7321f2a26d414f360ac575ac153b63..5ad7f83aa83c6b4ff6aa6057714ba15d47dfaa0a:/init.org?ds=sidebyside diff --git a/init.org b/init.org index 7a94a54..7add2c1 100644 --- a/init.org +++ b/init.org @@ -40,7 +40,7 @@ To use this config for your Emacs, first you need to clone this repo, then bootstrap Borg, tell Borg to retrieve package submodules, and byte-compiled the packages. Something along these lines should work: -#+begin_src sh +#+begin_src sh :tangle no git clone https://github.com/aminb/dotfiles ~/.emacs.d cd ~/.emacs.d make bootstrap-borg @@ -346,6 +346,26 @@ See [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.htm ** Defaults +*** Time and battery in mode-line + +Enable displaying time and battery in the mode-line, since I'm not +using the Xfce panel anymore. Also, I don't need to see the load +average on a regular basis, so disable that. + +#+begin_src emacs-lisp +(use-package time + :ensure nil + :init + (setq display-time-default-load-average nil) + :config + (display-time-mode)) + +(use-package battery + :ensure nil + :config + (display-battery-mode)) +#+end_src + *** Smaller fringe Might want to set the fringe to a smaller value, especially if using @@ -353,6 +373,7 @@ EXWM. I'm fine with the default for now. #+begin_src emacs-lisp ;; (fringe-mode '(3 . 1)) +(fringe-mode nil) #+end_src *** Disable disabled commands @@ -491,11 +512,80 @@ Roll your own modal mode :demand t :config (require 'exwm-config) - (exwm-config-default) + + ;; Set the initial workspace number. + (setq exwm-workspace-number 4) + + ;; Make class name the buffer name, truncating beyond 50 characters + (defun exwm-rename-buffer () + (interactive) + (exwm-workspace-rename-buffer + (concat exwm-class-name ":" + (if (<= (length exwm-title) 50) exwm-title + (concat (substring exwm-title 0 49) "..."))))) + (add-hook 'exwm-update-class-hook 'exwm-rename-buffer) + (add-hook 'exwm-update-title-hook 'exwm-rename-buffer) + + ;; 's-R': Reset + (exwm-input-set-key (kbd "s-R") #'exwm-reset) + ;; 's-\': Switch workspace + (exwm-input-set-key (kbd "s-\\") #'exwm-workspace-switch) + ;; 's-N': Switch to certain workspace + (dotimes (i 10) + (exwm-input-set-key (kbd (format "s-%d" i)) + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + ;; 's-SPC': Launch application + (exwm-input-set-key + (kbd "s-SPC") + (lambda (command) + (interactive (list (read-shell-command "➜ "))) + (start-process-shell-command command nil command))) + + (exwm-input-set-key (kbd "M-s-SPC") #'counsel-linux-app) + + ;; Shorten 'C-c C-q' to 'C-q' + (define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key) + + ;; Line-editing shortcuts + (setq exwm-input-simulation-keys + '(;; movement + ([?\C-b] . [left]) + ([?\M-b] . [C-left]) + ([?\C-f] . [right]) + ([?\M-f] . [C-right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\M-v] . [prior]) + ([?\C-v] . [next]) + ([?\C-d] . [delete]) + ([?\C-k] . [S-end delete]) + ;; cut/paste + ([?\C-w] . [?\C-x]) + ([?\M-w] . [?\C-c]) + ([?\C-y] . [?\C-v]) + ;; search + ([?\C-s] . [?\C-f]))) + + ;; Enable EXWM + (exwm-enable) + + (add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame) + (require 'exwm-systemtray) (exwm-systemtray-enable) + (require 'exwm-randr) - (exwm-randr-enable)) + (exwm-randr-enable) + + (exwm-input-set-key + (kbd "M-SPC") + (lambda () + (interactive) + (start-process "rofi-pass" nil "rofi-pass")))) #+end_src *** [[https://orgmode.org/][Org mode]] @@ -551,8 +641,8 @@ There's no way I could top that, so I won't attempt to. :bind (:map ivy-minibuffer-map ([escape] . keyboard-escape-quit) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) + ;; ("C-j" . ivy-next-line) + ;; ("C-k" . ivy-previous-line) ([S-up] . ivy-previous-history-element) ([S-down] . ivy-next-history-element) ("DEL" . ivy-backward-delete-char))