From ed4a1624c3c3f86220596d1d8e5c9965c4e068a1 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 4 Jun 2023 17:17:03 +0300 Subject: desktop: Add test for stumpwm --- desktop.org | 250 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 246 insertions(+), 4 deletions(-) (limited to 'desktop.org') diff --git a/desktop.org b/desktop.org index 94bd45b..5aee6a3 100644 --- a/desktop.org +++ b/desktop.org @@ -22,6 +22,7 @@ [credential "smtp://mail.gandi.net:465"] helper = "!f() { echo username=public@thanosapollo.com; echo \"password=$(pass show gandi/thanosapollo)\"; }; f" + #+end_src * Hyprland ** Config @@ -66,8 +67,8 @@ decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more - active_opacity = 0.98 - inactive_opacity = 0.99 + active_opacity = 0.95 + inactive_opacity = 0.85 rounding = 10 blur = no blur_size = 3 @@ -200,10 +201,11 @@ #+begin_src conf :tangle ~/.config/hypr/hyprpaper.conf preload = ~/wallpapers/wallpaper-cyberpunk.jpg preload = ~/wallpapers/science-athlete.jpg + preload = ~/wallpapers/robo-girl.jpg - wallpaper = DP-1, ~/wallpapers/science-athlete.jpg + wallpaper = DP-1, ~/wallpapers/robo-girl.jpg - wallpaper = HDMI-A-1, ~/wallpapers/science-athlete.jpg + wallpaper = HDMI-A-1, ~/wallpapers/robo-girl.jpg wallpaper = LVDS-1, ~/wallpapers/science-athlete.jpg #+end_src @@ -484,6 +486,7 @@ ** Config #+begin_src conf :tangle ~/.moc/config StartInMusicDir = yes + MusicDir = /home/${USER}/Music # How to sort? FileName is the option's only value for now. Sort = FileName @@ -1278,6 +1281,245 @@ plist_time = green default bold #+end_src +* Stumpwm +#+begin_src lisp :tangle ~/.stumpwm.d/init.lisp + (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" + (user-homedir-pathname)))) + (when (probe-file quicklisp-init) + (load quicklisp-init))) + + (in-package :stumpwm) + (setf *default-package* :stumpwm) + + + ;; autostart + (run-shell-command " + emacs --daemon & + feh --bg-scale ~/wallpapers/robo-girl.jpg & + picom & + setxkbmap us -option ctrl:swapcaps") + + + (setf *mouse-focus-policy* :click) + + ;; prefix key + (set-prefix-key (kbd "C-t")) + + ;; prompt the user for an interactive command. The first arg is an + ;; optional initial contents. + (defcommand colon1 (&optional (initial "")) (:rest) + (let ((cmd (read-one-line (current-screen) ": " :initial-input initial))) + (when cmd + (eval-command cmd t)))) + + ;(define-key *top-map* (kbd "Super-2") (gselect 1)) + ;; Run rofi + (define-key *root-map* (kbd "C-r") "exec rofi -show drun") + (define-key *root-map* (kbd ".") "exec rofi-pass") + + (define-key *root-map* (kbd "e") "exec emacsclient -c") + + (define-key *root-map* (kbd "C-e") "exec emacs --daemon") + + ;; Ssh somewhere + (define-key *root-map* (kbd "C-s") "colon1 exec xterm -e ssh ") + + ;; Lock screen + (define-key *root-map* (kbd "C-l") "exec xlock") + + ;; Audio + (define-key *top-map* (kbd "XF86AudioLowerVolume") "exec pamixer -d 5") + (define-key *top-map* (kbd "XF86AudioRaiseVolume") "exec pamixer -i 5") + + ;;Keyboard-light + (define-key *top-map* (kbd "XF86Explorer") "exec brightnessctl --device='tpacpi::kbd_backlight' set +1") + (define-key *top-map* (kbd "XF86LaunchA") "exec brightnessctl --device='tpacpi::kbd_backlight' set 1-") + + ;; Keyboard layout + (define-key *top-map* (kbd "F1") "exec setxkbmap us") + (define-key *top-map* (kbd "F2") "exec setxkbmap gr") + + ;;; Groups + ;; Switch to group + (define-key *top-map* (kbd "M-1") "gselect 1") + (define-key *top-map* (kbd "M-2") "gselect 2") + (define-key *top-map* (kbd "M-3") "gselect 3") + (define-key *top-map* (kbd "M-4") "gselect 4") + (define-key *top-map* (kbd "M-5") "gselect 5") + (define-key *top-map* (kbd "M-6") "gselect 6") + (define-key *top-map* (kbd "M-7") "gselect 7") + ;; Move window to group + (define-key *top-map* (kbd "M-!") "gmove 1") + (define-key *top-map* (kbd "M-@") "gmove 2") + (define-key *top-map* (kbd "M-#") "gmove 3") + (define-key *top-map* (kbd "M-$") "gmove 4") + (define-key *top-map* (kbd "M-%") "gmove 5") + (define-key *top-map* (kbd "M-^") "gmove 6") + (define-key *top-map* (kbd "M-&") "gmove 7") + ;; Focus + (define-key *top-map* (kbd "M-b") "move-focus left") + (define-key *top-map* (kbd "M-f") "move-focus right") + (define-key *top-map* (kbd "M-n") "move-focus down") + + ;; Web jump (works for DuckDuckGo and Imdb) + (defmacro make-web-jump (name prefix) + `(defcommand ,(intern name) (search) ((:rest ,(concatenate 'string name " Ask the duck: "))) + (nsubstitute #\+ #\Space search) + (run-shell-command (concatenate 'string ,prefix search)))) + + (make-web-jump "duckduckgo" "mullvad-browser https://html.duckduckgo.com/?q=") + ;(make-web-jump "imdb" "firefox http://www.imdb.com/find?q=") + + ;; C-t M-s is a terrble binding, but you get the idea. + (define-key *root-map* (kbd "M-s") "duckduckgo") + + + ;; UI + (setf *message-window-gravity* :center + ,*input-window-gravity* :center + ,*window-border-style :thin + ,*mouse-focus-policy* :click + ,*transient-border-width* 2 + ,*normal-size-border-width* 2) + + ;; Theme + (defvar thanos-nord0 "#2e3440") + (defvar thanos-nord1 "#3b4252") + (defvar thanos-nord2 "#434c5e") + (defvar thanos-nord3 "#4c566a") + (defvar thanos-nord4 "#d8dee9") + (defvar thanos-nord5 "#e5e9f0") + (defvar thanos-nord6 "#eceff4") + (defvar thanos-nord7 "#8fbcbb") + (defvar thanos-nord8 "#88c0d0") + (defvar thanos-nord9 "#81a1c1") + (defvar thanos-nord10 "#5e81ac") + (defvar thanos-nord11 "#bf616a") + (defvar thanos-nord12 "#d08770") + (defvar thanos-nord13 "#ebcb8b") + (defvar thanos-nord14 "#a3be8c") + (defvar thanos-nord15 "#b48ead") + + (setq *colors* + `(,thanos-nord1 ;; 0 black + ,thanos-nord11 ;; 1 red + ,thanos-nord14 ;; 2 green + ,thanos-nord13 ;; 3 yellow + ,thanos-nord10 ;; 4 blue + ,thanos-nord14 ;; 5 magenta + ,thanos-nord8 ;; 6 cyan + ,thanos-nord5)) ;; 7 white + + (when *initializing* + (update-color-map (current-screen))) + + (set-border-color thanos-nord1) + (set-focus-color thanos-nord1) + (set-unfocus-color thanos-nord3) + (set-float-focus-color thanos-nord1) + (set-float-unfocus-color thanos-nord3) + + + (set-fg-color thanos-nord4) + (set-bg-color thanos-nord1) + + + (setf *normal-border-width* 0 + ,*float-window-border* 0 + ,*float-window-title-height* 15 + ,*window-border-style* :none + ,*window-format* "%n:%t") + + (setf *key-seq-color* "^2") + (setf *which-key-format* (concat *key-seq-color* "*~5a^n ~a")) + + + (setf *input-window-gravity* :top + ,*message-window-padding* 10 + ,*message-window-y-padding* 10 + ,*message-window-gravity* :center) + + ;; Message window font + (set-font "-xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-15") + + (set-font "-xos4-terminus-medium-r-normal-*-20-*-*-*-*-*-*-*") + + ;;; Define window placement policy... + + + (defvar *thanos/workspaces* + (list "ALPHA" + "BETA" + "GAMMA" + "DELTA" + "EPSILON" + "ZETA" + "LAMBDA")) + ;; I had to put lambda in there! But I don't want the rest of the letters before it. Don't @ me! + + (stumpwm:grename (nth 0 *thanos/workspaces*)) + (dolist (workspace (cdr *thanos/workspaces*)) + (stumpwm:gnewbg workspace)) + + ;; (defvar *move-to-keybinds* (list "!" "@" "#" "$" "%" "^" "&" "*" "(")) + ;; (dotimes (y (length *ce/workspaces*)) + ;; (let ((workspace (write-to-string (+ y 1)))) + ;; (define-key *root-map* (kbd workspace) (concat "gselect " workspace)) + ;; (define-key *root-map* (kbd (nth y *move-to-keybinds*)) (concat "gmove-and-follow " workspace)))) + + ;; Clear rules + ;; (clear-window-placement-rules) + ;; (setf *dynamic-group-master-split-ratio* 1/2) + ;; ;; Last rule to match takes precedence! + ;; ;; TIP: if the argument to :title or :role begins with an ellipsis, a substring + ;; ;; match is performed. + ;; ;; TIP: if the :create flag is set then a missing group will be created and + ;; ;; restored from *data-dir*/create file. + ;; ;; TIP: if the :restonre flag is set then group dump is restored even for an + ;; ;; existing group using *data-dir*/restore file. + ;; (define-frame-preference "Default" + ;; ;; frame raise lock (lock AND raise == jumpto) + ;; (0 t nil :class "Konqueror" :role "...konqueror-mainwindow") + ;; (1 t nil :class "XTerm")) + + ;; (define-frame-preference "Ardour" + ;; (0 t t :instance "ardour_editor" :type :normal) + ;; (0 t t :title "Ardour Session Control") + ;; (0 nil nil :class "XTerm") + ;; (1 t nil :type :normal) + ;; (1 t t :instance "ardour_mixer") + ;; (2 t t :instance "jvmetro") + ;; (1 t t :instance "qjackctl") + ;; (3 t t :instance "qjackctl" :role "qjackctlMainForm")) + + ;; (define-frame-preference "Shareland" + ;; (0 t nil :class "XTerm") + ;; (1 nil t :class "aMule")) + + ;; (define-frame-preference "Emacs" + ;; (1 t t :restore "emacs-editing-dump" :title "...xdvi") + ;; (0 t t :create "emacs-dump" :class "Emacs")) + ;; Modeline + (setf *window-format* "%m%n%s%c") + (setf *screen-mode-line-format* (list "%g ^> %d")) + + (enable-mode-line (current-screen) (current-head) t) + + (setf *mode-line-timeout* 2) + + (setf *time-modeline-string* "%F %H:%M") + + (setf *group-format* "%t") + + (setf *window-format* "%n: %30t") + + + (setf *mode-line-background-color* thanos-nord1 + ,*mode-line-foreground-color* thanos-nord5) + + (setf *mode-line-border-color* thanos-nord1 + ,*mode-line-border-width* 0) +#+end_src * iSync #+begin_src conf :tangle ~/.mbsyncrc IMAPAccount public -- cgit v1.2.3