diff options
author | bd <bdunahu@operationnull.com> | 2024-10-25 22:40:09 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-10-25 22:40:09 -0400 |
commit | d7a389615ac45b5126cc13616e9cdb6bc0807e6c (patch) | |
tree | 96a74a587c2e4452221f7cd58c0bbaae2061ebb0 | |
parent | 9076a6c3bd7ccce4dade49f19fd4ea9690dd122c (diff) |
dwm -> exwm
-rw-r--r-- | .config/emacs/init.el | 1 | ||||
-rw-r--r-- | .config/emacs/modules/bd--essentials.el | 1 | ||||
-rw-r--r-- | .config/emacs/modules/bd--exwm-windowing.el | 91 | ||||
-rw-r--r-- | .config/emacs/modules/bd--shells.el | 4 | ||||
-rw-r--r-- | .config/emacs/modules/bd--windows.el | 8 | ||||
-rw-r--r-- | .config/guix/garm.scm | 5 | ||||
-rw-r--r-- | .config/guix/modules/base.scm | 6 | ||||
-rw-r--r-- | .config/guix/modules/dwm.scm | 16 | ||||
-rw-r--r-- | .config/guix/modules/emacs.scm | 5 | ||||
-rw-r--r-- | .config/guix/modules/xorg.scm | 32 |
10 files changed, 67 insertions, 102 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 () diff --git a/.config/guix/garm.scm b/.config/guix/garm.scm index dbf887e..15e010c 100644 --- a/.config/guix/garm.scm +++ b/.config/guix/garm.scm @@ -17,7 +17,7 @@ #:use-module (gnu services pm) #:use-module (guix gexp) #:use-module (modules base) - #:use-module (modules dwm) + ;; #:use-module (modules dwm) #:use-module (modules mail) #:use-module (modules xorg) #:use-module (modules ymir) @@ -32,7 +32,6 @@ ,@bd-mail-home-services ,@bd-desktop-home-services ,@bd-pdf-services - ,@bd-dwm-home-services ,(service home-syncthing-service-type))))) @@ -44,7 +43,7 @@ (packages `(,@bd-base-system-packages ,@bd-desktop-system-packages - ,@bd-dwm-system-packages + ;; ,@bd-dwm-system-packages ;; machine-specific packages ,@(list diff --git a/.config/guix/modules/base.scm b/.config/guix/modules/base.scm index c96bb7b..13f25a3 100644 --- a/.config/guix/modules/base.scm +++ b/.config/guix/modules/base.scm @@ -45,6 +45,7 @@ graphviz ;; graphviz image ;; flameshot imagemagick ;; imagemagick + image-viewers ;; nsxiv librewolf ;; librewolf linux ;; sysstat mail ;; offlineimap @@ -54,8 +55,8 @@ pdf ;; xpdf rsync ;; rsync screen ;; screen - tex ;; texlive-dvipng texlive ;; texlive + tex ;; texlive-dvipng tor-browsers ;; tor-browser version-control ;; git video ;; ffmpeg, mpv, yt-dlp @@ -82,8 +83,9 @@ curl git jq - netcat man-pages + netcat + nsxiv recutils rsync stow diff --git a/.config/guix/modules/dwm.scm b/.config/guix/modules/dwm.scm index c71767e..1befa60 100644 --- a/.config/guix/modules/dwm.scm +++ b/.config/guix/modules/dwm.scm @@ -4,11 +4,9 @@ #:use-module (gnu home services desktop) #:use-module (guix gexp) #:use-module (guix packages) - #:export (bd-dwm-system-packages - bd-dwm-home-services)) + #:export (bd-dwm-system-packages)) (use-package-modules - image-viewers ;; nsxiv suckless ;; dwm xdisorg ;; xdotool xorg ;; xprop @@ -24,18 +22,6 @@ (define bd-dwm-system-packages (list bd-dwm - nsxiv xdotool xprop )) - -(define bd-dwm-home-services - (list - (simple-service 'dotfiles - home-files-service-type - `((".Xresources" - ,(plain-file "Xresources" " -Nsxiv.window.background: #000000 -Nsxiv.window.foreground: #FFFFFF -Nsxiv.bar.font: Terminus:size=9 -")))))) diff --git a/.config/guix/modules/emacs.scm b/.config/guix/modules/emacs.scm index 0c34c8c..b1f58d6 100644 --- a/.config/guix/modules/emacs.scm +++ b/.config/guix/modules/emacs.scm @@ -23,18 +23,20 @@ (define (bd-emacs-package-list config) (list - ;; direct emacs-auctex emacs-consult emacs-denote + emacs-desktop-environment emacs-ef-themes emacs-emms + emacs-exwm emacs-guix emacs-lua-mode emacs-magit emacs-marginalia emacs-orderless emacs-paredit + emacs-password-store emacs-pinentry emacs-popper emacs-rainbow-delimiters @@ -44,7 +46,6 @@ emacs-vertico emacs-visual-fill-column - ;; associative aspell aspell-dict-en )) diff --git a/.config/guix/modules/xorg.scm b/.config/guix/modules/xorg.scm index 11a2e35..52ebf8b 100644 --- a/.config/guix/modules/xorg.scm +++ b/.config/guix/modules/xorg.scm @@ -94,27 +94,21 @@ add mod3 = Hyper_L add mod4 = Super_L Super_R add mod5 = Mode_switch ISO_Level3_Shift ")) + (".Xresources" + ,(plain-file "Xresources" " +Nsxiv.window.background: #000000 +Nsxiv.window.foreground: #FFFFFF +Nsxiv.bar.font: Terminus:size=9 +")) (".xinitrc" ,(plain-file "xinitrc" " #!/bin/sh userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap -sysresources=/etc/X11/xinit/.Xresources -sysmodmap=/etc/X11/xinit/.Xmodmap # merge in defaults and keymaps -if [ -f $sysresources ]; then - - xrdb -merge $sysresources - -fi - -if [ -f $sysmodmap ]; then - xmodmap $sysmodmap -fi - if [ -f \"$userresources\" ]; then xrdb -merge \"$userresources\" @@ -125,18 +119,10 @@ if [ -f \"$usermodmap\" ]; then xmodmap \"$usermodmap\" fi -# start some programs -if [ -d /etc/X11/xinit/xinitrc.d ] ; then - for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do - [ -x \"$f\" ] && . \"$f\" - done - unset f -fi - picom & -dwmstatus & +# dwmstatus & eval \"$(ssh-agent -s)\" -emacs --daemon +# emacs --daemon xss-lock -- slock & set-bg xset r rate 250 70 @@ -144,7 +130,7 @@ xset s 600 touchpad-defaults xrandr-toggle xkeyboard-auto & -exec dwm")) +exec emacs -mm")) (".config/gtk-2.0/settings.ini" ,(plain-file "settings.ini" " [Settings] |