maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Show Text as Notification (yellow bar) via Sh-Script (https://talk.maemo.org/showthread.php?t=65392)

RouterRebooter 2010-11-10 11:51

Show Text as Notification (yellow bar) via Sh-Script
 
Hi!

I use a script to turn the lights in my appartment off an on. I would like to complete this function with a feedback in the form of a info-bar, which scrolls into the desktop (like e.g. the "Battery fully charged" message).

Does anyone know how to create such a notification out of a shellscript?

Thanks in advantage!

crash16 2010-11-10 11:56

Re: Show Text as Notification (yellow bar) via Sh-Script
 
What you are asking is a widget, I don't think you can create one out of a shell script...What you can do is to create a icon On and Off which when selected calls the appropriate script...and how did you do it?...using bluetooth?

RouterRebooter 2010-11-10 12:04

Re: Show Text as Notification (yellow bar) via Sh-Script
 
Quote:

Originally Posted by crash16 (Post 869049)
What you are asking is a widget, I don't think you can create one out of a shell script...What you can do is to create a icon On and Off which when selected calls the appropriate script...and how did you do it?...using bluetooth?

Thanks for the quick reply.

The N900 is starting a script (via WLAN-Connection) on a mini-linux-server, which controls 4 USB-controlled power-sockets.
(Linux-Server: NSLU2, USB-Power-Socket: Gembird SIS-PM).

Do you or anyone else know another possibility to create any message-output on the desktop through a shellscript?

nicolai 2010-11-10 12:10

Re: Show Text as Notification (yellow bar) via Sh-Script
 
dbus?
http://wiki.maemo.org/Phone_control#Notifications

RouterRebooter 2010-11-10 12:14

Re: Show Text as Notification (yellow bar) via Sh-Script
 
Thanks, this is what i've searched !

crash16 2010-11-10 12:15

Re: Show Text as Notification (yellow bar) via Sh-Script
 
you could use zenity:
Quote:

#! /bin/sh -e
Q=`run-standalone.sh zenity --info --text "Meesage."

i
just type zenity --help in terminal

RouterRebooter 2010-11-10 12:39

Re: Show Text as Notification (yellow bar) via Sh-Script
 
Quote:

Originally Posted by crash16 (Post 869069)
you could use zenity:


just type zenity --help in terminal


(I had to install zenity first, it was not included in the standard-installation).

It's unfortunately visually not the most beautiful method, but it works!
Thanks!

RouterRebooter 2010-11-10 15:55

Re: Show Text as Notification (yellow bar) via Sh-Script
 
Hi!

I've implemented the desired feedback-message now:


Code:

#!/bin/sh
ausgabe=`COMMAND`
if [ "$ausgabe" = "EXPECTED VALUE" ]
then
 run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"OK - Notification-Text"
else
 run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"ERROR - Notification-Text"
fi

Works fine! Thanks!


All times are GMT. The time now is 23:33.

vBulletin® Version 3.8.8