-
Notifications
You must be signed in to change notification settings - Fork 2
/
SetupPanel
executable file
·52 lines (44 loc) · 1.08 KB
/
SetupPanel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# No panel is currently set up. Create a new one.
SESSION="$1"
MYCHOICES="$2"
if [ -z "$MYCHOICES" ]; then
echo Usage: SetupPanel /path/ROX-Session /path/Choices >&2
exit 1
fi
PANEL="$MYCHOICES/rox.sourceforge.net/ROX-Filer/pan_Default"
if [ -f "$PANEL" ]; then
echo "SetupPanel -- $PANEL already exists!" >&2
exit 1
fi
mkdir "$MYCHOICES" 2> /dev/null
mkdir "$MYCHOICES/rox.sourceforge.net" 2> /dev/null
mkdir "$MYCHOICES/rox.sourceforge.net/ROX-Filer" 2> /dev/null
DRIVES=""
if [ -d "/mnt" ]; then
for DRIVE in /floppy /cdrom /zip /mnt/*; do
LEAF=`basename "$DRIVE"`
[ -d "$DRIVE" ] && DRIVES="$DRIVES<icon label='$LEAF'>$DRIVE</icon>"
done
if [ -d /uri/0install/rox.sourceforge.net ]; then
EDIT_PATH=/uri/0install/rox.sourceforge.net/apps/Edit
0refresh rox.sourceforge.net/apps/Edit 2004-03-01
EDIT="<icon label='Edit'>$EDIT_PATH</icon>"
APPS=/uri/0install/rox.sourceforge.net/apps
else
EDIT=""
APPS=`dirname "$1"`
fi
cat > "$PANEL" << EOF
<?xml version="1.0"?>
<panel>
<start>
<icon label="Home">~</icon>
$DRIVES
</start>
<end>
$EDIT
</end>
</panel>
EOF
fi