def __init__(self):
        tweaks = []

        self.asm = AutostartManager()
        files = self.asm.get_user_autostart_files()
        for f in files:
            try:
                df = Gio.DesktopAppInfo.new_from_filename(f)
            except TypeError:
                logging.warning("Error loading desktopfile: %s" % f)
                continue

            sdf = _StartupTweak(df)
            sdf.btn.connect("clicked", self._on_remove_clicked, sdf, df)
            tweaks.append( sdf )

        add = AddStartupTweak()
        add.btn.connect("clicked", self._on_add_clicked)
        tweaks.append(add)

        ListBoxTweakGroup.__init__(self,
            _("Startup Applications"),
            *tweaks,
            css_class='tweak-group-white')
        self.set_header_func(_list_header_func, None)
    def __init__(self):
        tweaks = []

        self.asm = AutostartManager()
        files = self.asm.get_user_autostart_files()
        for f in files:
            try:
                df = Gio.DesktopAppInfo.new_from_filename(f)
            except TypeError:
                logging.warning("Error loading desktopfile: %s" % f)
                continue

            if not AutostartFile(df).is_start_at_login_enabled():
                continue

            sdf = _StartupTweak(df)
            sdf.btn.connect("clicked", self._on_remove_clicked, sdf, df)
            tweaks.append( sdf )

        add = AddStartupTweak()
        add.btn.connect("clicked", self._on_add_clicked)
        tweaks.append(add)

        ListBoxTweakGroup.__init__(self,
            _("Startup Applications"),
            *tweaks,
            css_class='tweak-group-startup')
        self.set_header_func(_list_header_func, None)
        self.connect("row-activated", lambda b, row: add.btn.activate() if row == add else None)
Example #3
0
    def __init__(self):
        tweaks = [AutostartTitle()]

        self.asm = AutostartManager()
        files = self.asm.get_user_autostart_files()
        for f in files:
            try:
                df = Gio.DesktopAppInfo.new_from_filename(f)
            except TypeError:
                logging.warning("Error loading desktopfile: %s" % f)
                continue

            if not AutostartFile(df).is_start_at_login_enabled():
                continue

            sdf = _StartupTweak(df)
            sdf.btn.connect("clicked", self._on_remove_clicked, sdf, df)
            tweaks.append(sdf)

        add = AddStartupTweak()
        add.btn.connect("clicked", self._on_add_clicked)
        tweaks.append(add)

        ListBoxTweakGroup.__init__(self,
                                   _("Startup Applications"),
                                   *tweaks,
                                   css_class='tweak-group-startup')
        self.set_header_func(_list_header_func, None)
        self.connect("row-activated", lambda b, row: add.btn.activate()
                     if row == add else None)
