1
0
Fork 0
tuned/commands/cmd_default_mode.py
Marcela Mašláňová 9d168d837d Rewrite commands only to: default, help, list, modes, off.
The different modes could be specified in /etc/tune-profiles
and then can be listed by list:
tuned-adm list
and set by:
tuned-adm modes YourFavourite
2009-07-30 16:30:52 +02:00

32 lines
No EOL
973 B
Python

# -*- coding: utf-8 -*-
import os
import glob
import kobo.shortcuts
from kobo.cli import Command
class Default(Command):
"""star ktune and tuned with default settings"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s" % self.normalized_name
self.parser.add_option(
"--show-disabled",
default=False,
action="store_true",
help="show disabled workers"
)
def run(self, *args, **kwargs):
os.system('service ktune start')
os.system('chkconfig --add ktune && chkconfig --level 345 ktune on')
os.system('service tuned start')
os.system('chkconfig --add tuned && chkconfig --level 345 tuned on')
# usb_devices = glob.glob('/sys/bus/usb/devices/?-?/')
# for i in usb_devices:
# retcode, output = kobo.shortcuts.run('echo 2 > %spower/autosuspend' % i)
# retcode, output = kobo.shortcuts.run('echo auto > %spower/level' % i)