MQTT2NotifySend
1.0.0
MQTT와 FreedEsktop.org 사이의 브리지는 MQTT를 통해 데스크탑에 알림을 보낸다.
# Dependencies are: libnotify-bin, mosquitto-clients, jq, coreutils
sudo apt install libnotify-bin mosquitto-clients jq coreutils
# Download the script & set as executable (optional)
curl -O https://raw.githubusercontent.com/David-Lor/MQTT2NotifySend/master/mqtt2notifysend.sh
chmod u+x mqtt2notifysend.sh
# Run!
./mqtt2notifysend.sh -h localhost -t notifications
# Send a message to the broker from other terminal window
mosquitto_pub -h localhost -t notifications -m " { " title " : " Custom notification " , " text " : " Hello world " } "mosquitto_sub 명령 (run ./mqt2notifysend.sh --help )과 사용하는 것과 동일합니다.title : 알림 제목 (선택 사항)text : 알림 기관 (필수)level : 알림 긴급 성 수준 (선택 사항; 중 하나 : low , normal , critical ; 기본값 : normal )iconB64 : Base64 String으로 인코딩 된 알림 아이콘 이미지 (선택 사항)다음 환경 변수를 사용하여 특정 설정을 조정할 수 있습니다.
RECONNECTION_DELAY : 연결 시도 사이에 대기 시간, 초 만에 (기본값 : 5 )DEFAULT_TITLE : 제목없이 전송 된 알림의 기본 제목 (기본값 : MQTT2NotifySend )DEFAULT_LEVEL : 레벨없이 전송 된 알림에 대한 기본 알림-센드 레벨 (기본값 : normal )LOG_ENABLE : true 또는 1 인 경우 스크립트 로그를 활성화합니다 (기본값 : false )ICON_BASE_PATH : 알림 아이콘 파일이 다운로드되는 위치, 각 알림. 이것은 접두사로 사용되는 파일의 절대/상대 경로입니다 (default : /tmp/mqtt2notifysend-icon ).ICON_DELETE_DELAY : 아이콘 사이에서 대기 시간이 디코딩되고 삭제됩니다. Notifysend 명령이 비트를 지연시키고 알림이 팝업 될 때 아이콘이 제거 될 수 있으므로 아이콘을 표시하지 않으므로 아이콘이 제거 될 수 있습니다 (기본값 : 5 )용법:
LOG_ENABLE=true RECONNECTION_DELAY=1 DEFAULT_TITLE= " Very important notification " DEFAULT_LEVEL=critical
bash mqtt2notifysend.sh -h localhost -t notifications