View Single Post
Posts: 71 | Thanked: 4 times | Joined on Mar 2010
#925
Originally Posted by hihi427 View Post
the one u want should be some scprits like this

Code:
if [ "$QBW_EXEC_REASON" == "QBW_STARTUP_UPDATE" ]; then
#    add here switch on instructions
    rootsh /usr/sbin/kernel-load /home/user/MyDocs/kernel.txt
    echo "ON";
    exit 1;
fi;

if [ "$QBW_CURRENT_RESULTS_TEXT" == "ON" ]; then
#    add here switch off instructions
    rootsh /usr/sbin/kernel-load /etc/default/kernel-power
    echo "OFF";
    exit 0;
else
#    add here switch on instructions
    rootsh /usr/sbin/kernel-load /home/user/MyDocs/kernel.txt
    echo "ON";
    exit 1;
bcz kernel-config dont have a command "kernel-unload'
if u wanna retore ur setting after the button turned off just copy the default setting to the file /etc/default/kernel-power


p.s: the script doesnt work under the rootsh 1.8 if u wanna work just deinstalled the current version and download the old one 1.5 from extra but not extra-devel

No thats not working either.. I actualy created a new file called 'originalkernel.txt' and wrote the commands as NoNoYes suggested:

if [ "$QBW_EXEC_REASON" == "QBW_STARTUP_UPDATE" ]; then
# add here switch on instructions
/usr/sbin/kernel-load /home/user/MyDocs/kernel.txt | sudo gainroot
echo "ON";
exit 1;
fi;
if [ "$QBW_CURRENT_RESULTS_TEXT" == "ON" ]; then
# add here switch off instructions
/usr/sbin/kernel-unload /home/user/MyDocs/originalkernel.txt | sudo gainroot
echo "OFF";
exit 0;
else
# add here switch on instructions
/usr/sbin/kernel-load /home/user/MyDocs/kernel.txt | sudo gainroot
echo "ON";
exit 1;
fi;

unfortunately it only loads on Start up (if start up is enabled on the widget) it doesn't want to toggle between on and off states though once activated. I haven't figured out how to create an 'off' state yet

any suggestions or pointers as to what I am doing wrong will be greatly appreciated