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
|
!.gitmodules
|
||||||
!early-init.el
|
!early-init.el
|
||||||
!init.el
|
!init.el
|
||||||
|
!scripts
|
||||||
|
!scripts/**
|
||||||
!snippets
|
!snippets
|
||||||
!snippets/**
|
!snippets/**
|
||||||
|
|
||||||
|
|
7
init.el
7
init.el
|
@ -437,6 +437,13 @@
|
||||||
:config
|
:config
|
||||||
(dirvish-override-dired-mode))
|
(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
|
(use-package pdf-tools
|
||||||
:mode ("\\.pdf\\'" . pdf-view-mode)
|
:mode ("\\.pdf\\'" . pdf-view-mode)
|
||||||
:bind (:map pdf-view-mode-map ("/" . #'isearch-forward))
|
: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