Reply
Thread Tools
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#1
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!
 
Posts: 286 | Thanked: 117 times | Joined on Jan 2010
#2
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?
 
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#3
Originally Posted by crash16 View Post
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's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
 

The Following 3 Users Say Thank You to nicolai For This Useful Post:
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#5
Thanks, this is what i've searched !
 
Posts: 286 | Thanked: 117 times | Joined on Jan 2010
#6
you could use zenity:
#! /bin/sh -e
Q=`run-standalone.sh zenity --info --text "Meesage."

i
just type zenity --help in terminal
 

The Following User Says Thank You to crash16 For This Useful Post:
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#7
Originally Posted by crash16 View Post
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!
 
Posts: 92 | Thanked: 9 times | Joined on Nov 2009 @ Germany, Bavaria
#8
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!
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:50.