
コマンドライン ユーティリティで使用される表示スタイルを変更する方法はありますかgrowlnotify
? デフォルトのスタイルは変更せず、コマンドのインスタンスで使用されるスタイルだけを変更したいです。
答え1
man growlnotify
オプションは許可されておらず、growlnotify --help
何も言及されていません。これは、発行ソフトウェアがスタイルを制御していないため、理にかなっています。あなたは-- システム環境設定から!
しかし、growlnotify
そこへのエントリー通知タイプは1つだけCommand-Line Growl Notification
(例えば、優先度ごとに1つの通知タイプではありません)。したがってそれは不可能だと思う。
ただし、Growl API を使用して、いくつかのパラメータに基づいてさまざまな種類の通知を発行する AppleScript アプリケーション/スクリプトを作成することはできます。AppleScript経由でGrowlにアクセスする方法についてのドキュメント。
以下は AppleScript エディタのサンプル スクリプトです。
on run argv
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"1", "2"}
set the enabledNotificationsList to ¬
{"1", "2"}
register as application ¬
"My Growl Notification App" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Script Editor"
notify with name ¬
(item 1 of argv) title ¬
(item 2 of argv) description ¬
(item 3 of argv) application name "My Growl Notification App"
end tell
end run
「1」と「2」は、サポートされている通知タイプの名前です。このスクリプトを次のように実行します。
osascript growlstyle.scpt 2 Hello\ World This\ is\ the\ text
パラメータは、通知タイプ名、タイトル、説明の順になります。
一度実行すると、システム環境設定で通知タイプの表示設定を構成できます。