diff --git a/.gitignore b/.gitignore index 51f8bb3..e69d5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ !.gitmodules !early-init.el !init.el +!scripts +!scripts/** !snippets !snippets/** diff --git a/init.el b/init.el index 934101f..ed5980d 100644 --- a/init.el +++ b/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)) diff --git a/scripts/emacs-hyprland-notify b/scripts/emacs-hyprland-notify new file mode 100755 index 0000000..f6ff56f --- /dev/null +++ b/scripts/emacs-hyprland-notify @@ -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