Add focus action to libnotify alerts
This commit is contained in:
parent
90e4eb03b4
commit
29efeadcd3
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,6 +4,8 @@
|
|||
!.gitmodules
|
||||
!early-init.el
|
||||
!init.el
|
||||
!scripts
|
||||
!scripts/**
|
||||
!snippets
|
||||
!snippets/**
|
||||
|
||||
|
|
7
init.el
7
init.el
|
@ -437,6 +437,13 @@
|
|||
:config
|
||||
(dirvish-override-dired-mode))
|
||||
|
||||
(use-package alert
|
||||
:ensure nil
|
||||
:custom
|
||||
(alert-default-style 'libnotify)
|
||||
(alert-libnotify-command (expand-file-name "scripts/emacs-hyprland-notify"
|
||||
user-emacs-directory)))
|
||||
|
||||
(use-package pdf-tools
|
||||
:mode ("\\.pdf\\'" . pdf-view-mode)
|
||||
:bind (:map pdf-view-mode-map ("/" . #'isearch-forward))
|
||||
|
|
6
scripts/emacs-hyprland-notify
Executable file
6
scripts/emacs-hyprland-notify
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
exec nohup sh -s -- "$@" <<-'EOF' >/dev/null 2>&1 &
|
||||
STATUS="$(notify-send --action='focusEmacs,Focus EmacsClient' "$@")"
|
||||
[ "$STATUS" = 0 ] && exec hyprctl dispatch focuswindow '^(emacs)$'
|
||||
EOF
|
Loading…
Reference in a new issue