Active Topics

 


Reply
Thread Tools
blwthompson's Avatar
Posts: 97 | Thanked: 8 times | Joined on Dec 2009
#1
Hi All,

Basically i want to the following commands to run as a script when i press the shortcut on my desktop.

Code:
sudo gconftool -s /apps/osso/hildon-home/task-shortcuts-size -t int 62
sudo cd /usr/share/icons/blue-sky-icons/64x64/hildon
sudo mogrify -resize 48x48! *.png
sudo cd /usr/share/icons/blue-sky-icons/64x64/apps
sudo mogrify -resize 48x48! *.png
sudo cd /usr/share/themes/Blue-sky/
sudo mogrify -resize 62x62! ApplicationShortcutApplet.png
sudo mogrify -resize 62x62! ApplicationShortcutAppletPressed.png

sudo pkill hildon-home
Any ideas how i can achieve this??
 
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#2
Hi,

Copy the script (as user) at the following folder and give it execute rights:
cp BlueSkyResize.sh.txt /usr/local/bin/BlueSkyResize.sh
chmod +x /usr/local/bin/BlueSkyResize.sh
(note, I've modified it a little)

The copy the .desktop file at:
cp BlueSkyResize.desktop.txt /usr/share/applications/hildon/BlueSkyResize.desktop
Didn't test it, but should work.
Attached Files
File Type: txt BlueSkyResize.sh.txt (481 Bytes, 527 views)
File Type: txt BlueSkyResize.desktop.txt (203 Bytes, 743 views)

Last edited by Saturn; 2010-07-17 at 14:36.
 
Posts: 134 | Thanked: 41 times | Joined on Mar 2010
#3
or simply use Desktop Command Execution Widget
 
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#4
 
JonWW's Avatar
Posts: 623 | Thanked: 289 times | Joined on Jan 2010 @ UK
#5
Assuming you have rootsh installed
Code:
echo "sh /path/to/script" | root
 

The Following User Says Thank You to JonWW For This Useful Post:
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#6
 
JonWW's Avatar
Posts: 623 | Thanked: 289 times | Joined on Jan 2010 @ UK
#7
Exec=echo "sh /usr/local/bin/BlueSkyResize.sh" | root
 

The Following User Says Thank You to JonWW For This Useful Post:
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#8
JonWW, another problem...

I've tried what you've said doing the following:

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Name=Enable Injection
Comment=NeoPwn Control Panel
Exec=echo "rmmod wl12xx; rmmod mac80211; rmmod cfg80211; insmod /home/user/MyDocs/neo/compat.ko; insmod /home/user/MyDocs/neo/rfkill_backport.ko; insmod /home/user/MyDocs/neo/cfg80211.ko; insmod /home/user/MyDocs/neo/mac80211.ko; insmod /home/user/MyDocs/neo/wl1251.ko; insmod /home/user/MyDocs/neo/wl1251_spi.ko" | root
Icon=injection_enable
Terminal=true
Type=Application
Categories=Tools
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
X-Text-Domain=NeoPwn
But its still not running as root. If I manually paste it in Xterm, it doesn't work either. If I type 'root' first, then type it, it works. Get what I mean?

What can I do to get around this?

Thanks again.

Last edited by Kieron; 2010-11-08 at 22:49.
 
Saturn's Avatar
Posts: 1,648 | Thanked: 2,122 times | Joined on Mar 2007 @ UNKLE's Never Never Land
#9
Originally Posted by Kieron View Post
JonWW, another problem...

I've tried what you've said doing the following:



But its still not running as root. If I manually paste it in Xterm, it doesn't work either. If I type 'root' first, then type it, it works. Get what I mean?

What can I do to get around this?

Thanks again.
Put your code in a script which starts like:
Code:
#!/bin/sh

# gain superuser rights.

if [ `id -u` != 0 ] ; then
    exec sudo gainroot <<EOF
exec sh $0 $*
EOF
	exit $?
fi   

# put your code below
make it executable and you will be able to call it as user.

Cheers
 

The Following 4 Users Say Thank You to Saturn For This Useful Post:
Kieron's Avatar
Posts: 388 | Thanked: 115 times | Joined on Oct 2009 @ London, UK
#10
Saturn, thank you, although that didn't work.

I'm having this issue where I can't run the below commands in a script, for whatever reason. I'm probably doing something wrong. I can run the commands manually, after I've typed 'root', else I get 'no such file or directory' and 'does not exist' errors. Could you assist? If you need more info please don't hesistate to ask, there is some on the neopwn howto thread as I was trying to troubleshoot there to no avail.

Summerising what I said, running the script doesn't work. But if I run this command, once I've rooted, it works.

Code:
rmmod wl12xx; rmmod mac80211; rmmod cfg80211; insmod /home/user/MyDocs/neo/compat.ko; insmod /home/user/MyDocs/neo/rfkill_backport.ko; insmod /home/user/MyDocs/neo/cfg80211.ko; insmod /home/user/MyDocs/neo/mac80211.ko; insmod /home/user/MyDocs/neo/wl1251.ko; insmod /home/user/MyDocs/neo/wl1251_spi.ko
script contents, for reference:

Code:
#!/bin/sh

# gain superuser rights.

if [ `id -u` != 0 ] ; then
    exec sudo gainroot <<EOF
exec sh $0 $*
EOF
	exit $?
fi   

rmmod wl12xx
rmmod mac80211
rmmod cfg80211
insmod /home/user/MyDocs/neo/compat.ko
insmod /home/user/MyDocs/neo/rfkill_backport.ko
insmod /home/user/MyDocs/neo/cfg80211.ko
insmod /home/user/MyDocs/neo/mac80211.ko
insmod /home/user/MyDocs/neo/wl1251.ko
insmod /home/user/MyDocs/neo/wl1251_spi.ko
and the script throws this output when it fails:

Code:
: not foundh: line 2:
does not exist in /proc/modules
does not exist in /proc/modules
does not exist in /proc/modules
': No such file or directoryer/MyDocs/neo/compat.ko
': No such file or directoryer/MyDocs/neo/rfkill_backport.ko
': No such file or directoryer/MyDocs/neo/cfg80211.ko
': No such file or directoryer/MyDocs/neo/mac80211.ko
': No such file or directoryer/MyDocs/neo/wl1251.ko
insmod: error inserting '/home/user/MyDocs/neo/wl1251_spi.ko': -1 Unknown symbol in module
for reference, the permissions of the files are:
Code:
-rwxr-xr-x 1 root staff
again, running the command manually works fine.

there is probably some fundamental flaw the in way im doing things, i just cant seem to figure it. hope you can help.

Thanks again.
K

Last edited by Kieron; 2010-11-08 at 23:18.
 
Reply

Tags
maemo 5, script


 
Forum Jump


All times are GMT. The time now is 07:11.