Linux 屏幕上的 Flash 字符

发布于 2024-07-26 00:21:37 字数 147 浏览 2 评论 0原文

我有一个基于内核 2.6 的 XFCE 4.6。 有没有一种快速简便的方法可以让消息在屏幕上闪烁几秒钟?

我的 Thinkpad T60 有 3 个音量按钮(上、下、静音)。 当我按下按钮时,我想在屏幕上闪烁音量一秒钟。 用Python可以完成吗?

I have a XFCE 4.6 on kernel 2.6. Is there a quick and easy way to flash a message on the screen for a few seconds?

My Thinkpad T60 has 3 volume buttons (up, down, mute). When I pressed the buttons, I would like to flash the volume on the screen for a second on screen. Can it be done with Python?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫瑟鸿黎 2024-08-02 00:21:37

notification-daemon-xfce 允许 libnotify 客户端在 XFCE 中显示简短消息。 libnotify 有 Python 绑定 可用。

作为一个未经测试的例子,

import pynotify
import sys
pynotify.init(sys.argv[0])
notification = pynotify.Notification("Title", "body", "dialog-info")
notification.set_urgency(pynotify.URGENCY_NORMAL)
notification.set_timeout(pynotify.EXPIRES_DEFAULT)
notification.show()

notification-daemon-xfce allows libnotify clients to show brief messages in XFCE. libnotify has Python bindings available.

As an untested example,

import pynotify
import sys
pynotify.init(sys.argv[0])
notification = pynotify.Notification("Title", "body", "dialog-info")
notification.set_urgency(pynotify.URGENCY_NORMAL)
notification.set_timeout(pynotify.EXPIRES_DEFAULT)
notification.show()
暮年 2024-08-02 00:21:37

最快的解决方案是从命令行使用 notification-send (通常在 libnotify-bin 包中提供)

notify-send Hello!

The quickest solution is to use notify-send (provided typically in package libnotify-bin) from the command line

notify-send Hello!
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文