[StumpWM, Bin] Replace StumpWM’s notification manager with Dunst

This commit is contained in:
Lucien Cartier-Tilet 2022-03-10 22:25:56 +01:00
parent 84e3c91c51
commit de78e16bd9
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
2 changed files with 22 additions and 36 deletions

View File

@ -42,33 +42,35 @@ of said command running.
| ~xwallpaper~ | ~--zoom "$(cat "$HOME"/.cache/wallpaper)"~ | no | | ~xwallpaper~ | ~--zoom "$(cat "$HOME"/.cache/wallpaper)"~ | no |
| ~xss-lock~ | ~plock~ | yes | | ~xss-lock~ | ~plock~ | yes |
| ~/usr/lib/kdeconnectd~ | | yes | | ~/usr/lib/kdeconnectd~ | | yes |
| ~dunst~ | | yes |
#+NAME: autostart-gen #+NAME: autostart-gen
#+header: :wrap "src bash :exports code" #+header: :wrap "src bash :exports code"
#+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes #+BEGIN_SRC emacs-lisp :var table=autostart-table :cache yes
(mapconcat (lambda (start-command) (mapconcat (lambda (start-command)
(let ((command (replace-regexp-in-string (regexp-quote "~") "" (nth 0 start-command))) (let* ((command (replace-regexp-in-string (regexp-quote "~") "" (nth 0 start-command)))
(arguments (replace-regexp-in-string (regexp-quote "~") "" (nth 1 start-command))) (arguments (replace-regexp-in-string (regexp-quote "~") "" (nth 1 start-command)))
(oncep (string= "yes" (nth 2 start-command)))) (oncep (string= "yes" (nth 2 start-command)))
(full-command (replace-regexp-in-string " +"
" "
(format "%s %s &" command arguments))))
(if oncep (if oncep
(format (format
(concat "if pgrep -x %s ; then\n" (concat "if pgrep -x %s ; then\n"
" echo \"%s already running\"\n" " echo \"%s already running\"\n"
"else\n" "else\n"
" %s &\n" " %s\n"
" disown\n" " disown\n"
"fi") "fi")
command command
command command
(replace-regexp-in-string " +" " " (format "%s %s" full-command)
command full-command)))
arguments)))
(format "%s %s &" command arguments))))
table table
"\n") "\n")
#+END_SRC #+END_SRC
#+RESULTS[7f5adf8d562e118b8e468d7c62c94a8708d32d9e]: autostart-gen #+RESULTS[97a97fceb694333615e59599d7c2d7fac52c5e8d]: autostart-gen
#+begin_src bash :exports code #+begin_src bash :exports code
pactl load-module module-switch-on-connect & pactl load-module module-switch-on-connect &
mpc stop & mpc stop &
@ -117,6 +119,12 @@ else
/usr/lib/kdeconnectd & /usr/lib/kdeconnectd &
disown disown
fi fi
if pgrep -x dunst ; then
echo "dunst already running"
else
dunst &
disown
fi
#+end_src #+end_src
I also have an external sound card, a Scarlet 2i2 G3, that I would I also have an external sound card, a Scarlet 2i2 G3, that I would

View File

@ -1112,28 +1112,6 @@ paru -S libfixposix --noconfirm
<<keybinds-gen(map="*root-map*", keybinds=nm-keybinds)>> <<keybinds-gen(map="*root-map*", keybinds=nm-keybinds)>>
#+end_src #+end_src
** Notifications
:PROPERTIES:
:CUSTOM_ID: Utilities-Notifications-g7rj2qu0z9j0
:END:
No need for ~dunst~ or something like that, the contrib modules of
StumpWM have got us covered! Simply load the module and toggle the
server on.
#+begin_src lisp
(load-module "notify")
(notify:notify-server-toggle)
#+end_src
I dont like the default colors of the notifications though, lets change that.
#+begin_src lisp
(load "~/.stumpwm.d/colors.lisp")
(setf notify:*notify-server-title-color* "^2"
notify:*notify-server-body-color* "^7")
#+end_src
** Pinentry ** Pinentry
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Utilities-Pinentry-o6v95fu0z9j0 :CUSTOM_ID: Utilities-Pinentry-o6v95fu0z9j0