Esempio n. 1
0
def configure_quit(signal=None):
    global default_power_settings, logger
    logger.info(
        "On exit: deactivate screensaver and set default power settings")

    write_dconf_settings(default_power_settings, logger, logaserror=False)
    execute(['xset', '-dpms'], logger)
def configure_init(signal=None):
    global logger, hidecursor, settings
    logger.info("On init: set appearance settings")
    write_dconf_settings(settings, logger, logaserror=False)

    if hidecursor:
        hide_cursor()
    else:
        show_cursor()
def activate_screensaver(signal=None, mp=None):
    global inactivity, logger, power_settings
    logger.info("Activated screensaver: set power settings and activate power saving mode for {} s".format(inactivity))

    standby_time = inactivity
    suspend_time = inactivity + 5
    off_time = inactivity + 10

    write_dconf_settings(power_settings, logger, logaserror=False)
    execute(["xset", "s", "off"], logger)
    execute(["xset", "+dpms"], logger)
    execute(["xset", "dpms", str(standby_time), str(suspend_time), str(off_time)], logger)
    os.system("dconf write /org/gnome/desktop/session/idle-delay 'uint32 0'")
Esempio n. 4
0
def configure_keyboard(dispatcher=None):
    configuration = {
            '/org/onboard/auto-show/enabled'            : 'false',
            '/org/onboard/layout'                       : "'Phone'",
            '/org/onboard/theme'                        : "'Ambiance'",
            '/org/onboard/theme-settings/color-scheme'  : "'/usr/share/onboard/themes/Aubergine.colors'",
            '/org/onboard/window/landscape/dock-expand' : 'false',
            '/org/onboard/start-minimized'              : 'false',
            '/org/onboard/system-theme-tracking-enabled': 'false',
            '/org/onboard/use-system-defaults'          : 'false',
            }

    write_dconf_settings(configuration, logger)
    pid = is_running('onboard')
    if not pid:
        subprocess.Popen(["onboard"]).pid
        #FIXME: Set again onboard properties, otherwise some of them would be ignored
        write_dconf_settings(configuration, logger)
Esempio n. 5
0
def configure_keyboard(dispatcher=None):
    configuration = {
            '/org/onboard/auto-show/enabled'            : 'true',
            '/org/onboard/layout'                       : "'Phone'",
            '/org/onboard/theme'                        : "'Ambiance'",
            '/org/onboard/theme-settings/color-scheme'  : "'/usr/share/onboard/themes/Aubergine.colors'",
            '/org/onboard/window/landscape/dock-expand' : 'false',
            '/org/onboard/start-minimized'              : 'true',
            '/org/onboard/system-theme-tracking-enabled': 'false',
            '/org/onboard/use-system-defaults'          : 'false',
            }

    write_dconf_settings(configuration, logger)
    pid = is_running('onboard')
    if not pid:
        subprocess.Popen(["onboard"]).pid
        #FIXME: Set again onboard properties, otherwise some of them would be ignored
        write_dconf_settings(configuration, logger)
Esempio n. 6
0
def activate_screensaver(signal=None, mp=None):
    global inactivity, logger, power_settings
    logger.info(
        "Activated screensaver: set power settings and activate power saving mode for {} s"
        .format(inactivity))

    standby_time = inactivity
    suspend_time = inactivity + 5
    off_time = inactivity + 10

    write_dconf_settings(power_settings, logger, logaserror=False)
    execute(["xset", "s", "off"], logger)
    execute(["xset", "+dpms"], logger)
    execute(
        ["xset", "dpms",
         str(standby_time),
         str(suspend_time),
         str(off_time)], logger)
    os.system("dconf write /org/gnome/desktop/session/idle-delay 'uint32 0'")
Esempio n. 7
0
    def test_write_dconf_settings(self):
        systemcalls.write_dconf_settings(
            settings={
                '/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode':
                '1'
            })
        output = subprocess.check_output([
            'dconf', 'read',
            '/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode'
        ],
                                         stderr=subprocess.STDOUT)
        self.assertTrue(output, '1')

        systemcalls.write_dconf_settings(
            settings={
                '/org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode':
                '0'
            })
        self.assertTrue(output, '0')
def configure_quit(signal=None):
    global logger, hidecursor, default_settings
    logger.info("On exit: set default appearance settings")
    write_dconf_settings(default_settings, logger, logaserror=False)
    if hidecursor:
        show_cursor()
Esempio n. 9
0
def unconfigure_keyboard(dispatcher=None):
    write_dconf_settings({'/org/onboard/use-system-defaults': 'true'}, logger)
    pid = is_running('onboard')
    if pid:
        execute(['kill', str(pid)])
Esempio n. 10
0
def unconfigure_keyboard(dispatcher=None):
    write_dconf_settings({'/org/onboard/use-system-defaults':'true'},logger)
    pid = is_running('onboard')
    if pid:
        execute(['kill', str(pid)])
def configure_quit(signal=None):
    global default_power_settings, logger
    logger.info("On exit: deactivate screensaver and set default power settings")

    write_dconf_settings(default_power_settings, logger, logaserror=False)
    execute(['xset', '-dpms'], logger)