2010-07-18 83 views
3

我想要實現的: 在Ubuntu 10.04上,我想在屏幕的角落顯示一個小的通知圖像,並使圖像淡出。我想從命令行使用bash腳本。類似於「通知發送」,「zenity」或「對話框」,除了 它也顯示圖像。從bash腳本顯示圖像通知

我到目前爲止發現的內容: ImageMagick animate似乎是唯一可以顯示圖像並在沒有用戶交互的情況下退出的命令行工具。

有什麼更好的嗎?我可以自己寫一篇,但我認爲應該已經有一些事情要做。

+0

你想在哪裏顯示該圖像。在文本模式下的命令行? – 2010-07-18 15:54:15

+0

@Pekka:和Zenity一樣。 – 2010-07-18 16:22:00

+0

理想情況下,一個非交互式html瀏覽器顯示在其中一個屏幕角落。我發現notify-send有一些顯示圖像的功能。 – Jay 2010-07-18 16:23:02

回答

2

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包中獲得gcin-message並將其放入您自己的包(如果這符合您的需求)。

+0

謝謝!我會看看我是否可以提取它 – Jay 2010-07-19 22:59:23