代码之家  ›  专栏  ›  技术社区  ›  Jay

显示来自bash脚本的图像通知

  •  3
  • Jay  · 技术社区  · 14 年前

    我要做的是: 在Ubuntu10.04上,我想在屏幕的一角显示一个小的通知图像,并让图像淡出。我想在命令行中完成它,以便与bash脚本一起使用。类似于“通知发送”、“Zenity”或“对话”,除非 它也显示图像。

    到目前为止我所发现的: imagemagick animate似乎是唯一的命令行工具,它可以显示图像并退出,而无需用户交互。

    还有更好的吗?我可以自己写一封信,但我想应该已经有事情要做了。

    1 回复  |  直到 8 年前
        1
  •  2
  •   Vanni Totaro    14 年前

    gcin 做这项工作。 它将全尺寸图像显示为通知。

    sudo apt-get install gcin
    gcin-message -icon your_image.jpg
    

    提取液 man gcin-message :

    NAME
           gcin-message - gcin's notification tool
    
    SYNOPSIS
           gcin-message [-icon file] [-text string] [-duration milliseconds]
    
    DESCRIPTION
           gcin-message  displays notification image and/or text. It is useful for
           filters to have interaction with users.
    
    OPTIONS
           -icon file
                  Display an image.
    
           -text string
                  Display text string. The space character is not allowed.
    
           -duration milliseconds
                  Time to show notifications.
    

    但是我建议你不要使用这个工具 因为它在Ubuntu存储库中的安装不是细粒度的(6 MB的内容和通知区域中的中文图标)。

    看看你能不能 gcin-message 走出 GCIN 打包并放入您自己的包中(如果这适合您的需要)。