如何清除所有 gnome shell 通知?

aat*_*ish 24 notification gnome jupiter gnome-shell

我使用 Jupiter 作为电源管理器。现在我收到了很多通知。我收到所有这些通知这一事实没有问题。

但是,我希望能够通过点击几下清除所有 gnome shell 通知。目前,我的整个屏幕底部边缘都充满了通知,我不想一个一个地清除每个项目。

所以我的问题是,如何清除这些通知?如果这在 ui 中是不可能的,是否可以编写一个扩展来做到这一点?我应该在哪里向 gnome 开发人员推荐此功能?Gnome 论坛现在几乎死了,管理员已经 5 天没有激活我创建的帐户了!

小智 24

无耻地使用这里Fedora 论坛中的这个变通方法。

您可以通过输入Alt+ F2、输入r并点击来重置 gnome-shell enter。这将重置/重新启动 GNOME Shell,从而清除所有通知。


小智 17

如果这仍然困扰着您,我已经找到了使用 jupiter 的解决方法。诀窍是将瞬态提示添加到 jupter 发送的通知中。

对我来说(在 11.10 上通过 webupd8 ppa 安装了 jupiter),要修改的适当文件是 /usr/lib/jupiter/scripts/notify

对于我的设置,我必须进行的更改是添加--hint int:transient:1notify-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)

这并不是对您问题的直接回答,因为这不会清除所有通知,但它至少可以防止木星堆积。

希望这可以帮助!


Man*_*nha 5

据我所知,目前无法清除 gnome-shell 中的所有通知。你的底屏是这样的吗?(不是 Firefox,而是任何充斥下面板的应用程序)

在此处输入图片说明

我尝试在 wiki 上搜索所有设计文档,但仍然找不到任何用于清除所有通知的设计或规范。

您可以通过在此处打开错误报告来请求此功能


额外信息:在 Unity 中清除

这是一种使用 App Indicator 的被动通知很有意义的用例。您无需为堆积如山的通知而烦恼。那些需要您注意的通知显示在应用程序指示器中并且可以清除

在此处输入图片说明