View Single Post
Posts: 118 | Thanked: 59 times | Joined on May 2007
#157
Originally Posted by RobbH View Post
Shouldn't it be possible to process the output of uptime through awk and create a conditional script that runs when the widget is clicked, but not at startup?
I hoped someone else would provide an answer before I found one, but no such luck. The following script, entitled Edit Notes, seems to work as intended: the script runs when the widget is clicked (assuming uptime reports a value greater than 1 min), but not at startup:

Code:
if [ `uptime | awk '{ print $3 $4 }'` = "1min," ] ; then echo " " ; else leafpad ~/MyDocs/desktop_notes.txt ; echo " " ; fi
It's not pretty, and anyone who might be inclined to improve it is welcome to do so.

The above script opens a file for editing in Leafpad. I use it in conjunction with this script, "Notes", which displays the same file in a multi-line widget, serving as a very basic desktop notes applet:

Code:
cat ~/MyDocs/desktop_notes.txt