Subversion Repositories My Stuff

Compare Revisions

Ignore whitespace Rev 9 → Rev 10

/trunk/Bash/performance.sh
0,0 → 1,47
#!/bin/sh
 
PROFILES="/usr/local/bin/profiles"
 
test -f ${PROFILES} || exit 0
 
TEMPFILE=/tmp/${USER}-profile.tmp
 
if (test -f ${TEMPFILE}) then
read line < ${TEMPFILE}
PROFILE=${line}
else
PROFILE=Dynamic
fi
 
i=0
flaga=0
 
while read line
do
i=`expr $i + 1`
if (test "${line}" = "${PROFILE}") then
flaga=$i
fi
done < ${PROFILES}
 
if (test $flaga -eq $i) then
flaga=1
else
flaga=`expr $flaga + 1`
fi
 
j=0
 
while read line
do
j=`expr $j + 1`
if (test $flaga -eq $j) then
PROFILE=${line}
fi
done < ${PROFILES}
 
CMD="dbus-send --print-reply --session --dest=org.kde.powerdevil /modules/powerdevil org.kde.PowerDevil.setProfile string:"
 
${CMD}"${PROFILE}"
 
echo ${PROFILE} > ${TEMPFILE}
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property