In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to let the Emacs shell command to send desktop notifications, I believe most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
I always use Eshell to interact with the operating system because it integrates seamlessly with Emacs, supports processing (remote) TRAMP files, and works well on Windows.
After starting the shell command (such as a time-consuming build task) I often forget to track the running status of the task because I switch buffers.
Thanks to Emacs's hook mechanism, you can configure Emacs to call an elisp function after an external command is completed.
I use the great alert package written by John Wiegleys to send desktop notifications:
(require 'alert) (defun eshell-command-alert (process status) "Send `alert' with severity based on STATUS when PROCESS finished." (let* ((cmd (process-command process)) (buffer (process-buffer process)) (msg (format "% s:% s" (mapconcat 'identity cmd "") status) (if (string-prefix-p "finished" status) (alert msg: buffer buffer: severity' normal) (alert msg: buffer buffer: severity 'urgent) (add-hook' eshell-kill-hook # 'eshell-command-alert)
The rules of alert can be set by program. In my case, I just need to be notified when the corresponding buffer is not visible:
(alert-add-rule: status'(buried); only send alert when buffer not visible: mode 'eshell-mode: style' notifications)
This works even for TRAMP. The following screenshot shows the Gnome desktop notification generated by the failed make command.
The above is all the contents of the article "how to get Emacs shell commands to send Desktop notifications". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.