Example #4
0
    def __init__(self):
        extension_tweaks = []
        sg = build_horizontal_sizegroup()

        #check the shell is running
        try:
            shell = GnomeShellFactory().get_shell()
            if shell is None:
                raise Exception(
                    "Shell not running or DBus service not available")

            version = tuple(shell.version.split("."))
            ego = ExtensionsDotGnomeDotOrg(version)
            try:
                #add a tweak for each installed extension
                extensions = sorted(list(shell.list_extensions().values()),
                                    key=itemgetter("name"))
                for extension in extensions:
                    try:
                        extension_widget = _ShellExtensionTweak(shell,
                                                                extension,
                                                                size_group=sg)
                        extension_tweaks.append(extension_widget)
                        if extension.get("type") == GnomeShell.EXTENSION_TYPE[
                                "PER_USER"]:
                            ego.connect("got-extension-info", self._got_info,
                                        extension, extension_widget)
                            ego.query_extension_info(extension["uuid"])
                    except:
                        logging.warning("Invalid extension", exc_info=True)
            except:
                logging.warning("Error listing extensions", exc_info=True)
        except:
            logging.warning("Error detecting shell", exc_info=True)

        ListBoxTweakGroup.__init__(self,
                                   _("Extensions"),
                                   *extension_tweaks,
                                   activatable=True)

        if shell is None:
            return  # we're done

        self.props.valign = Gtk.Align.FILL

        self.titlebar_widget = Gtk.Switch(visible=True)
        shell._settings.bind("disable-user-extensions", self.titlebar_widget,
                             "active", Gio.SettingsBindFlags.INVERT_BOOLEAN)

        self.set_header_func(self._list_header_func, None)
        self.connect("row-activated", self._on_row_activated, None)

        if not len(extension_tweaks):
            placeholder = _ExtensionsBlankState()
            self.set_placeholder(placeholder)
            self.tweaks.append(placeholder)
    def __init__(self):
        extension_tweaks = []
        sg = build_horizontal_sizegroup()

        #check the shell is running
        try:
            shell = GnomeShellFactory().get_shell()
            if shell is None:
                raise Exception(
                    "Shell not running or DBus service not available")

            version = tuple(shell.version.split("."))
            ego = ExtensionsDotGnomeDotOrg(version)
            try:
                #add a tweak for each installed extension
                extensions = sorted(shell.list_extensions().values(),
                                    key=itemgetter("name"))
                for extension in extensions:
                    try:
                        extension_widget = _ShellExtensionTweak(shell,
                                                                extension,
                                                                size_group=sg)
                        extension_tweaks.append(extension_widget)
                        if extension.get("type") == GnomeShell.EXTENSION_TYPE[
                                "PER_USER"]:
                            ego.connect("got-extension-info", self._got_info,
                                        extension, extension_widget)
                            ego.query_extension_info(extension["uuid"])
                    except:
                        logging.warning("Invalid extension", exc_info=True)
            except:
                logging.warning("Error listing extensions", exc_info=True)
        except:
            logging.warning("Error detecting shell", exc_info=True)

        #add the extension installer
        extension_tweaks.append(
            _ShellExtensionInstallerTweak(shell, size_group=sg))

        ListBoxTweakGroup.__init__(self, _("Extensions"), *extension_tweaks)

        self.set_header_func(self._list_header_func, None)
    def __init__(self):
        extension_tweaks = []
        sg = build_horizontal_sizegroup()

        #check the shell is running
        try:
            shell = GnomeShellFactory().get_shell()
            if shell is None:
                raise Exception("Shell not running or DBus service not available")

            version =  tuple(shell.version.split("."))
            ego = ExtensionsDotGnomeDotOrg(version)
            try:
                #add a tweak for each installed extension
                extensions = sorted(shell.list_extensions().values(), key=itemgetter("name"))
                for extension in extensions:
                    try:
                        extension_widget = _ShellExtensionTweak(shell, extension, size_group=sg)
                        extension_tweaks.append(extension_widget)
                        if extension.get("type") == GnomeShell.EXTENSION_TYPE["PER_USER"]:
                            ego.connect("got-extension-info", self._got_info, extension, extension_widget)
                            ego.query_extension_info(extension["uuid"])
                    except:
                        logging.warning("Invalid extension", exc_info=True)
            except:
                logging.warning("Error listing extensions", exc_info=True)
        except:
            logging.warning("Error detecting shell", exc_info=True)
        
        #add the extension installer
        extension_tweaks.append(
                _ShellExtensionInstallerTweak(shell, size_group=sg))
            
        ListBoxTweakGroup.__init__(self,
                                   _("Extensions"),
                                   *extension_tweaks)
        
        self.set_header_func(self._list_header_func, None)
Example #7
0
            self.check1.show()
            self.check2.hide()
        else:
            self.settings[self.key_name] = False
            self.check1.hide()
            self.check2.show()


sg = build_horizontal_sizegroup()
sw = StaticWorkspaceTweak(size_group=sg, loaded=_shell_loaded)
depends_how = lambda x, kn: not (x.get_boolean(kn))

TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Workspaces"),
        sw,
        GSettingsSpinButtonTweak(_("Number of Workspaces"),
                                 "org.gnome.desktop.wm.preferences",
                                 "num-workspaces",
                                 depends_on=sw,
                                 depends_how=depends_how,
                                 size_group=sg,
                                 loaded=_shell_loaded),
        Title(_("Display Handling"),
              "",
              uid="title-theme",
              loaded=_shell_loaded),
        PrimaryWorkspaceTweak(),
    )
]
Example #8
0
TWEAK_GROUPS = [
    ListBoxTweakGroup(
        TWEAK_GROUP_FONTS,
        GSettingsFontButtonTweak(_("Window Titles"),
                                 "org.gnome.desktop.wm.preferences",
                                 "titlebar-font"),
        GSettingsFontButtonTweak(_("Interface"), "org.gnome.desktop.interface",
                                 "font-name"),
        GSettingsFontButtonTweak(_("Documents"), "org.gnome.desktop.interface",
                                 "document-font-name"),
        GSettingsFontButtonTweak(_("Monospace"), "org.gnome.desktop.interface",
                                 "monospace-font-name"),
        GSettingsComboTweak(_("Hinting"),
                            "org.gnome.settings-daemon.plugins.xsettings",
                            "hinting",
                            [(i, i.title())
                             for i in ("none", "slight", "medium", "full")]),
        GSettingsComboTweak(_("Antialiasing"),
                            "org.gnome.settings-daemon.plugins.xsettings",
                            "antialiasing",
                            [(i, i.title())
                             for i in ("none", "grayscale", "rgba")]),
        GSettingsSpinButtonTweak(_("Scaling Factor"),
                                 "org.gnome.desktop.interface",
                                 "text-scaling-factor",
                                 adjustment_step=0.1,
                                 digits=1),
    )
]
        background-color: blue;
}
.list.tweak-group#group-tweak-test {
        background-color: green;
}
""")
screen = Gdk.Screen.get_default()
context = Gtk.StyleContext()
context.add_provider_for_screen(
            screen,
            css_provider,
            1 + Gtk.STYLE_PROVIDER_PRIORITY_USER)

TWEAK_GROUPS = [
    ListBoxTweakGroup(
        "Test Many Settings",
        *[_TestTweak("name: " + str(d), "desc: " + str(d)) for d in range(10)],
        uid="group-tweak-test"),
    ListBoxTweakGroup(
        "Test Settings",
        _TestTweak("foo bar", "does foo bar", uid="tweak-test-foo"),
        _TestTweak("foo baz", "does foo baz"),
        _TestInfoTweak("long string "*10, "long description "*10, _test_button_name="short"),
        _TestInfoTweak("foo info", "info widget", _tweak_info="Information"),
        _TestInfoTweak("foo warning", "info widget", _tweak_warning="Warning"),
        Title("Test Notifications", "", uid="title-tweak-test"),
        _TestButtonTweak("Shows Information", "foo bar", _need_action=True),
        _TestButtonTweak("Needs Logout", "foo bar log", _need_logout=True)),

    ListBoxTweakGroup(
        "Unicode Test",
        Title("Words", "", uid="title-tweak-test"),
    def _get_valid_key_themes(self):
        dirs = (os.path.join(gtweak.DATA_DIR, "themes"),
                os.path.join(GLib.get_user_data_dir(), "themes"),
                os.path.join(os.path.expanduser("~"), ".themes"))
        valid = walk_directories(dirs, lambda d:
                    os.path.isfile(os.path.join(d, "gtk-3.0", "gtk-keys.css")) and \
                    os.path.isfile(os.path.join(d, "gtk-2.0-key", "gtkrc")))
        return valid


TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Keyboard and Mouse"),
        KeyThemeSwitcher(),
        GSettingsSwitchTweak(
            _("Show All Input Sources"),
            "org.gnome.desktop.input-sources",
            "show-all-sources",
            logout_required=True,
        ),
        Title(_("Mouse"), ""),
        GSettingsSwitchTweak(
            _("Show location of pointer"),
            "org.gnome.settings-daemon.peripherals.mouse",
            "locate-pointer",
            schema_filename="org.gnome.settings-daemon.peripherals.gschema.xml"
        ),
        PrimaryPasteTweak(),
    ),
]
Example #11
0
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Canonical
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSES/GPL-3.0

from gi.repository import Gio, GLib, Gtk

import gtweak
from gtweak.tweakmodel import Tweak
from gtweak.widgets import ListBoxTweakGroup, GSettingsSwitchTweak

TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Sound"),
        GSettingsSwitchTweak(
            _("Over-Amplification"),
            "org.gnome.desktop.sound",
            "allow-volume-above-100-percent",
            desc=
            _("Allows raising the volume above 100%. This can result in a loss of audio quality; it is better to increase application volume settings, if possible."
              )),
    )
]
Example #12
0
            rsplit = right.split(",")
            rsplit = [
                x for x in rsplit
                if x in ['appmenu', 'minimize', 'maximize', 'close']
            ]
            rsplit.sort(key=lambda x:
                        ["close", "minimize", "maximize", "appmenu"].index(x))
            self.settings.set_string(self.key_name,
                                     ",".join(rsplit) + colon + left)


TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Window Titlebars"),
        Title(_("Titlebar Actions"), "", uid="title-titlebar-actions"),
        GSettingsComboEnumTweak(_("Double-Click"),
                                "org.gnome.desktop.wm.preferences",
                                "action-double-click-titlebar"),
        GSettingsComboEnumTweak(_("Middle-Click"),
                                "org.gnome.desktop.wm.preferences",
                                "action-middle-click-titlebar"),
        GSettingsComboEnumTweak(_("Secondary-Click"),
                                "org.gnome.desktop.wm.preferences",
                                "action-right-click-titlebar"),
        Title(_("Titlebar Buttons"), "", uid="title-theme"),
        ShowWindowButtons(_("Maximize"), "maximize"),
        ShowWindowButtons(_("Minimize"), "minimize"),
        PlaceWindowButtons(),
    )
]
Example #13
0
        if self.btn_full.get_active():
            self.settings["hinting"] ="full"
        elif self.btn_med.get_active():
            self.settings["hinting"] = "medium"
        elif self.btn_slight.get_active():
            self.settings["hinting"] = "slight"
        else:
            print("none")
            self.settings["hinting"] = "none"

    def on_aa_button_toggled(self, button):
        if self.btn_rgba.get_active():
            self.settings["antialiasing"] = "rgba"
        elif self.btn_gray.get_active():
            self.settings["antialiasing"] = "grayscale"
        else:
            self.settings["antialiasing"] = "none"

TWEAK_GROUPS = [
    ListBoxTweakGroup(_("Fonts"),
        GSettingsFontButtonTweak(_("Window Title"),"org.gnome.desktop.wm.preferences", "titlebar-font"),
        GSettingsFontButtonTweak(_("Interface"),"org.gnome.desktop.interface", "font-name"),
        GSettingsFontButtonTweak(_("Document"), "org.gnome.desktop.interface", "document-font-name"),
        GSettingsFontButtonTweak(_("Monospace"), "org.gnome.desktop.interface", "monospace-font-name"),
        FontXSettingsTweak(),
        GSettingsSpinButtonTweak(_("Scaling Factor"),
          "org.gnome.desktop.interface", "text-scaling-factor",
          adjustment_step=0.01, digits=2),
    )
]
Example #14
0
    ListBoxTweakGroup(_("Keyboard & Mouse"),
        Title(_("Keyboard"), "", top=True),
        GSettingsSwitchTweak(_("Show Extended Input Sources"),
                              "org.gnome.desktop.input-sources",
                              "show-all-sources",
                              desc=_("Increases the choice of input sources in the Settings application."),
                              logout_required=True,),
        KeyThemeSwitcher(),
        ComposeDialogLauncher(),
        OverviewShortcutTweak(),
        AdditionalLayoutButton(),
        Title(_("Mouse"), ""),
        GSettingsComboEnumTweak(_("Acceleration Profile"),
                                "org.gnome.desktop.peripherals.mouse",
                                "accel-profile",
                                schema_filename="org.gnome.desktop.peripherals.gschema.xml"),
        GSettingsSwitchTweak(_("Pointer Location"),
                             "org.gnome.settings-daemon.peripherals.mouse",
                             "locate-pointer",
                              schema_filename="org.gnome.settings-daemon.peripherals.gschema.xml",
                              desc=_("Press the Ctrl key to highlight the pointer.")),
        GSettingsSwitchTweak(_("Middle Click Paste"),
                             "org.gnome.desktop.interface",
                             "gtk-enable-primary-paste"),

        Title(_("Touchpad"), ""),
        GSettingsSwitchTweak(_("Disable While Typing"),
                             "org.gnome.desktop.peripherals.touchpad",
                             "disable-while-typing",
                             schema_filename="org.gnome.desktop.peripherals.gschema.xml"),
        Title(_("Mouse Click Emulation"), _("Mouse Click Emulation"), top=True),
        ClickMethod(),
        ),
Example #15
0
 ListBoxTweakGroup(
     _("Windows"),
     GSettingsSwitchTweak(
         _("Attach Modal Dialogs"),
         "org.gnome.mutter",
         "attach-modal-dialogs",
         desc=
         _("When on, modal dialog windows are attached to their parent windows, and cannot be moved."
           )),
     GSettingsSwitchTweak(_("Resize with Secondary-Click"),
                          "org.gnome.desktop.wm.preferences",
                          "resize-with-right-button"),
     GSettingsComboTweak(_("Window Action Key"),
                         "org.gnome.desktop.wm.preferences",
                         "mouse-button-modifier",
                         [("disabled", _("Disabled")), ("<Alt>", "Alt"),
                          ("<Super>", "Super")]),
     Title(_("Window Focus"), _("Click to Focus"), uid="title-theme"),
     Focus(),
     GSettingsSwitchTweak(_("Raise Windows When Focused"),
                          "org.gnome.desktop.wm.preferences",
                          "auto-raise",
                          depends_on=Focus(),
                          depends_how=depends_how),
     Title(_("Titlebar Actions"), "", uid="title-titlebar-actions"),
     GSettingsComboEnumTweak(_("Double-Click"),
                             "org.gnome.desktop.wm.preferences",
                             "action-double-click-titlebar"),
     GSettingsComboEnumTweak(_("Middle-Click"),
                             "org.gnome.desktop.wm.preferences",
                             "action-middle-click-titlebar"),
     GSettingsComboEnumTweak(_("Secondary-Click"),
                             "org.gnome.desktop.wm.preferences",
                             "action-right-click-titlebar"),
     Title(_("Titlebar Buttons"), "", uid="title-theme"),
     ShowWindowButtons(_("Maximize"), "maximize"),
     ShowWindowButtons(_("Minimize"), "minimize"),
     PlaceWindowButtons(),
 )
TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Keyboard and Mouse"),
        GSettingsSwitchTweak(
            _("Show All Input Sources"),
            "org.gnome.desktop.input-sources",
            "show-all-sources",
            logout_required=True,
        ),
        KeyThemeSwitcher(),
        GSettingsComboTweak(_("Switch between overview and desktop"),
                            "org.gnome.mutter", "overlay-key",
                            [("Super_L", _("Left super")),
                             ("Super_R", _("Right super"))]),
        Title(_("Mouse"), ""),
        GSettingsSwitchTweak(
            _("Show location of pointer"),
            "org.gnome.settings-daemon.peripherals.mouse",
            "locate-pointer",
            schema_filename="org.gnome.settings-daemon.peripherals.gschema.xml"
        ),
        PrimaryPasteTweak(),
        Title(_("Touchpad"), ""),
        GSettingsComboEnumTweak(
            _("Click method"),
            "org.gnome.desktop.peripherals.touchpad",
            "click-method",
            schema_filename="org.gnome.desktop.peripherals.gschema.xml"),
    ),
]
        return not self._sync_inhibitor()

    def set_active(self, v):
        self._dfile.update_start_at_login(not v)
        self._sync_inhibitor()

    def _sync_inhibitor(self):
        if (self._dfile.is_start_at_login_enabled()):
            GLib.spawn_command_line_async(self._inhibitor_path)
            return True
        else:
            bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
            bus.call('org.gnome.tweak-tool.lid-inhibitor',
                     '/org/gnome/tweak_tool/lid_inhibitor',
                     'org.gtk.Actions',
                     'Activate',
                     GLib.Variant('(sava{sv})', ('quit', [], {})),
                     None, 0, -1, None)
            return False


TWEAK_GROUPS = [
    ListBoxTweakGroup(_("General"),
        GSettingsSwitchTweak(_("Animations"), "org.gnome.desktop.interface", "enable-animations"),
        IgnoreLidSwitchTweak(),
        # Don't show this setting in the Ubuntu session since this setting is in gnome-control-center there
        GSettingsSwitchTweak(_("Over-Amplification"), "org.gnome.desktop.sound", "allow-volume-above-100-percent",
            desc=_("Allows raising the volume above 100%. This can result in a loss of audio quality; it is better to increase application volume settings, if possible."), loaded=_shell_not_ubuntu),
    ),
]
Example #18
0
                                         ",".join(rsplit) + colon + right)
        self.notify_logout()


TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Top Bar"),
        ApplicationMenuTweak(),
        GSettingsSwitchTweak(_("Battery Percentage"),
                             "org.gnome.desktop.interface",
                             "show-battery-percentage",
                             loaded=_shell_loaded),
        # Requires patch from https://bugzilla.gnome.org/688320
        # GSettingsSwitchTweak(_("Activities Overview Hot Corner"),"org.gnome.shell", "enable-hot-corners", loaded=_shell_loaded),
        Title(_("Clock"), "", loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Date"),
                             "org.gnome.desktop.interface",
                             "clock-show-date",
                             loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Seconds"),
                             "org.gnome.desktop.interface",
                             "clock-show-seconds",
                             loaded=_shell_loaded),
        Title(_("Calendar"), "", loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Week Numbers"),
                             "org.gnome.desktop.calendar",
                             "show-weekdate",
                             loaded=_shell_loaded),
    )
]
Example #19
0
 ListBoxTweakGroup(
     _("Desktop"),
     dicons,
     GSettingsCheckTweak(_("Computer"),
                         "org.gnome.nautilus.desktop",
                         "computer-icon-visible",
                         depends_on=dicons,
                         schema_filename="org.gnome.nautilus.gschema.xml"),
     GSettingsCheckTweak(_("Home"),
                         "org.gnome.nautilus.desktop",
                         "home-icon-visible",
                         depends_on=dicons,
                         schema_filename="org.gnome.nautilus.gschema.xml"),
     GSettingsCheckTweak(_("Network Servers"),
                         "org.gnome.nautilus.desktop",
                         "network-icon-visible",
                         depends_on=dicons,
                         schema_filename="org.gnome.nautilus.gschema.xml"),
     GSettingsCheckTweak(_("Trash"),
                         "org.gnome.nautilus.desktop",
                         "trash-icon-visible",
                         depends_on=dicons,
                         schema_filename="org.gnome.nautilus.gschema.xml"),
     GSettingsCheckTweak(_("Mounted Volumes"),
                         "org.gnome.nautilus.desktop",
                         "volumes-visible",
                         depends_on=dicons,
                         schema_filename="org.gnome.nautilus.gschema.xml"),
     Title(_("Background"), "", uid="title-theme"),
     GSettingsComboEnumTweak(_("Mode"), "org.gnome.desktop.background",
                             "picture-options"),
     GSettingsFileChooserButtonTweak(
         _("Background Location"),
         "org.gnome.desktop.background",
         "picture-uri",
         local_only=True,
         mimetypes=["application/xml", "image/png", "image/jpeg"]),
     #Title(_("Files"), ""),
     #GSettingsSwitchTweak(_("Use location entry"), "org.gnome.nautilus.preferences", "always-use-location-entry",schema_filename="org.gnome.nautilus.gschema.xml"),
 )
            self._original_factor = self._xsettings.get_window_scaling_factor()
        else:
            self._xsettings.set_window_scaling_factor(self._original_factor)
            adj.set_value(self._original_factor)

        self._close()
        self._dialog.destroy()

TWEAK_GROUPS = [
    ListBoxTweakGroup(TWEAK_GROUP_WINDOWS,
        GSettingsSwitchTweak(_("Attached Modal Dialogs"),"org.gnome.mutter", "attach-modal-dialogs"),
        GSettingsSwitchTweak(_("Automatically Raise Windows"),"org.gnome.desktop.wm.preferences", "auto-raise"),
        GSettingsSwitchTweak(_("Resize with Secondary-click"),"org.gnome.desktop.wm.preferences", "resize-with-right-button"),
        GSettingsComboTweak(_("Window Action Key"),
                        "org.gnome.desktop.wm.preferences",
                        "mouse-button-modifier",
                        [("disabled", _("Disabled")), ("<Alt>", "Alt"), ("<Super>", "Super")]),
        GSettingsComboEnumTweak(_("Focus Mode"), "org.gnome.desktop.wm.preferences", "focus-mode"),
        Title(_("Titlebar Actions"), "", uid="title-titlebar-actions"),
        GSettingsComboEnumTweak(_("Double-click"),"org.gnome.desktop.wm.preferences", "action-double-click-titlebar"),
        GSettingsComboEnumTweak(_("Middle-click"),"org.gnome.desktop.wm.preferences", "action-middle-click-titlebar"),
        GSettingsComboEnumTweak(_("Secondary-click"),"org.gnome.desktop.wm.preferences", "action-right-click-titlebar"),
        Title(_("Titlebar Buttons"), "", uid="title-theme"),
        ShowWindowButtons(_("Maximize"), "maximize"),
        ShowWindowButtons(_("Minimize"), "minimize"),
        Title(_("HiDPI"), "", uid="title-hidpi"),
        WindowScalingFactorTweak(),
    )
]

Example #21
0
    ListBoxTweakGroup(
        _("Appearance"),
        #GSettingsSwitchTweak("Buttons Icons","org.gnome.desktop.interface", "buttons-have-icons"),
        #GSettingsSwitchTweak("Menu Icons","org.gnome.desktop.interface", "menus-have-icons"),
        GSettingsSwitchTweak(_("Animations"), "org.gnome.desktop.interface",
                             "enable-animations"),
        Title(_("Themes"), "", uid="title-theme"),
        GtkThemeSwitcher(),
        CursorThemeSwitcher(),
        IconThemeSwitcher(),
        ShellThemeTweak(loaded=_shell_loaded),
        Title(_("Background"), "", uid="title-theme"),
        GSettingsFileChooserButtonTweak(
            _("Image"),
            "org.gnome.desktop.background",
            "picture-uri",
            local_only=True,
            mimetypes=["application/xml", "image/png", "image/jpeg"]),
        GSettingsComboEnumTweak(_("Adjustment"),
                                "org.gnome.desktop.background",
                                "picture-options"),
        Title(_("Lock Screen"), "", uid="title-theme"),
        GSettingsFileChooserButtonTweak(
            _("Image"),
            "org.gnome.desktop.screensaver",
            "picture-uri",
            local_only=True,
            mimetypes=["application/xml", "image/png", "image/jpeg"]),
        GSettingsComboEnumTweak(_("Adjustment"),
                                "org.gnome.desktop.screensaver",
                                "picture-options"),

        # Title(_("Files"), ""),
        # GSettingsSwitchTweak(_("Use location entry"), "org.gnome.nautilus.preferences",
        # "always-use-location-entry",schema_filename="org.gnome.nautilus.gschema.xml"),
    ),
                     '/org/gnome/tweak_tool/lid_inhibitor',
                     'org.gtk.Actions',
                     'Activate',
                     GLib.Variant('(sava{sv})', ('quit', [], {})),
                     None, 0, -1, None)
            return False

sg = build_horizontal_sizegroup()
sw = StaticWorkspaceTweak(size_group=sg, loaded=_shell_loaded)
depends_how = lambda x,kn: not(x.get_boolean(kn))

TWEAK_GROUPS = [
    ListBoxTweakGroup(TWEAK_GROUP_TOPBAR,
        ApplicationMenuTweak(),
        Title(_("Clock"),""),
        GSettingsCheckTweak(_("Show date"),"org.gnome.desktop.interface", "clock-show-date", schema_filename="org.gnome.desktop.interface.gschema.xml"),
        GSettingsCheckTweak(_("Show seconds"), "org.gnome.desktop.interface", "clock-show-seconds", schema_filename="org.gnome.desktop.interface.gschema.xml"),
        Title(_("Calendar"),""),
        GSettingsCheckTweak(_("Show week numbers"),"org.gnome.desktop.calendar", "show-weekdate", schema_filename="org.gnome.desktop.calendar.gschema.xml"),
    ),
    ListBoxTweakGroup(TWEAK_GROUP_POWER,
        Title(_("When Power Button is Pressed"), "", uid="title-theme"),
        GSettingsComboEnumTweak(_("Action"), "org.gnome.settings-daemon.plugins.power", "power-button-action", size_group=sg),
        Title(_("When Laptop Lid is Closed"), "", uid="title-theme"),
        GSettingsComboEnumTweak(_("On Battery Power"),"org.gnome.settings-daemon.plugins.power", "lid-close-battery-action", size_group=sg),
        GSettingsComboEnumTweak(_("When plugged in"),"org.gnome.settings-daemon.plugins.power", "lid-close-ac-action", size_group=sg),
        GSettingsSwitchTweak(_("Suspend even if an external monitor is plugged in"),"org.gnome.settings-daemon.plugins.power", "lid-close-suspend-with-external-monitor", size_group=sg),
        IgnoreLidSwitchTweak(),
    ),
    ListBoxTweakGroup(TWEAK_GROUP_WORKSPACES,
        sw,
        GSettingsSpinButtonTweak(_("Number of Workspaces"), "org.gnome.desktop.wm.preferences", "num-workspaces", depends_on = sw, depends_how=depends_how, size_group=sg),
TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Top Bar"),
        GSettingsSwitchTweak(_("Activities Overview Hot Corner"),
                             "org.gnome.desktop.interface",
                             "enable-hot-corners",
                             loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Battery Percentage"),
                             "org.gnome.desktop.interface",
                             "show-battery-percentage",
                             loaded=_shell_loaded),
        Title(_("Clock"), "", loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Weekday"),
                             "org.gnome.desktop.interface",
                             "clock-show-weekday",
                             loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Date"),
                             "org.gnome.desktop.interface",
                             "clock-show-date",
                             loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Seconds"),
                             "org.gnome.desktop.interface",
                             "clock-show-seconds",
                             loaded=_shell_loaded),
        Title(_("Calendar"), "", loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Week Numbers"),
                             "org.gnome.desktop.calendar",
                             "show-weekdate",
                             loaded=_shell_loaded),
    )
]
Example #24
0
# Copyright (c) 2011 John Stowers
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSES/GPL-3.0

from gtweak.widgets import ListBoxTweakGroup, GSettingsSwitchTweak, Title

dicons = GSettingsSwitchTweak(_("Show Icons"),"org.gnome.desktop.background","show-desktop-icons")

# show-desktop-icons is in gsettings-desktop-schemas, but it won't actually
# *work* unless we have a version of Nautilus that still has the ability to
# draw the desktop; use one of the settings that was present in that version
# to probe for it.
home = GSettingsSwitchTweak(_("Home"),"org.gnome.nautilus.desktop",
                            "home-icon-visible", depends_on=dicons,
                            schema_filename="org.gnome.nautilus.gschema.xml")

TWEAK_GROUPS = []

if home.loaded:
    TWEAK_GROUPS.append(ListBoxTweakGroup(_("Desktop"),
        Title(_("Icons on Desktop"), "", uid="title-theme", top=True),
        dicons,
        home,
        GSettingsSwitchTweak(_("Network Servers"),"org.gnome.nautilus.desktop", "network-icon-visible", depends_on=dicons, schema_filename="org.gnome.nautilus.gschema.xml"),
        GSettingsSwitchTweak(_("Trash"),"org.gnome.nautilus.desktop", "trash-icon-visible", depends_on=dicons, schema_filename="org.gnome.nautilus.gschema.xml"),
        GSettingsSwitchTweak(_("Mounted Volumes"),"org.gnome.nautilus.desktop", "volumes-visible", depends_on=dicons, schema_filename="org.gnome.nautilus.gschema.xml"),
    ))
Example #25
0
        GetterSetterSwitchTweak.__init__(
            self, _("Suspend when laptop lid is closed"), **options)

    def get_active(self):
        return not self._sync_inhibitor()

    def set_active(self, v):
        self._dfile.update_start_at_login(not v)
        self._sync_inhibitor()

    def _sync_inhibitor(self):
        if (self._dfile.is_start_at_login_enabled()):
            GLib.spawn_command_line_async(self._inhibitor_path)
            return True
        else:
            bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
            bus.call('org.gnome.tweak-tool.lid-inhibitor',
                     '/org/gnome/tweak_tool/lid_inhibitor',
                     'org.gtk.Actions', 'Activate',
                     GLib.Variant('(sava{sv})',
                                  ('quit', [], {})), None, 0, -1, None)
            return False


TWEAK_GROUPS = [
    ListBoxTweakGroup(
        _("Power"),
        IgnoreLidSwitchTweak(),
    ),
]
Example #26
0
            except:
                #does not look like a valid theme
                self.notify_information(_("Invalid theme"))
                logging.warning("Error parsing theme zip", exc_info=True)

        #set button back to default state
        chooser.unselect_all()

    def _on_combo_changed(self, combo):
        val = combo.get_model().get_value(combo.get_active_iter(), 0)
        self._settings.set_string(ShellThemeTweak.THEME_GSETTINGS_NAME, val)


TWEAK_GROUPS = [
    ListBoxTweakGroup(
        TWEAK_GROUP_APPEARANCE,
        DarkThemeSwitcher(),
        #GSettingsSwitchTweak("Buttons Icons","org.gnome.desktop.interface", "buttons-have-icons"),
        #GSettingsSwitchTweak("Menu Icons","org.gnome.desktop.interface", "menus-have-icons"),
        Title(_("Theme"), "", uid="title-theme"),
        GtkThemeSwitcher(),
        IconThemeSwitcher(),
        CursorThemeSwitcher(),
        ShellThemeTweak(loaded=_shell_loaded),
        GSettingsSwitchTweak(_("Enable animations"),
                             "org.gnome.desktop.interface",
                             "enable-animations"),
    ),
]
 ListBoxTweakGroup(
     _("Windows"),
     GSettingsSwitchTweak(
         _("Attach Modal Dialogs"),
         "org.gnome.mutter",
         "attach-modal-dialogs",
         desc=
         _("When on, modal dialog windows are attached to their parent windows, and cannot be moved."
           )),
     # https://help.gnome.org/users/gnome-help/stable/shell-windows-tiled.html
     GSettingsSwitchTweak(
         _("Edge Tiling"),
         "org.gnome.mutter",
         "edge-tiling",
         desc=_(
             "When on, windows are tiled when dragged to screen edges.")),
     GSettingsSwitchTweak(_("Center New Windows"), "org.gnome.mutter",
                          "center-new-windows"),
     GSettingsSwitchTweak(_("Resize with Secondary-Click"),
                          "org.gnome.desktop.wm.preferences",
                          "resize-with-right-button"),
     GSettingsComboTweak(_("Window Action Key"),
                         "org.gnome.desktop.wm.preferences",
                         "mouse-button-modifier",
                         [("disabled", _("Disabled")), ("<Alt>", "Alt"),
                          ("<Super>", "Super")]),
     Title(_("Window Focus"), _("Click to Focus"), uid="title-theme"),
     Focus(),
     GSettingsSwitchTweak(_("Raise Windows When Focused"),
                          "org.gnome.desktop.wm.preferences",
                          "auto-raise",
                          depends_on=Focus(),
                          depends_how=depends_how),
 )