[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/ACE-desktop ACE
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/ACE-desktop ACE |
Date: |
Sat, 24 Feb 2007 08:50:27 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/02/24 08:50:27
Modified files:
ACE-desktop : ACE
Log message:
Added temporary file utility functions. Console script
displays multiple files.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE?cvsroot=antiright&r1=1.10&r2=1.11
Patches:
Index: ACE
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- ACE 23 Feb 2007 21:23:26 -0000 1.10
+++ ACE 24 Feb 2007 08:50:27 -0000 1.11
@@ -32,6 +32,30 @@
}
fi
+Get_Temp()
+{
+ if [ "$TMPDIR" = "" ]; then
+ TMPDIR=/tmp
+ fi
+ echo $TMPDIR/ACE.$1.$$
+}
+
+Prepare_Temp()
+{
+ rm -f $1
+ touch $1
+ chmod og-rwx $1
+ trap "rm -f $@" EXIT QUIT
+}
+
+Prepare_Temp_Script()
+{
+ Prepare_Temp $1
+ chmod u+x $1
+ echo '#!/bin/sh' >> $1
+}
+
+
ARSHELL=gtkshell
AWK=awk
@@ -87,13 +111,19 @@
}
Console()
{
- if [ "$1" = "" ]; then
- local LOGFILE=/var/log/messages
- else
- local LOGFILE=$1
- fi
+ local TMP=$(Get_Temp Console)
+ Prepare_Temp_Script $TMP
+
+ echo 'gtkshell -og 750x500+0-0 -ou 5000\' >> $TMP
+
+ for ITEM in "$@"; do
+ echo " -al $ITEM -aul \"tail -n 3 $ITEM\" \\" >> $TMP
+ done
+
+ echo " -aul date" >> $TMP
- nice gtkshell -os -of -og +0-0 -ou 5000 -aul "tail -n 3 $LOGFILE"
+ $TMP
+ rm -f $TMP
}
swap_load()
{
@@ -112,9 +142,9 @@
{
nice $ARSHELL -os -aT -og 175x200
}
-Deskbar()
+
+Old_Deskbar()
{
- if [ "$(ACE deskbar_style)" = "0" ]; then
$ARSHELL -og $(ACE Deskbar_X)$(ACE Deskbar_Y)\
-or 1\
-aul "uptime | tr -d '\n'"\
@@ -125,6 +155,12 @@
'ACE Sticky_Note'\
'ACE'\
-at env
+}
+
+Deskbar()
+{
+ if [ "$(ACE deskbar_style)" = "0" ]; then
+ Old_Deskbar
else
local STYLE="$(ACE deskbar_style)"
@@ -134,19 +170,14 @@
local OPTIONS="-or 1"
fi
- local UPDATER=$(ACE deskbar_updater)
-
local ACE_STRING=" -aI ACE $icon/ACE.png"
+ local UPDATER=$(ACE deskbar_updater)
- if [ "$TMPDIR" = "" ]; then
- local TMPDIR=/tmp
- fi
-
- local TMP=$TMPDIR/ACE.panel.$$
-
- trap "rm -f $TMP" 2
+ local TMP=$(Get_Temp Deskbar)
+ # Ensure removal on termination.
+ # Set correct permissions and shell.
+ Prepare_Temp_Script $TMP
- echo '#!/bin/sh' > $TMP
echo "$ARSHELL -os -of -on $OPTIONS \\" >> $TMP
echo " -og +$(ACE Deskbar_X)+$(ACE Deskbar_Y)\\" >> $TMP
@@ -159,8 +190,7 @@
fi
for item in $(ACE Panel_Items); do
- echo ' -aI '"'"ACE $item"'" $icon/$item.png "\\"\
- >> $TMP
+ echo ' -aI '"'"ACE $item"'" $icon/$item.png "\\" >> $TMP
done
if [ "$UPDATER" = "TRUE" ]; then
@@ -169,10 +199,9 @@
echo " $ACE_STRING" >> $TMP
fi
- chmod +x $TMP
- # cat $TMP
$TMP
rm -f $TMP
+
fi
}
ARO()