(message "running desktop.el")
exwm set up is based off the following styles:
- i3 keybindings - https://i3wm.org/docs/refcard.htm
- Spacemacs exwm port - https://github.com/timor/spacemacsOS
- System Craters - David Wilson https://config.daviwil.com/desktop
(defvar exwm-buffer-name-prefix "X:"
"A prefix to append to each buffer managed by exwm")
(defvar exwm-app-launcher--prompt "$ "
"Prompt for the EXWM application launcher")
(defvar exwm-toggle-workspace 1
"Previously selected workspace. Used with `my/exwm-jump-to-last-exwm'.")
(defun my/run-in-background (command)
(let ((command-parts (split-string command "[ ]+")))
(condition-case ex
(apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))
('error (message (format "ERROR: Cannot start process: %s" ex)))
)))
(defun my/exwm-jump-to-last-exwm ()
(interactive)
(exwm-workspace-switch exwm-toggle-workspace))
(defun my/exwm-rename-buffer ()
(let* ((part1 exwm-class-name)
(part2 (when (not (string-equal exwm-class-name exwm-title))
(concat "/" exwm-title)))
(name (concat exwm-buffer-name-prefix part1 (or part2 "")))
(maxlen 40))
(exwm-workspace-rename-buffer (if (> (length name) maxlen)
(concat (cl-subseq name 0 (- maxlen 3)) "...")
name))))
(defun my/configure-window-by-class ()
(interactive)
(pcase exwm-class-name
;;("Firefox" (exwm-workspace-move-window 2))
("mpv" (exwm-floating-toggle-floating)
(exwm-layout-toggle-mode-line))))
;; This function should be used only after configuring autorandr!
(defun my/update-displays ()
(my/run-in-background "autorandr --change --force")
(my/set-wallpaper)
(message "Display config: %s"
(string-trim (shell-command-to-string "autorandr --current"))))
;; Simulate insert state by using line mode without passthrough
(defun my/exwm-enter-insert-state ()
(interactive)
(setq exwm-input-line-mode-passthrough nil)
(call-interactively 'exwm-input-grab-keyboard)
(evil-insert-state))
;; Simulate normal state by using line mode with passthrough, i.e. forward all commands to emacs
(defun my/exwm-enter-normal-state ()
(interactive)
(setq exwm-input-line-mode-passthrough t)
(call-interactively 'exwm-input-grab-keyboard)
(evil-normal-state))
(defun my/exwm-escape ()
"Switch to normal state, and cancel possible fullscreen layout. Also close minibuffer."
(interactive)
(my/exwm-enter-normal-state)
(exwm-layout-unset-fullscreen)
(when (active-minibuffer-window)
(minibuffer-keyboard-quit)))
(defun my/exwm-enter-char-mode ()
"Enter EXWM char mode."
(interactive)
(when exwm--id
(my/exwm-enter-insert-state)
(call-interactively 'exwm-input-release-keyboard)))
(defun my/exwm-buffers-info ()
(interactive)
"Helper, return information about open exwm windows"
(cl-loop for buffer in (buffer-list)
for name = (buffer-name buffer)
for ecname = (buffer-local-value 'exwm-class-name buffer)
when ecname
do (message "Buffer name: '%s', exwm class name: '%s'" name ecname)))
(defun my/set-wallpaper ()
(interactive)
;; NOTE: You will need to update this to a valid background path!
(start-process-shell-command
"feh" nil "feh --bg-scale ~/Pictures/bg-metal.png"))
Use counsel-linux-app but wrap with split functions
(defun my/counsel-linux-app-action-split(desktop-shortcut)
(my/window-split-and-follow)
(counsel-linux-app-action-default desktop-shortcut))
(defun my/counsel-linux-app-action-vsplit(desktop-shortcut)
;; (my/window-vsplit-and-follow)
(interactive)
(split-window-right)
(balance-windows)
(windmove-right)
(counsel-linux-app-action-default desktop-shortcut))
;;TODO refactor these to a single function
(defun my/counsel-linux-app-split (&optional arg)
(interactive "P")
(ivy-read "(Below)Run application: " (counsel-linux-apps-list)
:predicate (unless arg (lambda (x) (get-text-property 0 'visible (car x))))
:action #'my/counsel-linux-app-action-split
:caller 'my/counsel-linux-app-split))
:sort t
(defun my/counsel-linux-app-vsplit (&optional arg)
(interactive "P")
(ivy-read "(Right) Run application: " (counsel-linux-apps-list)
:predicate (unless arg (lambda (x) (get-text-property 0 'visible (car x))))
:action #'my/counsel-linux-app-action-vsplit
:caller 'my/counsel-linux-app-vsplit))
:sort t
(defun my/counsel-linux-app (&optional arg)
(interactive "P")
(ivy-read "(Buffer)Run application : " (counsel-linux-apps-list)
:predicate (unless arg (lambda (x) (get-text-property 0 'visible (car x))))
:action #'counsel-linux-app-action-default
:caller 'my/counsel-linux-app))
:sort t
(defun my/update-displays ()
(shell-command-to-string "autorandr --change --force")
(my/set-wallpaper)
(message "Display config: %s"
(string-trim (shell-command-to-string "autorandr --current"))))
(defun my/lock-screen ()
(interactive)
(my/run-in-background "~/bin/lock.sh"))
(defun my/exwm-org-capture ()
(interactive)
(my/run-in-background "~/bin/emacs-capture --eval 'org-capture'"))
(defun my/exwm-init-hook ()
;; Make workspace 1 be the one where we land at startup
(exwm-workspace-switch-create 1)
;; Open dashboard by default
(dashboard-refresh-buffer)
;; NOTE: The next two are disabled because we now use Polybar!
;;(display-battery-mode 1)
;;(setq display-time-day-and-date t)
;;(display-time-mode 1)
;; Start the Polybar panel
(my/start-panel)
;; Launch apps that will run in the background
(my/run-in-background "dunst")
(my/run-in-background "nm-applet")
(my/run-in-background "barrier")
(my/run-in-background "pasystray")
(my/run-in-background "blueberry-tray")
(my/run-in-background "dropbox")
)
We use the excellent EXWM module as the basis for our Emacs Desktop Environment. The EXWM Wiki is a great place to find tips about how to configure everything!
NOTE: Make sure you’ve installed nm-applet
, pasystray
and blueman
for the system tray apps to work!
(use-package exwm
:config
(setq exwm-layout-auto-iconify t)
;;(setq exwm-workspace-number 5)
(add-hook 'exwm-update-class-hook #'my/exwm-rename-buffer)
(add-hook 'exwm-update-title-hook #'my/exwm-rename-buffer)
;; Configure windows as they're created
(add-hook 'exwm-manage-finish-hook #'my/configure-window-by-class)
;;(add-hook 'exwm-manage-finish-hook 'my/exwm-enter-insert-state)
;; When EXWM starts up, do some extra confifuration
(add-hook 'exwm-init-hook #'my/exwm-init-hook)
;; NOTE: Uncomment the following two options if you want window buffers
;; to be available on all workspaces!
;; Automatically move EXWM buffer to current workspace when selected
;; (setq exwm-layout-show-all-buffers t)
;; Display all EXWM buffers in every workspace buffer list
;; (setq exwm-workspace-show-all-buffers t)
;; NOTE: Uncomment this option if you want to detach the minibuffer!
;; Detach the minibuffer (show it with exwm-workspace-toggle-minibuffer)
;;(setq exwm-workspace-minibuffer-position 'top)
;; Set the screen resolution (update this to be the correct resolution for your screen!)
(require 'exwm-randr)
(exwm-randr-enable)
;;(start-process-shell-command "xrandr" nil "xrandr --output Virtual-1 --primary --mode 2048x1152 --pos 0x0 --rotate normal")
;; This will need to be updated to the name of a display! You can find
;; the names of your displays by looking at arandr or the output of xrandr
;; (setq exwm-randr-workspace-monitor-plist '(2 "Virtual-2" 3 "Virtual-2"))
;; NOTE: Uncomment these lines after setting up autorandr!
;; React to display connectivity changes, do initial display update
;; (add-hook 'exwm-randr-screen-change-hook #'my/update-displays)
(my/update-displays)
;; Set the wallpaper after changing the resolution
(my/set-wallpaper)
;; NOTE: This is disabled because we now use Polybar!
;; Load the system tray before exwm-init
;; (require 'exwm-systemtray)
;; (setq exwm-systemtray-height 32)
;; (exwm-systemtray-enable)
;; Automatically send the mouse cursor to the selected workspace's display
(setq exwm-workspace-warp-cursor t)
;; Window focus should follow the mouse pointer
(setq mouse-autoselect-window t
focus-follows-mouse t)
;; Quick swtiching between workspaces
(defadvice exwm-workspace-switch (before save-toggle-workspace activate)
(setq exwm-toggle-workspace exwm-workspace-current-index))
;; These keys should always pass through to Emacs
(setq exwm-input-prefix-keys
;; '(?\C-x
;; ?\C-u
;; ?\C-h
;; ?\M-x
;; ?\M-`
;; ?\M-&
;; ?\M-:
;; ?\C-\M-j ;; Buffer list
'(?\C-\ )) ;; Ctrl+Space
;; ;; Ctrl+Q will enable the next key to be sent directly
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
;; Set up global key bindings. These always work, no matter the input state!
;; Keep in mind that changing this list after EXWM initializes has no effect.
(setq exwm-input-global-keys
`(
;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard)
([?\s-r] . exwm-reset)
;; Move between windows
([s-left] . windmove-left)
([s-right] . windmove-right)
([s-up] . windmove-up)
([s-down] . windmove-down)
([?\s-f] . exwm-layout-toggle-fullscreen)
([?\s-F] . exwm-floating-toggle-floating)
([?\s-D] . (lambda (command)
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command command nil command)))
;; Switch workspace
;; ([?\s-w] . exwm-workspace-switch)
;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9)
;; s-N for current workspace will switch to the last workspace
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(if (= ,i exwm-workspace-current-index)
(my/exwm-jump-to-last-exwm)
(exwm-workspace-switch-create ,i)))))
(number-sequence 0 9))
;; 'S-s-N': Move window to a certain workspace.
,@(cl-mapcar (lambda (c n)
`(,(kbd (format "s-%c" c)) .
(lambda ()
(interactive)
(exwm-workspace-move-window ,n)
;;(exwm-workspace-switch ,n)
)))
'(?\) ?! ?@ ?# ?$ ?% ?^ ?& ?* ?\()
;; '(?\= ?! ?\" ?# ?¤ ?% ?& ?/ ?\( ?\))
(number-sequence 0 9))
))
(exwm-input-set-key (kbd "s-b") 'exwm-workspace-switch-to-buffer)
(setq exwm-workspace-show-all-buffers 1)
(setq exwm-layout-show-all-buffers t)
(exwm-input-set-key (kbd "s-<escape>") 'my/exwm-escape)
(exwm-input-set-key (kbd "s-c") 'my/exwm-enter-char-mode)
(exwm-input-set-key (kbd "s-.") 'my/lock-screen)
;;(exwm-input-set-key (kbd "<s-tab>") 'my/exwm-jump-to-last-exwm)
(exwm-input-set-key (kbd "<s-tab>") 'previous-buffer)
(exwm-input-set-key (kbd "<s-iso-lefttab>") 'next-buffer) ;; (super-shift-tab)
(exwm-input-set-key (kbd "s-h") 'evil-window-left)
(exwm-input-set-key (kbd "s-j") 'evil-window-down)
(exwm-input-set-key (kbd "s-k") 'evil-window-up)
(exwm-input-set-key (kbd "s-l") 'evil-window-right)
;; Moving Windows
(exwm-input-set-key (kbd "s-H") 'evil-window-move-far-left)
(exwm-input-set-key (kbd "s-J") 'evil-window-move-very-bottom)
(exwm-input-set-key (kbd "s-K") 'evil-window-move-very-top)
(exwm-input-set-key (kbd "s-L") 'evil-window-move-far-right)
(exwm-input-set-key (kbd "s-W") 'delete-window)
(exwm-input-set-key (kbd "s-d") 'my/counsel-linux-app)
(exwm-input-set-key (kbd "s-s") 'my/counsel-linux-app-split)
(exwm-input-set-key (kbd "s-S") 'my/counsel-linux-app-vsplit)
(exwm-input-set-key (kbd "s-C-x") 'my/exwm-org-capture)
;; in normal state/line mode, use the familiar i key to switch to input state
;; (evil-define-key 'normal exwm-mode-map (kbd "i") 'exwm-input-release-keyboard)
(evil-define-key 'normal exwm-mode-map (kbd "i") 'my/exwm-enter-insert-state)
(dolist (k '("<down-mouse-1>" "<down-mouse-2>" "<down-mouse-3>"))
(evil-define-key 'normal exwm-mode-map (kbd k) 'my/exwm-enter-insert-state))
;; EXWM does not bypass exwm-mode-map keybindings in line-mode, so the
;; default bindings are still mapped to C-c. We remap that to C-s-c.
(define-key exwm-mode-map (kbd "C-s-c") (lookup-key exwm-mode-map (kbd "C-c")))
(define-key exwm-mode-map (kbd "C-c") nil)
;; User s-q to close buffer
(exwm-input-set-key (kbd "s-Q") 'kill-buffer-and-window)
(exwm-enable))
(use-package terminal-here
:after exwm
:config
(setq terminal-here-linux-terminal-command 'xfce4-terminal)
(exwm-input-set-key (kbd "<s-return>") 'terminal-here-launch))
(my/leader exwm-map
"d" '(exwm-debug :which-key "togggle debug")
"f" '(exwm-floating-toggle-floating :which-key "togggle floating")
"m" '(exwm-workspace-move-window :which-key "workspace move window")
"F" '(exwm-floating-toggle-floating :which-key "togggle fullscreen"))
(global-set-key (kbd "s-q") 'shell)
We use the desktop-environment package to automatically bind to well-known programs for controlling the volume, screen brightness, media playback, and doing other things like locking the screen and taking screenshots. Make sure that you install the necessary programs to make this functionality work! Check the default programs list to know what you need to install.
(use-package desktop-environment
:after exwm
:config
(progn
(setq desktop-environment-update-exwm-global-keys :prefix)
(define-key desktop-environment-mode-map (kbd "s-l") nil) ;; used as move left not lock
;; If we don't enable this, exwm/switch-to-buffer-or-run won't move an X window to the current frame
(setq exwm-layout-show-all-buffers t)
(desktop-environment-mode)
)
:custom
(desktop-environment-brightness-small-increment "-inc 5")
(desktop-environment-brightness-small-decrement "-dec 5")
(desktop-environment-brightness-normal-increment "-inc 10")
(desktop-environment-brightness-normal-decrement "-dec 10")
(desktop-environment-brightness-get-command "xbacklight")
(desktop-environment-brightness-set-command "xbacklight %s")
)
This file is used by your “login manager” (GDM, LightDM, etc) to display EXWM as a desktop environment option when you log in.
IMPORTANT: Make sure you create a symbolic link for this file into /usr/share/xsessions
:
sudo ln -f ~/.emacs.d/exwm/EXWM.desktop /usr/share/xsessions/EXWM.desktop
[Desktop Entry]
Name=EXWM
Comment=Emacs Window Manager
Exec=sh /home/glenn/.emacs.d/exwm/start-exwm.sh
TryExec=sh
Type=Application
X-LightDM-DesktopName=exwm
DesktopNames=exwm
This launcher script is invoked by EXWM.desktop
to start Emacs and load our desktop environment configuration. We also start up some other helpful applications to configure the desktop experience.
# Set the screen DPI (uncomment this if needed!)
xrdb ~/.emacs.d/exwm/Xresources
# Run the screen compositor
compton &
# Enable screen locking on suspend
xss-lock ~/bin/lock.sh &
# Fire it up
##exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.emacs.d/desktop.el
# on Arch dbus is launched by systemd, launching emacs directly
exec emacs -mm --debug-init -l ~/.emacs.d/desktop.el
The Xmodmap
file will be used with the xmodmap
program to remap CapsLock to Ctrl inside of our desktop environment:
The Xresources
file will be used with xrdb
in start-exwm.sh
to set our screen DPI:
Xft.dpi: 100 # Set this to your desired DPI! Larger number means bigger text and UI
The workspace names for polybar are off by one, fix is here ch11ng/exwm#716 (comment)
(setq exwm-workspace-index-map
(lambda (index)
(let ((named-workspaces []))
(if (< index (length named-workspaces))
(elt named-workspaces index)
(number-to-string index)))))
(defun exwm-workspace--update-ewmh-desktop-names ()
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_NAMES
:window exwm--root :data
(mapconcat (lambda (i) (funcall exwm-workspace-index-map i))
(number-sequence 0 (1- (exwm-workspace--count)))
"\0"))))
(add-hook 'exwm-workspace-list-change-hook
#'exwm-workspace--update-ewmh-desktop-names)
;; you may need to call the function once manually
;;(exwm-workspace--update-ewmh-desktop-names)
Polybar provides a great, minimalistic panel for your EXWM desktop configuration. The following config integrates emacsclient
and Polybar with polybar-msg
to enable you to gather any information from Emacs and display it in the panel!
Check out the Polybar wiki for more details on how to configure it: https://github.com/polybar/polybar/wiki
;; Make sure the server is started (better to do this in your main Emacs config!)
;;(server-start)
(defvar my/polybar-process nil
"Holds the process of the running Polybar instance, if any")
(defun my/kill-panel ()
(interactive)
(when my/polybar-process
(ignore-errors
(kill-process my/polybar-process)))
(setq my/polybar-process nil))
(defun my/start-panel ()
(interactive)
(my/kill-panel)
(setq my/polybar-process (start-process-shell-command "polybar" nil "polybar panel")))
(defun my/send-polybar-hook (module-name hook-index)
(start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index)))
(defun my/send-polybar-exwm-workspace ()
(my/send-polybar-hook "exwm-workspace" 1))
;; Update panel indicator when workspace changes
(add-hook 'exwm-workspace-switch-hook #'my/send-polybar-exwm-workspace)
The configuration for our ingeniously named panel, “panel”. Invoke it with polybar panel
on the command line!
; Docs: https://github.com/polybar/polybar
;==========================================================
[settings]
screenchange-reload = true
[global/wm]
margin-top = 0
margin-bottom = 0
[colors]
background = #f0232635
background-alt = #576075
foreground = #A6Accd
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40
underline-1 = #c792ea
[bar/panel]
width = 100%
height = 35
offset-x = 0
offset-y = 0
fixed-center = true
enable-ipc = true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 2
line-color = #f00
border-size = 0
border-color = #00000000
padding-top = 5
padding-left = 1
padding-right = 1
module-margin = 1
font-0 = "Cantarell:size=14:weight=bold;2"
font-1 = "Font Awesome:size=14;2"
font-2 = "Material Icons:size=20;5"
font-3 = "Fira Mono:size=13;-3"
modules-left = exwm-workspace ewmh
modules-center = title
modules-right = cpu memory temperature battery date powermenu
tray-position = right
tray-padding = 2
tray-maxsize = 28
cursor-click = pointer
cursor-scroll = ns-resize
[module/ewmh]
type = internal/xworkspaces
pin-workspaces = true
enable-click = true
format = <label-state>
label-monitor = %name%
label-active = ${index}
label-active-foreground = #ffffff
label-active-background = #3f3f3f
label-active-underline = #fba922
label-active-padding = 2
label-occupied = %name%
label-occupied-underline = #555555
label-occupied-padding = 2
label-urgent = %name%
label-urgent-foreground = #000000
label-urgent-background = #bd2c40
label-urgent-underline = #9b0a20
label-urgent-padding = 2
label-empty = %name%
label-empty-foreground = #55
label-empty-padding = 2
; [module/exwm-workspace]
; type = custom/ipc
; hook-0 = emacsclient -e "exwm-workspace-current-index" | sed -e 's/^"//' -e 's/"$//'
; initial = 1
; format-underline = ${colors.underline-1}
; format-padding = 1
[module/title]
type = internal/xwindow
[module/cpu]
type = internal/cpu
interval = 2
format = <label>
format-underline = ${colors.underline-1}
click-left = emacsclient -e "(proced)"
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 3
format = <label>
label = RAM %percentage_used%%
format-underline = ${colors.underline-1}
[module/date]
type = internal/date
interval = 5
date = "%a %b %e"
date-alt = "%A %B %d %Y"
time = %l:%M %p
time-alt = %H:%M:%S
format-prefix-foreground = ${colors.foreground-alt}
format-underline = ${colors.underline-1}
label = %date% %time%
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 98
time-format = %-l:%M
label-charging = %percentage%% / %time%
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.underline-1}
label-discharging = %percentage%% / %time%
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full = <ramp-capacity> <label-full>
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
animation-charging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <label>
format-underline = ${colors.underline-1}
format-warn = <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%!
label-warn-foreground = ${colors.secondary}
[module/powermenu]
type = custom/menu
format-spacing = 1
label-open =
;label-open-foreground = ${colors.secondary}
label-close = cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-0-2 = suspend
menu-0-2-exec = menu-open-3
;menu-1-0 = cancel
;menu-1-0-exec = menu-open-0
menu-1-0 = reboot!
menu-1-0-exec = systemctl reboot
menu-2-0 = power off!
menu-2-0-exec = systemctl poweroff
;menu-2-0 = back
;menu-2-0-exec = menu-open-0
menu-3-0 = suspend!
menu-3-0-exec = systemctl suspend
;menu-3-1 = back
;menu-3-1-exec = menu-open-0
We use an application called Dunst to enable the display of desktop notifications from Emacs and other applications running within EXWM. Consult the documentation for more details on how to configure this to your liking!
Here are some things you might want to consider changing:
format
- Customize how notification text contents are displayedgeometry
- Where the notification appears and how large it should be by defaulturgency_normal
, etc - configures the background and frame color for notifications of different typesmax_icon_size
- Constrain icon display since some icons will be larger than othersicon_path
- Important if your icons are not in a common location (like when using GNU Guix)idle_threshold
- Wait for user to become active for this long before hiding notificationsmouse_left/right/middle_click
- Action to take when clicking a notification- Any of the key bindings in the
shortcuts
section (though these are deprecated in 1.5.0, usedunstctl
)
[global]
### Display ###
monitor = 0
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
geometry = "500x10-10+50"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
transparency = 10
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 1
separator_color = frame
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 2
# Defines color of the frame around the notification window.
frame_color = "#89AAEB"
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
idle_threshold = 120
### Text ###
font = Cantarell 20
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 88
# Paths to default icons.
icon_path = /usr/share/icons/Adwaita/96x96/status:/usr/share/icons/Adwaita/96x96/emblems
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = no
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# Browser for opening urls in context menu.
browser = qutebrowser
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
startup_notification = false
verbosity = mesg
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 4
mouse_left_click = close_current
mouse_middle_click = do_action
mouse_right_click = close_all
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
#close = ctrl+space
# Close all notifications.
#close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#222222"
foreground = "#888888"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#1c1f26"
foreground = "#ffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#900000"
foreground = "#ffffff"
frame_color = "#ff0000"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
We can also set up some functions for enabling and disabling notifications at any time:
(defun my/disable-desktop-notifications ()
(interactive)
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_PAUSE\""))
(defun my/enable-desktop-notifications ()
(interactive)
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_RESUME\""))
(defun my/toggle-desktop-notifications ()
(interactive)
(start-process-shell-command "notify-send" nil "notify-send \"DUNST_COMMAND_TOGGLE\""))
Tangle on save? Reload after tangle? These hooks will ask you after every save.
;; Local Variables: ;; eval: (add-hook ‘after-save-hook (lambda ()(org-babel-tangle)) nil t) ;; End: