![]() |
Re: Need help with this command
#!/usr/bin/python
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 |
Re: Need help with this command
I want to make this work at reboot. And also place an Icon as well.
|
Re: Need help with this command
As said before, you can't gain root access inside the script. The script has to be run as root!
|
Re: Need help with this command
Quote:
|
All times are GMT. The time now is 22:16. |
vBulletin® Version 3.8.8