
我希望每次收到 /query 訊息或在頻道中突出顯示時收到通知。此通知應採用氣泡 OSD(螢幕顯示)的形式。
如果 Linux 無法實作 OSD,我將解決將包含irssi
實例的終端機視窗置於視窗堆疊頂部並在狀態列中閃爍視窗名稱的情況。
答案1
這很容易使用以下命令進行設置fnotify腳本。將其設定為自動載入然後自訂它以列印到您選擇的文件:
sub filewrite {
my ($text) = @_;
# FIXME: there is probably a better way to get the irssi-dir...
open(FILE,">>$ENV{HOME}/path/to/your/fnotified");
print FILE $text . "\n";
close (FILE);
}
然後,使用inotifywait
監視該目錄或文件,並在寫入新行時觸發訊息:
#!/usr/bin/env bash
# script to push IRC highlight notifications
dir="$HOME/path/to/your/"
while inotifywait -qqre attrib "$dir" >/dev/null 2>&1; do
echo "IRC:" "You have been pinged..." | notify-send IRC "You have been pinged…" \
-i /usr/share/icons/gnome/48x48/status/dialog-warning.png
done
我irssi
在無頭伺服器上運行,因此我將監視的目錄同步到我使用的所有其他計算機Pulse(以前稱為 Syncthing),然後inotify
在這些本地計算機上運行該腳本,這樣,無論我在何處登錄,如果我被 ping 到,我都會收到通知...
如果您使用或希望在登入時啟動它,則可以inotify
從服務文件執行該腳本。systemd
如果你不想使用notify-send
,禪宗是不引人注目的通知應用程式的絕佳選擇。