#!/bin/bash
# Display wireless signal strength and essid.
# Exit immediately if any command fails:
set -e
# get signal strength
if [ ! `cat /proc/net/wireless | awk '/eth0/ {print $3}' | cut -d"." -f1 `];
then
SIGNAL="0"
else
SIGNAL="`cat /proc/net/wireless | awk '/eth0/ {print $3}' | cut -d"." -f1 `"
fi
case $1 in
init)
echo "<icon 'network.png'/>"
echo "<never_shrink True/>"
echo "<background_color None/>"
echo "<click_on_icon_only False/>"
echo "<test_delay 10/>"
echo "<font 'DISTRO__/12'/>"
;;
test | click)
# show signal strength
echo "<color 'FF6666'/>"
echo "<hspace -1/><bar_meter 100 10 $SIGNAL 100/> $SIGNAL"
# set text color
echo "<color 'FF2222'/>"
# check to see that we are connected
# if not print "No connection!" if so print ESSID
if [ ! `sudo /sbin/iwconfig eth0 | awk '/IEEE/ {print $1}'` ];
then
echo "No connection!"
else
sudo /sbin/iwconfig eth0 | awk '/ESSID/ {print $4}' | cut -d":" -f2 | cut -d"\"" -f2
fi
;;
*)
echo "Usage: $0 [ init | test | click ] test-value"
esac
[/home/you/doityourself/doityourself.py] id=0 screen=0 x=0 y=990 [/home/you/doityourself/doityourself.py] id=1 screen=0 x=1007 y=207 [/home/you/doityourself/doityourself.py] id=2 screen=0 x=1006 y=323
id0 = {'rawmode': False, 'script': 'mboxes.py'}
id1 = {'rawmode': False, 'script': 'agenda.pl'}
id2 = {'rawmode': False, 'script': 'todo.sh'}
<background.border 0/>
<background.border.color None/>
# <background.border.color 'A0A0A0'/>
<background.border.padding 0/>
<window.click_anywhere False/>
<test_delay 10/>
<vpadding 2/>
<hpadding 2/>
<background.border.color None/> # <background.border.color 'A0A0A0'/>
Invalid image attributes: "/mnt/hdb1/mp3/Smashing Pumpkins/Greatest Hits 1/folder.jpg" 128 128
Invalid image attributes: "/mnt/hdb1/mp3/Smashing Pumpkins/Greatest Hits 1/folder.jpg" 128 128
/mnt/hdb1/mp3/Guns 'N Roses/Appetite For Destruction/folder.jpg /mnt/hdb1/mp3/Chevelle/Point #1/folder.jpg
/mnt/hdb1/mp3/Guns 'N Roses/Appetite For Destruction/folder.jpg /mnt/hdb1/mp3/Chevelle/Point #1/folder.jpg
This is a simple case: <markup True False "text" 'text' 45 -15.8/> Some special cases: <image "some \"filename with 'quotes'\""/> <image 'some \'file with the other "quotes"\''/> some text including a \< character <markup "with some text including />"/> Other special cases I forgot...?
Traceback (most recent call last):
File "./doityourself.py", line 140, in ?
Events().pause()
File "./doityourself.py", line 51, in __init__
adesklets.Events_handler.__init__(self)
File "/usr/lib/python2.4/site-packages/adesklets/events_handler.py", line 159,
in __init__
self._alarm()
File "/usr/lib/python2.4/site-packages/adesklets/events_handler.py", line 296,
in _alarm
timeout=self.alarm()
File "./doityourself.py", line 82, in alarm
self.script.test()
File "/home/nine/Desktop/deskletes/doityourself-0.4.1/dys/script.py", line 178
, in test
self._call(args)
File "/home/nine/Desktop/deskletes/doityourself-0.4.1/dys/script.py", line 155
, in _call
self.render(self.widget_tree)
File "/home/nine/Desktop/deskletes/doityourself-0.4.1/dys/script.py", line 383
, in render
adesklets.window_resize(w, h)
File "/usr/lib/python2.4/site-packages/adesklets/commands.py", line 1437, in w
indow_resize
return comm.out()
File "/usr/lib/python2.4/site-packages/adesklets/commands_handler.py", line 10
3, in out
raise ADESKLETSError(4,message)
adesklets.error_handler.ADESKLETSError: adesklets command error - did not resize
window
perl /home/nine/.tomboy/script.pl > "/home/nine/.todo"
Traceback (most recent call last):
[...]
adesklets.window_resize(w, h)
[...]
adesklets.error_handler.ADESKLETSError: adesklets command error - did not resize
window
perl /home/nine/.tomboy/script.pl > "/home/nine/.todo"
#!/bin/bash
# This is a sample back-end script for doityourself. It shows your To Do List,
# which is taken from a text file. On click, it launches the editor on the
# To Do file.
# Exit immediately if any command fails:
set -e
export EDITOR=${EDITOR:-vi}
TODO="$HOME/.todo"
case $1 in
init)
cat <<-EOF
<window.never_shrink False/>
<background.color None/>
<test_delay 3600/>
EOF
exit 0
;;
test)
# Test if the TODO file exists:
if [ ! -r $TODO ]; then
cat <<-EOF
<color 'FF0000'/>
<col/><image 'error.png' 48 48/><endcol/><col/>
This desklet shows your To Do List.
The list is taken from the file $TODO.
Click to create the To Do file.
EOF
exit 0
fi
;;
click)
# launch editor
xterm -e $EDITOR $TODO
;;
esac
# Show the TODO file:
cat <<-EOF
<font 'Vera/14'/><color 'FF0000'/>
To Do List
<hline 300/>
<font 'Vera/10'/><color 'FFFFFF'/>
EOF
perl /home/nine/.tomboy/script.pl > "/home/nine/.todo"
cat $TODO
#!/usr/bin/perl -w
use XML::Simple;
use File::Find;
#use strict;
my $dir= '/home/nine/.tomboy/';
find(\&display_note,$dir);
sub display_note {
if(/\.note$/){
my $file = '79200272-9f2f-424c-8781-b4d89ee05670.note';
my $xsl = XML::Simple->new();
my $doc = $xsl->XMLin($_);
my $def_title = "<font 'Vera/12'/><color 'FF0000'/>";
my $def_text = "<font 'Vera/10'/><color 'FFFFFF'/>";
$texto = $doc->{'text'}->{'note-content'}->{content};
@linhas = split(/\n/,$texto);
# print "$def_title \n";
print "$linhas[0] \n";
# print "$def_text \n";
$size = @linhas;
for($cnt = 1; $cnt < $size; $cnt++){
print "$linhas[$cnt] \n";
}
}
}
echo "<font 'VeraBd/8'/>Wallpaper: <font 'Vera/8'/><hspace -1/>$FILENAME" echo "<font 'VeraBd/8'/>Wallpaper:<font 'Vera/8'/><hspace -1/>$FILENAME"
echo "<font 'VeraBd/8'/>Wallpaper:<font 'Vera/8'/> <hspace -1/>$FILENAME"
/home/bubba/.desklets/doityourself-0.4.1 $ ./doityourself.py
Do you want to (r)egister this desklet or to (t)est it? t
Now testing...
============================================================
If you do not see anything (or just an initial flicker
in the top left corner of your screen), try `--help',
and see the FAQ: `info adesklets'.
============================================================
Traceback (most recent call last):
File "./doityourself.py", line 140, in ?
Events().pause()
File "./doityourself.py", line 51, in __init__
adesklets.Events_handler.__init__(self)
File "/usr/lib/python2.4/site-packages/adesklets/events_handler.py", line 158, in __init__
self._alarm()
File "/usr/lib/python2.4/site-packages/adesklets/events_handler.py", line 296, in _alarm
timeout=self.alarm()
File "./doityourself.py", line 82, in alarm
self.script.test()
File "/home/bubba/.desklets/doityourself-0.4.1/dys/script.py", line 178, in test
self._call(args)
File "/home/bubba/.desklets/doityourself-0.4.1/dys/script.py", line 155, in _call
self.render(self.widget_tree)
File "/home/bubba/.desklets/doityourself-0.4.1/dys/script.py", line 405, in render
root_widget.render(x = padding, y = padding)
File "/home/bubba/.desklets/doityourself-0.4.1/dys/widgets/group.py", line 177, in render
widget.render(widget_x, widget_y)
File "/home/bubba/.desklets/doityourself-0.4.1/dys/widgets/group.py", line 130, in render
widget.render(widget_x, widget_y)
File "/home/bubba/.desklets/doityourself-0.4.1/dys/widgets/text.py", line 47, in render
adesklets.text_draw(x + self._initial_spaces_width, y, self.text.strip())
File "/usr/lib/python2.4/site-packages/adesklets/commands.py", line 536, in text_draw
return comm.out()
File "/usr/lib/python2.4/site-packages/adesklets/commands_handler.py", line 103, in out
raise ADESKLETSError(4,message)
adesklets.error_handler.ADESKLETSError: adesklets command error - text string not given or blank
echo "<font 'VeraBd/8'/>Wallpaper:<font 'Vera/8'/> <hspace -1/>$FILENAME"
#!/bin/bash
#
# Exit immediately if any command fails:
set -e
case $1 in
init)
echo "<background.color '0000005C'/>"
echo "<color 'FFFFFFFF'/>"
echo "<test_delay 5/>"
;;
test | click)
FULLNAME=$(cat ~/.fluxbox/wallpaper-current)
FILENAME=$(basename $FULLNAME)
echo "<font 'VeraBd/8'/>Wallpaper: <font 'Vera/8'/><hspace -1/>$FILENAME"
;;
*)
echo "Usage: $0 [ init | test | click ] test-value"
esac
test | click)
...
echo "<hspace 300/>"
echo "<font 'VeraBd/8'/>Wallpaper: <font 'Vera/8'/><hspace -1/>$FILENAME"
init)
...
<window.never_shrink True/>
<vpadding 0/>
/home/bubba/.desklets/doityourself-0.4.1/scripts $ cat rotate-wallpaper.sh
#!/bin/bash
#
# This script is for use by the doityourself adesklet only
#
# Exit immediately if any command fails:
set -e
case $1 in
init)
echo "<background.color '00000080'/>"
echo "<color 'FFFFFFFF'/>"
echo "<test_delay 600/>"
echo "<font 'VeraBd/7'/>"
;;
test | click)
wallpaper-set-random.sh
FULLNAME=$(cat ~/.fluxbox/wallpaper-current)
FILENAME=$(basename $FULLNAME)
echo "$FILENAME"
;;
*)
echo "Usage: $0 [ init | test | click ] test-value"
esac
# Render background, if necessary:
#
if self.last_background != (
context['background.image'],
context['background.color'],
context['background.border.color']):
self.render_background()
# Render background, if necessary:
#
#if self.last_background != (
# context['background.image'],
# context['background.color'],
# context['background.border.color']):
# self.render_background()
# Fill with the background color
if context['background.color']:
context.set_color(context['background.color'])
adesklets.image_fill_rectangle(0, 0, w, h)
# Fill with the background color
if context['background.color']:
adesklets.context_set_color(0,0,0,64)
adesklets.image_fill_rectangle(0, 0, w, h)