summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2024-10-25 22:40:09 -0400
committerbd <bdunahu@operationnull.com>2024-10-25 22:40:09 -0400
commitd7a389615ac45b5126cc13616e9cdb6bc0807e6c (patch)
tree96a74a587c2e4452221f7cd58c0bbaae2061ebb0 /.config/emacs
parent9076a6c3bd7ccce4dade49f19fd4ea9690dd122c (diff)
dwm -> exwm
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el1
-rw-r--r--.config/emacs/modules/bd--essentials.el1
-rw-r--r--.config/emacs/modules/bd--exwm-windowing.el91
-rw-r--r--.config/emacs/modules/bd--shells.el4
-rw-r--r--.config/emacs/modules/bd--windows.el8
5 files changed, 48 insertions, 57 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 78974d4..20767cd 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -76,6 +76,7 @@
(require 'bd--emms)
(require 'bd--modeline)
(require 'bd--themes)
+(require 'bd--exwm-windowing)
;;; init.el ends here
diff --git a/.config/emacs/modules/bd--essentials.el b/.config/emacs/modules/bd--essentials.el
index 41b0fae..04fc3a2 100644
--- a/.config/emacs/modules/bd--essentials.el
+++ b/.config/emacs/modules/bd--essentials.el
@@ -12,6 +12,7 @@
(global-set-key (kbd "C-z =") 'text-scale-increase)
(global-set-key (kbd "C-z -") 'text-scale-decrease)
(setopt text-scale-mode-step 1.1)
+(repeat-mode 1)
;;;; UI
diff --git a/.config/emacs/modules/bd--exwm-windowing.el b/.config/emacs/modules/bd--exwm-windowing.el
index 9785e7f..1dc5056 100644
--- a/.config/emacs/modules/bd--exwm-windowing.el
+++ b/.config/emacs/modules/bd--exwm-windowing.el
@@ -1,6 +1,5 @@
;;; -*- lexical-binding: t; -*-
;;; Commentary:
-;;; This file is no longer in use!
;;; Code:
@@ -10,7 +9,15 @@
:custom
(desktop-environment-screenshot-directory (xdg-user-dir "PICTURES"))
(desktop-environment-screenshot-command "flameshot full")
- (desktop-environment-screenshot-partial-command "flameshot launcher"))
+ (desktop-environment-screenshot-partial-command "flameshot launcher")
+ (desktop-environment-volume-toggle-command "pactl set-sink-mute @DEFAULT_SINK@ toggle")
+ (desktop-environment-volume-set-command "pactl set-sink-volume @DEFAULT_SINK@ %s")
+ (desktop-environment-volume-get-command "pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'")
+ (desktop-environment-volume-normal-decrement "-4%")
+ (desktop-environment-volume-normal-increment "+4%")
+ (desktop-environment-volume-decrement-slowly "-2%")
+ (desktop-environment-volume-increment-slowly "+2%")
+ (desktop-environment-volume-toggle-regexp nil))
(defun bd/exwm-update-class ()
@@ -29,7 +36,7 @@ that buffer."
bookmark file. If an x window, place in kill-ring."
;; note xdotool had issues with repeated keys when sending to windowid
(interactive)
- (let ((url (car (last (split-string (choose-line-from-file "~/Personal/scripts/bookmarks.txt"))))))
+ (let ((url (car (last (split-string (choose-line-from-file "~/.local/bin/bookmarks.txt"))))))
(if (exwm--buffer->id (current-buffer))
(kill-new url)
(insert url))))
@@ -53,44 +60,25 @@ select a line from a file."
(use-package password-store
:custom
- (password-store-time-before-clipboard-restore 20)
- (define-key global-map (kbd "C-c k") #'password-store-copy))
-
-;; emacs-pinentry; wonderful in EXWM, has security flaws
-(use-package pinentry
- :init
- (pinentry-start)
- :custom
- (pinentry-popup-prompt-window nil))
-
+ (password-store-time-before-clipboard-restore 20))
(use-package exwm
:config
(add-hook 'exwm-init-hook #'bd/exwm-init-hook)
(add-hook 'exwm-update-class-hook #'bd/exwm-update-class)
;; order is important
- (require 'exwm-randr)
- (exwm-randr-enable)
- ;; because my nvidia card is currently unsupported with nouveau,
- ;; xrandr seems to be entirely broken. This line is only here for
- ;; future reference
- ;; (start-process-shell-command "xrandr" nil (expand-file-name "exwm_xrandr.sh" user-emacs-directory))
- (start-process-shell-command "picom" nil "picom")
- (start-process-shell-command "bg" nil "set-bg")
- (start-process-shell-command "xrate" nil "xset r rate 250 70")
-
- (dolist (k '(("s-B" "icecat")))
- (let ((f (lambda () (interactive)
- (save-window-excursion
- (start-process-shell-command (cadr k) nil (cadr k))))))
- (exwm-input-set-key (kbd (car k)) f)
- (define-key exwm-mode-map (kbd (car k)) f)))
+ ;; (dolist (k '(("s-B" "icecat")))
+ ;; (let ((f (lambda () (interactive)
+ ;; (save-window-excursion
+ ;; (start-process-shell-command (cadr k) nil (cadr k))))))
+ ;; (exwm-input-set-key (kbd (car k)) f)
+ ;; (define-key exwm-mode-map (kbd (car k)) f)))
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
(exwm-enable)
(server-start)
:custom
- (exwm-workspace-number 10) ; puts scratch buffer everywhere
+ (exwm-workspace-number 2) ;; two workspaces
(exwm-input-prefix-keys
'(?\C-x
?\C-u
@@ -101,7 +89,8 @@ select a line from a file."
?\M-x
?\M-`
?\M-&
- ?\M-: ))
+ ?\M-:
+ ))
(exwm-input-global-keys
`(([?\s-n] . other-window)
([?\s-p] . (lambda ()
@@ -109,12 +98,13 @@ select a line from a file."
(other-window -1)))
([?\s-L] . desktop-environment-lock-screen)
([f2] . desktop-environment-brightness-decrement)
- ([f3] . desktop-environment-brightness-increment)
- ([f7] . emms-volume-lower)
- ([f8] . emms-volume-raise)
+ ([f3] . desktop-environment-toggle-mute)
+ ([f5] . desktop-environment-volume-decrement)
+ ([f6] . desktop-environment-volume-increment)
+ ([f8] . desktop-environment-brightness-decrement)
+ ([f9] . desktop-environment-brightness-increment)
([f9] . emms-previous)
- ([f10] . emms-pause)
- ([f11] . emms-next)
+ ([f10] . emms-next)
([print] . desktop-environment-screenshot-part)
([S-print] . desktop-environment-screenshot)
([?\s-O] . insert-bookmark)
@@ -145,17 +135,26 @@ select a line from a file."
([?\M-w] . [C-c])
([?\C-y] . [C-v])))
- ;; ,@(mapcar (lambda (i)
- ;; `(,(kbd (format "s-%s" (car i))) .
- ;; (lambda ()
- ;; (interactive
- ;; (exwm-workspace-switch-create ,(car (cdr i)))))))
- ;; '((! 0) (@ 1) (\# 2) ($ 3) (% 4) (^ 5) (& 6) (* 7) (\( 8) (\) 9)))))
-
(exwm-workspace-show-all-buffers t)
- (exwm-layout-show-all-buffers t)
- (exwm-randr-workspace-monitor-plist '(0 "HDMI-1" 6 "HDMI-1" 7 "HDMI-1" 8 "HDMI-1" 9 "HDMI-1")))
-
+ (exwm-layout-show-all-buffers t))
+
+(defvar new-mode-line nil)
+(defun set-new-mode-line ()
+ "Return the current value of my-custom-variable for the mode line."
+ (setq new-mode-line
+ (replace-regexp-in-string
+ "%" "%%"
+ (format " %s %s %s"
+ (shell-command-to-string "mail-string")
+ (shell-command-to-string "power-string")
+ (shell-command-to-string "t1-string")))))
+
+(defvar-local bd/external-mode-line
+ '(:eval (when new-mode-line
+ new-mode-line)))
+
+(run-with-timer t 30 #'set-new-mode-line)
+(add-to-list 'global-mode-string bd/external-mode-line)
(provide 'bd--exwm-windowing)
;;; bd-exwm ends here
diff --git a/.config/emacs/modules/bd--shells.el b/.config/emacs/modules/bd--shells.el
index 309d7ec..dbb2f25 100644
--- a/.config/emacs/modules/bd--shells.el
+++ b/.config/emacs/modules/bd--shells.el
@@ -10,15 +10,13 @@
;; path
(add-to-list 'exec-path "/home/bdunahu/.local/bin")
-;; alias
-
;; completions
(require 'esh-mode)
(keymap-set eshell-mode-map "<tab>" 'completion-at-point)
(setopt eshell-prompt-function 'bd/eshell-prompt
eshell-prompt-regexp "^> "
eshell-scroll-to-bottom-on-input 'this
- eshell-banner-message (concat "\n" (propertize " " 'display (create-image (expand-file-name "~/.config/emacs/images/raven.png") 'png nil :scale 0.2 :align-to "center")) "\n"))
+ eshell-banner-message (concat "\n" (propertize " " 'display (create-image (expand-file-name "~/.config/emacs/images/raven.png") 'png nil :scale 0.8 :align-to "center")) "\n"))
;; prompt
(defun bd/get-prompt-path ()
diff --git a/.config/emacs/modules/bd--windows.el b/.config/emacs/modules/bd--windows.el
index 23ced37..5a338bf 100644
--- a/.config/emacs/modules/bd--windows.el
+++ b/.config/emacs/modules/bd--windows.el
@@ -11,14 +11,6 @@
;; no fringe
(fringe-mode '(0 . 0))
-;; movement
-(keymap-global-unset "C-x o")
-(keymap-global-set "H-n" 'other-window)
-(keymap-global-set "H-p" (lambda ()
- (interactive)
- (other-window -1)))
-(repeat-mode 1)
-
;; dedication
(defun toggle-current-window-dedication ()