The Following User Says Thank You to maxximuscool For This Useful Post: | ||
![]() |
2010-09-04
, 15:48
|
Posts: 3,664 |
Thanked: 1,530 times |
Joined on Sep 2009
@ Hamilton, New Zealand
|
#12
|
The Following User Says Thank You to maxximuscool For This Useful Post: | ||
![]() |
2010-09-05
, 04:21
|
Posts: 842 |
Thanked: 1,197 times |
Joined on May 2010
|
#13
|
![]() |
2010-09-05
, 08:11
|
Posts: 3,664 |
Thanked: 1,530 times |
Joined on Sep 2009
@ Hamilton, New Zealand
|
#14
|
As said before, you can't gain root access inside the script. The script has to be run as root!
The Following User Says Thank You to maxximuscool For This Useful Post: | ||
import gtk
import gobject
import hildondesktop
import os
import sys
import stat
class Swappiness(hildondesktop.StatusMenuItem):
def __init__(self):
hildondesktop.StatusMenuItem.__init__(self)
#os.system('echo /usr/lib/hildon-desktop/Swappiness.py | root')
os.system('sudo chmod +x /usr/lib/hildon-desktop/Swappiness.py')
os.system('echo 30> /proc/sys/vm/swappiness')
#os.system('sudo chmod -R echo 30 > /proc/sys/vm/swappiness')
#swap_file = open('/proc/sys/vm/swappiness', 'w').write('30')
icon_theme = gtk.icon_theme_get_default()
pixbuf = icon_theme.load_icon("Swappiness", 22, gtk.ICON_LOOKUP_NO_SVG)
# hide icon after 1 sec
#gobject.timeout_add(1000, self.set_status_area_icon, None)
self.set_status_area_icon(pixbuf)
#label = gtk.Label("Show Me")
#self.add(label)
#self.show_all()
hd_plugin_type = Swappiness
This is my little simple script but nothing worked since I can't gain root access from the command os.system
Install Preenv games into eMMC| Click Here to get rid of Uboot screen
My N900 running at 250-1150Mhz
Unlocking your FM-transmitter to 76.0Mhz - 107.9Mhz range - CLICK HERE.
Last edited by maxximuscool; 2010-09-04 at 15:04.