diff options
-rw-r--r-- | .config/rofi/config.rasi | 1 | ||||
-rw-r--r-- | .emacs.d/early-init.el | 27 | ||||
-rw-r--r-- | .emacs.d/init.el | 15 | ||||
-rw-r--r-- | .emacs.d/rul-emacs.org | 140 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-dashboard.el | 22 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-fonts.el | 5 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-mail.el | 4 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-org-agenda.el | 30 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-org.el | 26 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-prog.el | 8 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-wm.el | 16 | ||||
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-write.el | 2 | ||||
-rw-r--r-- | .inputrc | 2 | ||||
-rwxr-xr-x | bin/gnome-move-windows | 7 | ||||
-rwxr-xr-x | bin/gnome-set-config | 6 |
15 files changed, 271 insertions, 40 deletions
diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi index d8eed3c..3b108ba 100644 --- a/.config/rofi/config.rasi +++ b/.config/rofi/config.rasi @@ -1,4 +1,5 @@ configuration { + font: "Iosevka 20"; modes: [ combi ]; combi-modes: [ window, drun, run ]; } diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el index 4565a88..5a34cb3 100644 --- a/.emacs.d/early-init.el +++ b/.emacs.d/early-init.el @@ -4,19 +4,30 @@ (scroll-bar-mode -1) ;; Avoid initial flash of light. -;; Inspired on prot-emacs-avoid-initial-flash-of-light. -(setq mode-line-format nil) -(set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") -(set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) +(defun prot-emacs-re-enable-frame-theme (_frame) + "Re-enable active theme, if any, upon FRAME creation. +Add this to `after-make-frame-functions' so that new frames do +not retain the generic background set by the function +`prot-emacs-avoid-initial-flash-of-light'." + (when-let* ((theme (car custom-enabled-themes))) + (enable-theme theme))) + +(defun prot-emacs-avoid-initial-flash-of-light () + "Avoid flash of light when starting Emacs, if needed. +New frames are instructed to call `prot-emacs-re-enable-frame-theme'." + (setq mode-line-format nil) + (set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") + (set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) + (add-hook 'after-make-frame-functions #'prot-emacs-re-enable-frame-theme)) + +(prot-emacs-avoid-initial-flash-of-light) ;; Do not resize when font size changes (setq frame-resize-pixelwise t) -;; By default, start maximized +;; By default, start maximized, undecorated (add-to-list 'default-frame-alist '(fullscreen . maximized)) - -;; No need for titlebar -(modify-frame-parameters nil '((undecorated . t))) +(add-to-list 'default-frame-alist '(undecorated . t)) ;; Name frames to ease switching between them (add-hook 'after-init-hook (lambda () (set-frame-name "main"))) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c0fd0fa..43b9e06 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -6,9 +6,10 @@ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) -(if (file-directory-p "~/.backup") - (setq backup-directory-alist '(("." . "~/.backup"))) - (message "Directory does not exist: ~/.backup")) +(let ((backup-dir "~/.backup")) + (unless (file-directory-p backup-dir) + (make-directory backup-dir t)) + (setq backup-directory-alist `(("." . ,backup-dir)))) (setq backup-by-copying t ; Don't delink hardlinks @@ -51,6 +52,13 @@ (pixel-scroll-precision-mode 1) ; Precision scrolling + +;; Source: https://protesilaos.com/codelog/2024-12-11-emacs-diff-save-some-buffers/ +(add-to-list 'save-some-buffers-action-alist + (list "d" + (lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer))) + "show diff between the buffer and its file")) + ;; Server (require 'server) (setq server-client-instructions nil) ; Keep it quiet when opening an ec @@ -68,6 +76,7 @@ (require 'rul-themes) (require 'rul-bindings) (require 'rul-completion) +(require 'rul-dashboard) (require 'rul-fm) (require 'rul-fonts) (require 'rul-io) diff --git a/.emacs.d/rul-emacs.org b/.emacs.d/rul-emacs.org index f2a3a45..1ba5aae 100644 --- a/.emacs.d/rul-emacs.org +++ b/.emacs.d/rul-emacs.org @@ -40,10 +40,23 @@ Customization of graphical aspects of Emacs, such as size, panels, etc. (scroll-bar-mode -1) ;; Avoid initial flash of light. -;; Inspired on prot-emacs-avoid-initial-flash-of-light. -(setq mode-line-format nil) -(set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") -(set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) +(defun prot-emacs-re-enable-frame-theme (_frame) + "Re-enable active theme, if any, upon FRAME creation. +Add this to `after-make-frame-functions' so that new frames do +not retain the generic background set by the function +`prot-emacs-avoid-initial-flash-of-light'." + (when-let* ((theme (car custom-enabled-themes))) + (enable-theme theme))) + +(defun prot-emacs-avoid-initial-flash-of-light () + "Avoid flash of light when starting Emacs, if needed. +New frames are instructed to call `prot-emacs-re-enable-frame-theme'." + (setq mode-line-format nil) + (set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") + (set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) + (add-hook 'after-make-frame-functions #'prot-emacs-re-enable-frame-theme)) + +(prot-emacs-avoid-initial-flash-of-light) #+end_src ** Frame configuration @@ -59,11 +72,9 @@ environment. ;; Do not resize when font size changes (setq frame-resize-pixelwise t) -;; By default, start maximized +;; By default, start maximized, undecorated (add-to-list 'default-frame-alist '(fullscreen . maximized)) - -;; No need for titlebar -(modify-frame-parameters nil '((undecorated . t))) +(add-to-list 'default-frame-alist '(undecorated . t)) ;; Name frames to ease switching between them (add-hook 'after-init-hook (lambda () (set-frame-name "main"))) @@ -101,9 +112,10 @@ I use package from both stable and bleeding-edge Melpa. Emacs tends to clutter the filesystem with backup files. A backup file is normally the filename with a =~= suffix. I rather have my filesystem clean, and centralize all backups in a single directory. #+begin_src emacs-lisp :tangle "init.el" -(if (file-directory-p "~/.backup") - (setq backup-directory-alist '(("." . "~/.backup"))) - (message "Directory does not exist: ~/.backup")) +(let ((backup-dir "~/.backup")) + (unless (file-directory-p backup-dir) + (make-directory backup-dir t)) + (setq backup-directory-alist `(("." . ,backup-dir)))) (setq backup-by-copying t ; Don't delink hardlinks @@ -156,6 +168,13 @@ General configurations related to text editing across all modes. (setq auto-save-no-message t) ; Do not print a message when auto-saving (pixel-scroll-precision-mode 1) ; Precision scrolling + + +;; Source: https://protesilaos.com/codelog/2024-12-11-emacs-diff-save-some-buffers/ +(add-to-list 'save-some-buffers-action-alist + (list "d" + (lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer))) + "show diff between the buffer and its file")) #+end_src ** Emacs server I used to run Emacs as a systemd daemon, but it was not too deterministic as sometimes it would break. @@ -184,6 +203,7 @@ Now, I simply start it from Emacs itself. This approach works well for me. (require 'rul-themes) (require 'rul-bindings) (require 'rul-completion) +(require 'rul-dashboard) (require 'rul-fm) (require 'rul-fonts) (require 'rul-io) @@ -503,6 +523,31 @@ context-specific actions in the minibuffer, or common buffers. (provide 'rul-completion) #+end_src +** The =dashboard= module +#+begin_src emacs-lisp :tangle "rul-lisp/packages/rul-dashboard.el" +(use-package page-break-lines :ensure t) + +(use-package dashboard + :ensure t + + :config + (dashboard-setup-startup-hook) + + :custom + (dashboard-center-content t) + (dashboard-startup-banner 3) + (dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5) + (agenda . 5) + )) + (dashboard-icon-type 'nerd-icons) + (dashboard-set-heading-icons t) + (dashboard-set-file-icons t) +) + +(provide 'rul-dashboard) +#+end_src ** The =fm= module The =fm= module contains code pertaining to file management. In particular, it's the module that configures =dired= and adds a few extra @@ -559,6 +604,11 @@ installs =fontaine=, a software that allows defining font presets. :default-weight semilight :default-height 230 :bold-weight extrabold) + (writing + :default-height 140 + :default-family "Lato" + :variable-pitch-family "Regular" + ) (t :default-family "Iosevka" :default-weight regular @@ -624,7 +674,9 @@ Emacs can act as Mail User Agent. My preferred package for this is notmuch-hello-auto-refresh t notmuch-hello-recent-searches-max 20 notmuch-hello-thousands-separator "" - notmuch-show-all-tags-list t) + notmuch-show-all-tags-list t + notmuch-show-text/html-blocked-images nil + ) ;; Keymaps (defun rul/capture-mail() @@ -889,7 +941,21 @@ My org mode configuration is quite big, so I split it across multiple files. (setq org-edit-src-content-indentation 0) (use-package org-modern :ensure t) -(use-package org-pomodoro :ensure t) +(use-package org-pomodoro + :ensure t + :config + (defun rul/disable-notifications () + "Disable GNOME notifications." + (shell-command "gsettings set org.gnome.desktop.notifications show-banners false")) + + (defun rul/enable-notifications () + "Enable GNOME notifications." + (shell-command "gsettings set org.gnome.desktop.notifications show-banners true")) + + ;; Add hooks for Pomodoro start and finish + (add-hook 'org-pomodoro-started-hook #'rul/disable-notifications) + (add-hook 'org-pomodoro-finished-hook #'rul/enable-notifications) + (add-hook 'org-pomodoro-killed-hook #'rul/enable-notifications)) ;; (add-hook 'org-mode-hook 'turn-off-auto-fill) ;; (add-hook 'auto-save-hook 'org-save-all-org-buffers) @@ -913,6 +979,10 @@ My org mode configuration is quite big, so I split it across multiple files. (global-set-key (kbd "C-c c") #'org-capture) (global-set-key (kbd "C-c s") #'org-schedule) +(global-set-key (kbd "<f9>") 'bh/punch-in) +(global-set-key (kbd "<f10>") 'bh/punch-out) +(global-set-key (kbd "<f12>") 'org-agenda) + ;; ORG STATES ;; (setq org-todo-keywords (quote ((sequence "TODO(t)" "MAYBE(m)" "NEXT(n)" "|" "DONE(d)") @@ -933,6 +1003,7 @@ My org mode configuration is quite big, so I split it across multiple files. (setq org-log-done (quote time)) (setq org-log-redeadline (quote time)) (setq org-log-reschedule (quote time)) +(setq org-log-into-drawer t) ;; CAPTURE ;; (setq org-capture-templates @@ -957,13 +1028,12 @@ My org mode configuration is quite big, so I split it across multiple files. ("L" "Web Link" entry (file+headline org-refile-path "Read later") - "* %?[[%:link][%:description]] \"\")\n %:initial\n \nCaptured On: %U" + "* %?[[%:link][%:description]]\n %:initial\n \nCaptured On: %U" ) ("l" "Web Link with Selection" entry (file+headline org-refile-path "Read later") - "* [[%:link][%:description]] \n %:initial\n \nCaptured On: %U") - + "* [[%:link][%:description]]\n %:initial\n \nCaptured On: %U") ))) ;; REFILE ;; @@ -1401,7 +1471,7 @@ as the default task." (when bh/keep-clock-running (bh/clock-in-default-task))))))) -(defvar bh/organization-task-id "eb155a82-92b2-4f25-a3c6-0304591af2f9") +(defvar bh/organization-task-id "redefine") ;; org-id-get-create ;; https://stackoverflow.com/a/10091330 (defun zin/org-agenda-skip-tag (tag &optional others) @@ -1434,6 +1504,34 @@ If OTHERS is true, skip all entries that do not correspond to TAG." (add-hook 'org-clock-out-hook 'bh/clock-out-maybe 'append) +;;; Focusing on current work + +(global-set-key (kbd "<f5>") 'bh/org-todo) +(defun bh/org-todo (arg) + (interactive "p") + (if (equal arg 4) + (save-restriction + (bh/narrow-to-org-subtree) + (org-show-todo-tree nil)) + (bh/narrow-to-org-subtree) + (org-show-todo-tree nil))) + +(global-set-key (kbd "<S-f5>") 'bh/widen) +(defun bh/widen () + (interactive) + (if (equal major-mode 'org-agenda-mode) + (progn + (org-agenda-remove-restriction-lock) + (when org-agenda-sticky + (org-agenda-redo))) + (widen))) + +(defun bh/narrow-to-org-subtree () + (widen) + (org-narrow-to-subtree) + (save-restriction + (org-agenda-set-restriction-lock))) + ;; AGENDA VIEW ;; ;; Do not dim blocked tasks @@ -1500,7 +1598,13 @@ on a single file. ;; Python (use-package blacken :ensure t :defer t) -(add-hook 'python-mode-hook 'py-autopep8-enable-on-save) +(with-eval-after-load 'lsp-mode + (lsp-register-client + (make-lsp-client + :new-connection (lsp-stdio-connection '("ruff" "server")) + :activation-fn (lsp-activate-on "python") + :server-id 'ruff-lsp))) +(add-hook 'python-mode-hook #'lsp) ;; Terraform (use-package terraform-mode :ensure t :defer t) diff --git a/.emacs.d/rul-lisp/packages/rul-dashboard.el b/.emacs.d/rul-lisp/packages/rul-dashboard.el new file mode 100644 index 0000000..67bd188 --- /dev/null +++ b/.emacs.d/rul-lisp/packages/rul-dashboard.el @@ -0,0 +1,22 @@ +(use-package page-break-lines :ensure t) + +(use-package dashboard + :ensure t + + :config + (dashboard-setup-startup-hook) + + :custom + (dashboard-center-content t) + (dashboard-startup-banner 3) + (dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5) + (agenda . 5) + )) + (dashboard-icon-type 'nerd-icons) + (dashboard-set-heading-icons t) + (dashboard-set-file-icons t) +) + +(provide 'rul-dashboard) diff --git a/.emacs.d/rul-lisp/packages/rul-fonts.el b/.emacs.d/rul-lisp/packages/rul-fonts.el index 8395292..fdc4cd3 100644 --- a/.emacs.d/rul-lisp/packages/rul-fonts.el +++ b/.emacs.d/rul-lisp/packages/rul-fonts.el @@ -22,6 +22,11 @@ :default-weight semilight :default-height 230 :bold-weight extrabold) + (writing + :default-height 140 + :default-family "Lato" + :variable-pitch-family "Regular" + ) (t :default-family "Iosevka" :default-weight regular diff --git a/.emacs.d/rul-lisp/packages/rul-mail.el b/.emacs.d/rul-lisp/packages/rul-mail.el index dbf9c9b..15354d0 100644 --- a/.emacs.d/rul-lisp/packages/rul-mail.el +++ b/.emacs.d/rul-lisp/packages/rul-mail.el @@ -13,7 +13,9 @@ notmuch-hello-auto-refresh t notmuch-hello-recent-searches-max 20 notmuch-hello-thousands-separator "" - notmuch-show-all-tags-list t) + notmuch-show-all-tags-list t + notmuch-show-text/html-blocked-images nil + ) ;; Keymaps (defun rul/capture-mail() diff --git a/.emacs.d/rul-lisp/packages/rul-org-agenda.el b/.emacs.d/rul-lisp/packages/rul-org-agenda.el index d280d95..ddfbd7e 100644 --- a/.emacs.d/rul-lisp/packages/rul-org-agenda.el +++ b/.emacs.d/rul-lisp/packages/rul-org-agenda.el @@ -366,7 +366,7 @@ as the default task." (when bh/keep-clock-running (bh/clock-in-default-task))))))) -(defvar bh/organization-task-id "eb155a82-92b2-4f25-a3c6-0304591af2f9") +(defvar bh/organization-task-id "redefine") ;; org-id-get-create ;; https://stackoverflow.com/a/10091330 (defun zin/org-agenda-skip-tag (tag &optional others) @@ -399,6 +399,34 @@ If OTHERS is true, skip all entries that do not correspond to TAG." (add-hook 'org-clock-out-hook 'bh/clock-out-maybe 'append) +;;; Focusing on current work + +(global-set-key (kbd "<f5>") 'bh/org-todo) +(defun bh/org-todo (arg) + (interactive "p") + (if (equal arg 4) + (save-restriction + (bh/narrow-to-org-subtree) + (org-show-todo-tree nil)) + (bh/narrow-to-org-subtree) + (org-show-todo-tree nil))) + +(global-set-key (kbd "<S-f5>") 'bh/widen) +(defun bh/widen () + (interactive) + (if (equal major-mode 'org-agenda-mode) + (progn + (org-agenda-remove-restriction-lock) + (when org-agenda-sticky + (org-agenda-redo))) + (widen))) + +(defun bh/narrow-to-org-subtree () + (widen) + (org-narrow-to-subtree) + (save-restriction + (org-agenda-set-restriction-lock))) + ;; AGENDA VIEW ;; ;; Do not dim blocked tasks diff --git a/.emacs.d/rul-lisp/packages/rul-org.el b/.emacs.d/rul-lisp/packages/rul-org.el index b5eae02..409517e 100644 --- a/.emacs.d/rul-lisp/packages/rul-org.el +++ b/.emacs.d/rul-lisp/packages/rul-org.el @@ -13,7 +13,21 @@ (setq org-edit-src-content-indentation 0) (use-package org-modern :ensure t) -(use-package org-pomodoro :ensure t) +(use-package org-pomodoro + :ensure t + :config + (defun rul/disable-notifications () + "Disable GNOME notifications." + (shell-command "gsettings set org.gnome.desktop.notifications show-banners false")) + + (defun rul/enable-notifications () + "Enable GNOME notifications." + (shell-command "gsettings set org.gnome.desktop.notifications show-banners true")) + + ;; Add hooks for Pomodoro start and finish + (add-hook 'org-pomodoro-started-hook #'rul/disable-notifications) + (add-hook 'org-pomodoro-finished-hook #'rul/enable-notifications) + (add-hook 'org-pomodoro-killed-hook #'rul/enable-notifications)) ;; (add-hook 'org-mode-hook 'turn-off-auto-fill) ;; (add-hook 'auto-save-hook 'org-save-all-org-buffers) @@ -37,6 +51,10 @@ (global-set-key (kbd "C-c c") #'org-capture) (global-set-key (kbd "C-c s") #'org-schedule) +(global-set-key (kbd "<f9>") 'bh/punch-in) +(global-set-key (kbd "<f10>") 'bh/punch-out) +(global-set-key (kbd "<f12>") 'org-agenda) + ;; ORG STATES ;; (setq org-todo-keywords (quote ((sequence "TODO(t)" "MAYBE(m)" "NEXT(n)" "|" "DONE(d)") @@ -57,6 +75,7 @@ (setq org-log-done (quote time)) (setq org-log-redeadline (quote time)) (setq org-log-reschedule (quote time)) +(setq org-log-into-drawer t) ;; CAPTURE ;; (setq org-capture-templates @@ -81,13 +100,12 @@ ("L" "Web Link" entry (file+headline org-refile-path "Read later") - "* %?[[%:link][%:description]] \"\")\n %:initial\n \nCaptured On: %U" + "* %?[[%:link][%:description]]\n %:initial\n \nCaptured On: %U" ) ("l" "Web Link with Selection" entry (file+headline org-refile-path "Read later") - "* [[%:link][%:description]] \n %:initial\n \nCaptured On: %U") - + "* [[%:link][%:description]]\n %:initial\n \nCaptured On: %U") ))) ;; REFILE ;; diff --git a/.emacs.d/rul-lisp/packages/rul-prog.el b/.emacs.d/rul-lisp/packages/rul-prog.el index 581dbc1..316736b 100644 --- a/.emacs.d/rul-lisp/packages/rul-prog.el +++ b/.emacs.d/rul-lisp/packages/rul-prog.el @@ -38,7 +38,13 @@ ;; Python (use-package blacken :ensure t :defer t) -(add-hook 'python-mode-hook 'py-autopep8-enable-on-save) +(with-eval-after-load 'lsp-mode + (lsp-register-client + (make-lsp-client + :new-connection (lsp-stdio-connection '("ruff" "server")) + :activation-fn (lsp-activate-on "python") + :server-id 'ruff-lsp))) +(add-hook 'python-mode-hook #'lsp) ;; Terraform (use-package terraform-mode :ensure t :defer t) diff --git a/.emacs.d/rul-lisp/packages/rul-wm.el b/.emacs.d/rul-lisp/packages/rul-wm.el index 99480c3..6c671f7 100644 --- a/.emacs.d/rul-lisp/packages/rul-wm.el +++ b/.emacs.d/rul-lisp/packages/rul-wm.el @@ -6,6 +6,13 @@ (or (derived-mode-p 'org-mode 'org-agenda-mode) (member (buffer-file-name) (org-agenda-files))))) +;; Side window for dictionary +(setq switch-to-buffer-obey-display-actions t) +(add-to-list 'display-buffer-alist + '("^\\*Dictionary\\*" display-buffer-in-side-window + (side . left) + (window-width . 80))) + ;;;; tab-bar.el (let ((map global-map)) (define-key map (kbd "C-<next>") 'tab-bar-switch-to-next-tab) @@ -92,7 +99,7 @@ Also see `prot-window-delete-popup-frame'." command) (define-key map [remap narrow-to-region] #'logos-narrow-dwim) (define-key map [remap forward-page] #'logos-forward-page-dwim) (define-key map [remap backward-page] #'logos-backward-page-dwim) - (define-key map (kbd "<f9>") #'logos-focus-mode)) + (define-key map (kbd "<f7>") #'logos-focus-mode)) ) (use-package beframe @@ -129,4 +136,11 @@ With optional argument FRAME, return the list of buffers of FRAME." (add-to-list 'consult-buffer-sources 'beframe-consult-source))) +(defun kill-project-buffers-and-close-frame () + (interactive) + (project-kill-buffers) + (delete-frame (selected-frame))) + +(define-key global-map (kbd "C-x p K") 'kill-project-buffers-and-close-frame) + (provide 'rul-wm) diff --git a/.emacs.d/rul-lisp/packages/rul-write.el b/.emacs.d/rul-lisp/packages/rul-write.el index 719baaf..de16e98 100644 --- a/.emacs.d/rul-lisp/packages/rul-write.el +++ b/.emacs.d/rul-lisp/packages/rul-write.el @@ -1,5 +1,5 @@ ;;;; `dictionary' -(setq dictionary-server "dict.org" +(setq dictionary-server "localhost" dictionary-default-popup-strategy "lev" dictionary-create-buttons nil dictionary-use-single-buffer t) diff --git a/.inputrc b/.inputrc new file mode 100644 index 0000000..a8e424b --- /dev/null +++ b/.inputrc @@ -0,0 +1,2 @@ +"\M-\C-f": shell-forward-word +"\M-\C-b": shell-backward-word
\ No newline at end of file diff --git a/bin/gnome-move-windows b/bin/gnome-move-windows index 0b6c0cc..f4fcd4e 100755 --- a/bin/gnome-move-windows +++ b/bin/gnome-move-windows @@ -11,7 +11,8 @@ done # Assign windows to predetermined workplaces misc=$(wmctrl -l | awk '/isco|eepa/ {print $1}') main="$(wmctrl -xl | awk '/ emacs/ {print $1}')" -communications="$(wmctrl -l | awk '/ebex|lack|communications|notmuch|elfeed/ {print $1}')" +communications="$(wmctrl -l | awk '/ebex|lack|communications|notmuch|Outlook|elfeed/ {print $1}')" +media="$(wmctrl -l | awk '/YouTube|Spotify/ {print $1}')" terminals="$(wmctrl -l | awk '/Alacritty|kitty|terminal/ {print $1}')" browsers="$(wmctrl -xl | awk '/irefox|hrom/ {print $1}')" @@ -34,3 +35,7 @@ done for window_id in $terminals; do wmctrl -i -r $window_id -t 3 done + +for window_id in $media; do + wmctrl -i -r $window_id -t 8 +done diff --git a/bin/gnome-set-config b/bin/gnome-set-config index 15771d7..69a2b44 100755 --- a/bin/gnome-set-config +++ b/bin/gnome-set-config @@ -18,7 +18,7 @@ for i in $(seq 1 $NUM_WORKSPACES); do done # This configuration is not present in gsettings; we need to fall back to dconf -bindings="emacs org-mode move-windows rofi" +bindings="emacs org-mode move-windows rofi rofi-run" keybindings_key="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings" keybindings=$(echo $bindings | awk -v key="$keybindings_key" '{for(i=1;i<=NF;i++) printf("'\''" key "/" $i "/'\''%s", (i==NF ? "" : ","))}') keybindings="[$keybindings]" @@ -44,3 +44,7 @@ gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward '[]' dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi/binding "'<Super>space'" dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi/command "'rofi -show window'" dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi/name "'rofi'" + +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi-run/binding "'<Super>f2'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi-run/command "'rofi -show run'" +dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/rofi-run/name "'rofi-run'" |