aat*_*ish 24 notification gnome jupiter gnome-shell
我使用 Jupiter 作为电源管理器。现在我收到了很多通知。我收到所有这些通知这一事实没有问题。
但是,我希望能够通过点击几下清除所有 gnome shell 通知。目前,我的整个屏幕底部边缘都充满了通知,我不想一个一个地清除每个项目。
所以我的问题是,如何清除这些通知?如果这在 ui 中是不可能的,是否可以编写一个扩展来做到这一点?我应该在哪里向 gnome 开发人员推荐此功能?Gnome 论坛现在几乎死了,管理员已经 5 天没有激活我创建的帐户了!
小智 17
如果这仍然困扰着您,我已经找到了使用 jupiter 的解决方法。诀窍是将瞬态提示添加到 jupter 发送的通知中。
对我来说(在 11.10 上通过 webupd8 ppa 安装了 jupiter),要修改的适当文件是 /usr/lib/jupiter/scripts/notify
对于我的设置,我必须进行的更改是添加--hint int:transient:1
到notify-send
脚本中的每个调用中。因此,我的木星通知脚本从:
function notify {
if [ ! "$NO_NOTIFY" = "1" ]; then
ICON=$2
MESSAGE=$1
if [ "$DISTRIB_RELEASE" = "9.10" ]; then
DISPLAY=:0.0 /usr/bin/notify-send -i $ICON -t 1500 "$MESSAGE" 2>/dev/null
else
USER=$(who | sed -n '/ (:0[\.0]*)$\| :0 /{s/ .*//p;q}')
USERCNT=$(who | wc -l)
if [ ! "$(whoami)" = "$USER" ]; then
if [ ! "$USERCNT" -lt 1 ]; then
su $USER -l -c "DISPLAY=:0.0 /usr/bin/notify-send -i $ICON -t 700 \"$MESSAGE\" 2>/dev/null"
fi
else
if [ ! "$USERCNT" -lt 1 ]; then
/usr/bin/notify-send -i $ICON -t 700 "$MESSAGE" 2>/dev/null
fi
fi
fi
fi
}
Run Code Online (Sandbox Code Playgroud)
到:
function notify {
if [ ! "$NO_NOTIFY" = "1" ]; then
ICON=$2
MESSAGE=$1
if [ "$DISTRIB_RELEASE" = "9.10" ]; then
DISPLAY=:0.0 /usr/bin/notify-send --hint int:transient:1 -i $ICON -t 1500 "$MESSAGE" 2>/dev/null
else
USER=$(who | sed -n '/ (:0[\.0]*)$\| :0 /{s/ .*//p;q}')
USERCNT=$(who | wc -l)
if [ ! "$(whoami)" = "$USER" ]; then
if [ ! "$USERCNT" -lt 1 ]; then
su $USER -l -c "DISPLAY=:0.0 /usr/bin/notify-send --hint int:transient:1 -i $ICON -t 700 \"$MESSAGE\" 2>/dev/null"
fi
else
if [ ! "$USERCNT" -lt 1 ]; then
/usr/bin/notify-send --hint int:transient:1 -i $ICON -t 700 "$MESSAGE" 2>/dev/null
fi
fi
fi
fi
}
Run Code Online (Sandbox Code Playgroud)
这并不是对您问题的直接回答,因为这不会清除所有通知,但它至少可以防止木星堆积。
希望这可以帮助!