Skip to content
Commits on Source (67)
*~
*.pyc
ABOUT-NLS
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.*
configure
gtweak/defs.py
install-sh
missing
py-compile
*.gmo
po/*.header
po/*.sed
po/*.sin
po/.*
po/Makefile.in.in
po/Makevars.template
po/POTFILES
po/Rules-quot
po/stamp-it
compile
m4/
data/org.gnome.tweaks.appdata.xml
data/org.gnome.tweaks.desktop
42.beta
=======
Beta release.
GNOME Tweaks 42 focuses on removing tweaks which are now duplicated by
Settings. Additionally, Tweaks 42 marks the GTK theme tweak as "Legacy".
In GNOME 42, the "Legacy Applications" setting will only apply to some
GTK3 apps and a limited set of GTK4 apps. Most core GNOME apps will
instead respect the user's dark and light mode preference via libadwaita.
Users interested in theming can continue to do so using more advanced
options such as the GTK_THEME environment variable.
40.0
=======
Stable release.
......
appdata_file = 'org.gnome.tweaks.appdata.xml'
i18n.merge_file(appdata_file,
i18n.merge_file(
input: appdata_file + '.in',
output: appdata_file,
po_dir: '../po',
......@@ -7,10 +7,14 @@ i18n.merge_file(appdata_file,
install_dir: appdatadir
)
desktop_file = 'org.gnome.tweaks.desktop'
i18n.merge_file(desktop_file,
input: desktop_file + '.in',
output: desktop_file,
i18n.merge_file(
input: configure_file(
input: default_pkgappid + '.desktop.in',
output: pkgappid + '.desktop.temp',
configuration: defs_conf,
install: false
),
output: pkgappid + '.desktop',
po_dir: '../po',
install: true,
install_dir: desktopdir,
......@@ -29,7 +33,7 @@ install_data(
install_dir: 'share/glib-2.0/schemas'
)
install_data ('org.gnome.tweaks.svg',
install_data (pkgappid + '.svg',
install_dir: join_paths(datadir, 'icons', 'hicolor', 'scalable', 'apps'))
install_data ('org.gnome.tweaks-symbolic.svg',
install_data (default_pkgappid + '-symbolic.svg', rename: pkgappid + '-symbolic.svg',
install_dir: join_paths(datadir, 'icons', 'hicolor', 'symbolic', 'apps'))
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><clipPath id="d"><path d="M80 28H48c-7.73 0-14 6.27-14 14s6.27 14 14 14h32c7.73 0 14-6.27 14-14s-6.27-14-14-14zm0 0"/></clipPath><clipPath id="k"><path d="M0 0h128v128H0z"/></clipPath><clipPath id="s"><path d="M34 70h28v26H34zm0 0"/></clipPath><clipPath id="t"><path d="M48 68h32c7.73 0 14 6.27 14 14s-6.27 14-14 14H48c-7.73 0-14-6.27-14-14s6.27-14 14-14zm0 0"/></clipPath><clipPath id="m"><path d="M0 0h128v128H0z"/></clipPath><clipPath id="c"><path d="M66 30h28v26H66zm0 0"/></clipPath><clipPath id="r"><path d="M80 28H48c-7.73 0-14 6.27-14 14s6.27 14 14 14h32c7.73 0 14-6.27 14-14s-6.27-14-14-14zm0 0"/></clipPath><clipPath id="e"><path d="M34 70h28v26H34zm0 0"/></clipPath><clipPath id="f"><path d="M48 68h32c7.73 0 14 6.27 14 14s-6.27 14-14 14H48c-7.73 0-14-6.27-14-14s6.27-14 14-14zm0 0"/></clipPath><clipPath id="a"><path d="M0 0h128v128H0z"/></clipPath><clipPath id="q"><path d="M66 30h28v26H66zm0 0"/></clipPath><clipPath id="g"><path d="M0 0h128v128H0z"/></clipPath><g id="i" clip-path="url(#a)"><path d="M20 32h88a8 8 0 018 8v68a8 8 0 01-8 8H20a8 8 0 01-8-8V40a8 8 0 018-8zm0 0" fill="url(#b)"/><path d="M20 12h88a8 8 0 018 8v84a8 8 0 01-8 8H20a8 8 0 01-8-8V20a8 8 0 018-8zm0 0" fill="#f6f5f4"/><path d="M48 26c-7.758 0-14 6.242-14 14 0 .336.027.668.05 1 .513-7.285 6.532-13 13.95-13h32a13.955 13.955 0 0113.95 13c.023-.332.05-.664.05-1 0-7.758-6.242-14-14-14zm0 0" fill="#1a5fb4"/><path d="M80 28H48c-7.73 0-14 6.27-14 14s6.27 14 14 14h32c7.73 0 14-6.27 14-14s-6.27-14-14-14zm0 0" fill="#3584e4"/><g clip-path="url(#c)"><g clip-path="url(#d)"><path d="M66 44c0 7.73 6.27 14 14 14s14-6.27 14-14-6.27-14-14-14-14 6.27-14 14zm0 0" fill="#deddda"/></g></g><path d="M94 38H66v6h28zm0 0" fill="#deddda"/><path d="M66 38c0 7.73 6.27 14 14 14s14-6.27 14-14-6.27-14-14-14-14 6.27-14 14zm0 0" fill="#fff"/><path d="M80 66c7.758 0 14 6.242 14 14 0 .336-.027.668-.05 1A13.955 13.955 0 0080 68H48a13.955 13.955 0 00-13.95 13c-.023-.332-.05-.664-.05-1 0-7.758 6.242-14 14-14zm0 0" fill="#9a9996"/><path d="M48 68h32c7.73 0 14 6.27 14 14s-6.27 14-14 14H48c-7.73 0-14-6.27-14-14s6.27-14 14-14zm0 0" fill="#c0bfbc"/><g clip-path="url(#e)"><g clip-path="url(#f)"><path d="M62 84c0 7.73-6.27 14-14 14s-14-6.27-14-14 6.27-14 14-14 14 6.27 14 14zm0 0" fill="#deddda"/></g></g><path d="M34 78h28v6H34zm0 0" fill="#deddda"/><path d="M62 78c0 7.73-6.27 14-14 14s-14-6.27-14-14 6.27-14 14-14 14 6.27 14 14zm0 0" fill="#fff"/></g><g id="n" clip-path="url(#k)"><path d="M128 80.64V128H0V80.64zm0 0" fill="url(#l)"/><path d="M13.309 80.64L60.664 128H81.88l-47.36-47.36zm42.421 0L103.094 128h21.215L76.945 80.64zm42.43 0L128 110.48V89.27l-8.629-8.63zM0 88.548v21.215L18.238 128h21.215zm0 0"/></g><g id="j" clip-path="url(#g)" filter="url(#h)"><use xlink:href="#i"/></g><g id="u" clip-path="url(#m)"><use xlink:href="#n" mask="url(#o)"/></g><linearGradient id="l" gradientUnits="userSpaceOnUse" x1="300" y1="235" x2="428" y2="235" gradientTransform="matrix(0 .37 -.98462 0 295.385 -30.36)"><stop offset="0" stop-color="#f9f06b"/><stop offset="1" stop-color="#f5c211"/></linearGradient><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="48" y1="44" x2="464" y2="44" gradientTransform="matrix(.25 0 0 .25 0 53)"><stop offset="0" stop-color="#babdb6"/><stop offset=".042" stop-color="#f6f5f4"/><stop offset=".083" stop-color="#d5d3cf"/><stop offset=".917" stop-color="#deddda"/><stop offset=".958" stop-color="#f6f5f4"/><stop offset="1" stop-color="#babdb6"/></linearGradient><linearGradient id="p" gradientUnits="userSpaceOnUse" x1="48" y1="44" x2="464" y2="44" gradientTransform="matrix(.25 0 0 .25 0 53)"><stop offset="0" stop-color="#babdb6"/><stop offset=".042" stop-color="#f6f5f4"/><stop offset=".083" stop-color="#d5d3cf"/><stop offset=".917" stop-color="#deddda"/><stop offset=".958" stop-color="#f6f5f4"/><stop offset="1" stop-color="#babdb6"/></linearGradient><mask id="o"><g filter="url(#h)"><path fill-opacity=".8" d="M0 0h128v128H0z"/></g></mask><mask id="v"><use xlink:href="#j"/></mask><filter id="h" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"><feColorMatrix in="SourceGraphic" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/></filter></defs><path d="M20 32h88a8 8 0 018 8v68a8 8 0 01-8 8H20a8 8 0 01-8-8V40a8 8 0 018-8zm0 0" fill="url(#p)"/><path d="M20 12h88a8 8 0 018 8v84a8 8 0 01-8 8H20a8 8 0 01-8-8V20a8 8 0 018-8zm0 0" fill="#f6f5f4"/><path d="M48 26c-7.758 0-14 6.242-14 14 0 .336.027.668.05 1 .513-7.285 6.532-13 13.95-13h32a13.955 13.955 0 0113.95 13c.023-.332.05-.664.05-1 0-7.758-6.242-14-14-14zm0 0" fill="#1a5fb4"/><path d="M80 28H48c-7.73 0-14 6.27-14 14s6.27 14 14 14h32c7.73 0 14-6.27 14-14s-6.27-14-14-14zm0 0" fill="#3584e4"/><g clip-path="url(#q)"><g clip-path="url(#r)"><path d="M66 44c0 7.73 6.27 14 14 14s14-6.27 14-14-6.27-14-14-14-14 6.27-14 14zm0 0" fill="#deddda"/></g></g><path d="M94 38H66v6h28zm0 0" fill="#deddda"/><path d="M66 38c0 7.73 6.27 14 14 14s14-6.27 14-14-6.27-14-14-14-14 6.27-14 14zm0 0" fill="#fff"/><path d="M80 66c7.758 0 14 6.242 14 14 0 .336-.027.668-.05 1A13.955 13.955 0 0080 68H48a13.955 13.955 0 00-13.95 13c-.023-.332-.05-.664-.05-1 0-7.758 6.242-14 14-14zm0 0" fill="#9a9996"/><path d="M48 68h32c7.73 0 14 6.27 14 14s-6.27 14-14 14H48c-7.73 0-14-6.27-14-14s6.27-14 14-14zm0 0" fill="#c0bfbc"/><g clip-path="url(#s)"><g clip-path="url(#t)"><path d="M62 84c0 7.73-6.27 14-14 14s-14-6.27-14-14 6.27-14 14-14 14 6.27 14 14zm0 0" fill="#deddda"/></g></g><path d="M34 78h28v6H34zm0 0" fill="#deddda"/><path d="M62 78c0 7.73-6.27 14-14 14s-14-6.27-14-14 6.27-14 14-14 14 6.27 14 14zm0 0" fill="#fff"/><use xlink:href="#u" mask="url(#v)"/></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gnome.tweaks.desktop</id>
<id>org.gnome.tweaks</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<project_group>GNOME</project_group>
<developer_name>The GNOME Project</developer_name>
<update_contact>jbicha_at_ubuntu.com</update_contact>
<update_contact>contact_at_evanwelsh.com</update_contact>
<name>GNOME Tweaks</name>
<summary>Tweak advanced GNOME 3 settings</summary>
<description>
......@@ -18,6 +18,14 @@
</p>
</description>
<releases>
<release version="42.beta" date="2022-03-04">
<ul>
<li>Fix GNOME Extensions link</li>
<li>Clarify legacy GTK theme setting</li>
<li>Remove tweaks duplicated in Settings</li>
<li>Update translations</li>
</ul>
</release>
<release version="40.0" date="2021-03-27">
<p>
First stable release for GNOME 40. This version is mainly comprised
......
......@@ -2,7 +2,7 @@
Name=Tweaks
Comment=Tweak advanced GNOME 3 settings
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.tweaks
Icon=@APPID@
Exec=gnome-tweaks
Terminal=false
Type=Application
......@@ -10,5 +10,5 @@ StartupNotify=true
StartupWMClass=gnome-tweaks
Categories=GNOME;GTK;Utility;
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=Settings;Advanced;Preferences;Extensions;Fonts;Theme;XKB;Keyboard;Typing;
Keywords=Settings;Advanced;Preferences;Fonts;Theme;XKB;Keyboard;Typing;
OnlyShowIn=GNOME;Unity;Pantheon;
......@@ -15,7 +15,7 @@ gi.require_version("Gtk", "3.0")
gi.require_version("Handy", "1")
import gtweak
from gtweak.defs import VERSION
from gtweak.defs import VERSION, APP_ID
if __name__ == '__main__':
......@@ -60,6 +60,7 @@ if __name__ == '__main__':
gtweak.LIBEXEC_DIR = LIBEXEC_DIR
gtweak.ENABLE_TEST = options.test
gtweak.ALL_TWEAKS = options.load
gtweak.APP_ID = APP_ID
gtweak.APP_NAME = "gnome-tweaks"
gtweak.VERBOSE = options.verbose
......
......@@ -16,13 +16,6 @@ management behavior, GNOME Shell appearance and extension, etc.</description>
<category rdf:resource="http://api.gnome.org/doap-extensions#apps" />
<programming-language>Python</programming-language>
<maintainer>
<foaf:Person>
<foaf:name>Jeremy Bicha</foaf:name>
<foaf:mbox rdf:resource="mailto:jbicha@ubuntu.com" />
<gnome:userid>jbicha</gnome:userid>
</foaf:Person>
</maintainer>
<maintainer>
<foaf:Person>
<foaf:name>Evan Welsh</foaf:name>
......
......@@ -7,6 +7,7 @@ import os.path
from gi.repository import Gtk
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import Handy
import gtweak
from gtweak.defs import VERSION
......@@ -27,7 +28,7 @@ class ExtensionNotice(Gtk.MessageDialog):
"{0}\n\n{1}".format(
# Translators: Placeholder will be replaced with "GNOME Extensions" in active link form
_("Extensions management has been moved to {0}.").format(
'<a href="https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/subprojects/extensions-app/README.md">GNOME Extensions</a>',
'<a href="https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/HEAD/subprojects/extensions-app/README.md">GNOME Extensions</a>',
),
# Translators: Placeholder will be replaced with "Flathub" in active link form
_("We recommend downloading GNOME Extensions from {0} if your distribution does not include it.").format(
......@@ -40,7 +41,7 @@ class GnomeTweaks(Gtk.Application):
def __init__(self):
GLib.set_application_name(_("GNOME Tweaks"))
Gtk.Application.__init__(self, application_id="org.gnome.tweaks")
Gtk.Application.__init__(self, application_id=gtweak.APP_ID)
self.win = None
self._settings = Gio.Settings.new('org.gnome.tweaks')
......@@ -73,6 +74,10 @@ class GnomeTweaks(Gtk.Application):
about_action.connect("activate", self.about_cb)
self.add_action(about_action)
# Opt in to dark mode.
style_manager = Handy.StyleManager.get_default()
style_manager.set_color_scheme(Handy.ColorScheme.PREFER_LIGHT)
def reset_cb(self, action, parameter):
dialog = Gtk.MessageDialog(self.win, 0, Gtk.MessageType.QUESTION,
Gtk.ButtonsType.OK_CANCEL, _("Reset to Defaults"))
......@@ -105,7 +110,7 @@ class GnomeTweaks(Gtk.Application):
aboutdialog.set_comments(about_comment)
aboutdialog.set_copyright("Copyright © 2011 - 2013 John Stowers.")
aboutdialog.set_logo_icon_name("org.gnome.tweaks")
aboutdialog.set_logo_icon_name(gtweak.APP_ID)
aboutdialog.set_website("https://wiki.gnome.org/Apps/Tweaks")
aboutdialog.set_website_label(_("Homepage"))
aboutdialog.set_license_type(Gtk.License.GPL_3_0)
......
DATA_DIR = "@DATADIR@"
APP_ID = "@APPID@"
PKG_DATA_DIR = "@PKGDATADIR@"
GSETTINGS_SCHEMA_DIR = "@GSETTINGSSCHEMADIR@"
TWEAK_DIR = "@TWEAKDIR@"
......
......@@ -4,6 +4,7 @@ defs_conf.set('GSETTINGSSCHEMADIR', schemadir)
defs_conf.set('LIBEXECDIR', libexecdir)
defs_conf.set('LOCALEDIR', localedir)
defs_conf.set('PKGDATADIR', pkgdatadir)
defs_conf.set('APPID', pkgappid)
defs_conf.set('TWEAKDIR', join_paths(gtweakdir, 'tweaks'))
defs_conf.set('VERSION', meson.project_version())
......@@ -38,7 +39,6 @@ tweak_sources = [
'tweaks/tweak_group_title_bar.py',
'tweaks/tweak_group_top_bar.py',
'tweaks/tweak_group_windows.py',
'tweaks/tweak_group_workspaces.py',
'tweaks/tweak_group_xkb.py',
'tweaks/tweak_wacom.py',
]
......
......@@ -51,7 +51,7 @@ def get_sound_themes():
class GtkThemeSwitcher(GSettingsComboTweak):
def __init__(self, **options):
GSettingsComboTweak.__init__(self,
_("Applications"),
_("Legacy Applications"),
"org.gnome.desktop.interface",
"gtk-theme",
make_combo_list_with_default(self._get_valid_themes(), "Adwaita"),
......@@ -282,12 +282,12 @@ TWEAK_GROUPS = [
#GSettingsSwitchTweak("Buttons Icons","org.gnome.desktop.interface", "buttons-have-icons"),
#GSettingsSwitchTweak("Menu Icons","org.gnome.desktop.interface", "menus-have-icons"),
Title(_("Themes"), "", uid="title-theme"),
GtkThemeSwitcher(),
CursorThemeSwitcher(),
IconThemeSwitcher(),
ShellThemeTweak(loaded=_shell_loaded),
GSettingsComboTweak(_("Sound"), "org.gnome.desktop.sound", "theme-name", get_sound_themes(),
desc=_("Specifies which sound theme to use for sound events.")),
GtkThemeSwitcher(),
Title(_("Background"), "", uid="title-theme"),
GSettingsFileChooserButtonTweak(_("Image"),"org.gnome.desktop.background", "picture-uri",
......
......@@ -51,7 +51,6 @@ class IgnoreLidSwitchTweak(GetterSetterSwitchTweak):
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",
......
......@@ -34,155 +34,6 @@ class KeyThemeSwitcher(GSettingsSwitchTweakValue):
self.settings.set_string(self.key_name, "Default")
class ComposeDialogLauncher(Gtk.Box, _GSettingsTweak):
def __init__(self, **options):
name = _("Compose Key")
Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=18)
_GSettingsTweak.__init__(self, name, "org.gnome.desktop.input-sources", "xkb-options", **options)
key_values = ["compose:sclk", "compose:prsc", "compose:menu", "compose:ralt", "compose:rctrl", "compose:rwin", "compose:caps", "compose:lctrl"]
key_names = [_("Scroll Lock"), _("PrtScn"), _("Menu"), _("Right Alt"), _("Right Ctrl"), _("Right Super"), _("Caps Lock"), _("Left Ctrl")]
button = Gtk.Button(_("Disabled"), halign=Gtk.Align.END)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect("clicked", self.on_button_clicked, self.settings)
desc = _("Allows entering additional characters.")
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.props.spacing = UI_BOX_SPACING
lbl = Gtk.Label(name)
lbl.props.xalign = 0.0
lbl_desc = Gtk.Label()
lbl_desc.set_line_wrap(True)
lbl_desc.get_style_context().add_class("dim-label")
lbl_desc.set_markup("<span size='small'>"+GLib.markup_escape_text(desc)+"</span>")
vbox.pack_start(lbl, False, False, 0)
vbox.pack_start(lbl_desc, False, False, 0)
self.pack_start(vbox, False, False, 0)
self.pack_end(button, True, True, 0)
for index, item in enumerate(key_values):
if self.settings.setting_is_in_list("xkb-options", item):
button.set_label(key_names[index])
# We only support one Compose key so drop any one other set keys
for extra in key_values:
self.settings.setting_remove_from_list("xkb-options", extra)
self.settings.setting_add_to_list("xkb-options", item)
def on_button_clicked(self, widget, settings):
a = ComposeDialog(self.main_window, widget, settings)
resp = a.run()
a.destroy()
class ComposeDialog(Gtk.Dialog, Gtk.Button):
key_values = ["compose:sclk", "compose:prsc", "compose:menu", "compose:ralt", "compose:rctrl", "compose:rwin", "compose:caps", "compose:lctrl"]
key_names = [_("Scroll Lock"), _("PrtScn"), _("Menu"), _("Right Alt"), _("Right Ctrl"), _("Right Super"), _("Caps Lock"), _("Left Ctrl")]
def __init__(self, parent, parent_button, settings):
Gtk.Dialog.__init__(self)
geometry = Gdk.Geometry()
geometry.max_width = 500
self.set_geometry_hints(None, geometry, Gdk.WindowHints.MAX_SIZE)
self.set_modal(True)
self.set_transient_for(parent)
self.set_size_request(500,-1)
btn_sclk = Gtk.RadioButton.new_with_label_from_widget(None, _("Scroll Lock"))
btn_prsc = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("PrtScn"))
btn_menu = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("Menu"))
btn_ralt = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("Right Alt"))
btn_rctrl = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("Right Ctrl"))
btn_rwin = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("Right Super"))
btn_caps = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("Caps Lock"))
btn_lctrl = Gtk.RadioButton.new_with_label_from_widget(btn_sclk, _("Left Ctrl"))
compose_buttons= [btn_sclk, btn_prsc, btn_menu, btn_ralt, btn_rctrl, btn_rwin, btn_caps, btn_lctrl]
hb = Gtk.HeaderBar()
hb.set_show_close_button(True)
hb.props.title = _("Compose Key")
self.set_titlebar(hb)
switch = Gtk.Switch()
compose_enabled = False
for item in self.key_values:
if settings.setting_is_in_list("xkb-options", item):
compose_enabled = True
switch.set_active(compose_enabled)
for button in compose_buttons:
button.set_sensitive(compose_enabled)
switch.connect("notify::active", self._on_switch_changed, parent_button, compose_buttons, settings)
hb.pack_start(switch)
grid = Gtk.Grid()
grid.props.border_width = 18
label = Gtk.Label(None)
label.set_markup(_("The compose key allows a wide variety of characters to be entered. To use it, press the compose key and then a sequence of characters.\n\n"
"Many unusual characters can be entered by combining standard ones. For example, compose key followed by <b>C</b> and <b>o</b> will enter <b>©</b>, <b>a</b> followed by <b>'</b> will enter <b>á</b>.\n"))
label.set_line_wrap(True)
self.get_content_area().pack_start(grid, True, True, 0)
grid.attach(label, 0, 0, 4, 1)
grid.attach(btn_sclk, 1, 1, 1, 1)
grid.attach(btn_prsc, 1, 2, 1, 1)
grid.attach(btn_menu, 1, 3, 1, 1)
grid.attach(btn_ralt, 2, 1, 1, 1)
grid.attach(btn_rctrl, 2, 2, 1, 1)
grid.attach(btn_rwin, 2, 3, 1, 1)
grid.attach(btn_caps, 3, 1, 1, 1)
grid.attach(btn_lctrl, 3, 2, 1, 1)
if settings.setting_is_in_list("xkb-options", "compose:sclk"):
btn_sclk.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:prsc"):
btn_prsc.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:menu"):
btn_menu.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:ralt"):
btn_ralt.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:rctrl"):
btn_rctrl.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:rwin"):
btn_rwin.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:caps"):
btn_caps.set_active(True)
elif settings.setting_is_in_list("xkb-options", "compose:lctrl"):
btn_lctrl.set_active(True)
for index, button in enumerate(compose_buttons):
button.set_sensitive(compose_enabled)
button.connect("toggled", self.on_button_toggled, index, parent_button, settings)
self.show_all()
def on_button_toggled(self, button, index, parent_button, settings):
for item in self.key_values:
settings.setting_remove_from_list("xkb-options", item)
settings.setting_add_to_list("xkb-options", self.key_values[index])
parent_button.set_label(self.key_names[index])
def _on_switch_changed(self, switch, param, parent_button, compose_buttons, settings):
compose_enabled = switch.get_active()
for button in compose_buttons:
button.set_sensitive(compose_enabled)
# Until we implement storing the old Compose key setting somewhere,
# just force the key to Scroll Lock since it's first in the list.
if compose_enabled:
settings.setting_add_to_list("xkb-options", "compose:sclk")
parent_button.set_label(_("Scroll Lock"))
else:
compose_buttons[0].set_active(True)
for item in self.key_values:
settings.setting_remove_from_list("xkb-options", item)
parent_button.set_label(_("Disabled"))
class OverviewShortcutTweak(Gtk.Box, _GSettingsTweak):
def __init__(self, **options):
......@@ -367,7 +218,6 @@ TWEAK_GROUPS = [
desc=_("Increases the choice of input sources in the Settings application."),
logout_required=True,),
KeyThemeSwitcher(),
ComposeDialogLauncher(),
OverviewShortcutTweak(),
AdditionalLayoutButton(),
Title(_("Mouse"), ""),
......
......@@ -12,8 +12,6 @@ _shell_loaded = _shell is not None
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),
......
......@@ -203,9 +203,6 @@ TWEAK_GROUPS = [
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"),
......
# Copyright (c) 2011 John Stowers
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSES/GPL-3.0
from gi.repository import Gio, GLib, Gtk
import gtweak
from gtweak.gshellwrapper import GnomeShellFactory
from gtweak.tweakmodel import Tweak
from gtweak.widgets import ListBoxTweakGroup, build_horizontal_sizegroup, Title, GSettingsSpinButtonTweak, _GSettingsTweak
_shell = GnomeShellFactory().get_shell()
_shell_loaded = _shell is not None
class StaticWorkspaceTweak(Gtk.ListBox, _GSettingsTweak):
def __init__(self, **options):
name = _("Dynamic Workspaces")
Gtk.ListBox.__init__(self)
_GSettingsTweak.__init__(self, name, "org.gnome.mutter", "dynamic-workspaces", loaded=_shell_loaded)
self.set_selection_mode(Gtk.SelectionMode.NONE)
# Needs other page elements to get margins too
# self.props.margin_left = 50
# self.props.margin_right = 50
row = Gtk.ListBoxRow()
hbox = Gtk.Box()
hbox.props.margin = 10
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
lbl = Gtk.Label(name, xalign=0)
lbl.props.xalign = 0.0
desc = _("Workspaces can be created on demand, and are automatically removed when empty.")
lbl_desc = Gtk.Label()
lbl_desc.set_line_wrap(True)
lbl_desc.get_style_context().add_class("dim-label")
lbl_desc.set_markup("<span size='small'>"+GLib.markup_escape_text(desc)+"</span>")
self.check1 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
self.check1.set_no_show_all(True)
self.check1.set_visible(self.settings[self.key_name])
vbox.pack_start(lbl, False, False, 0)
vbox.pack_start(lbl_desc, False, False, 0)
hbox.pack_start(vbox, False, False, 0)
hbox.pack_end(self.check1, False, False, 0)
self.add(row)
row = Gtk.ListBoxRow()
hbox = Gtk.Box()
hbox.props.margin = 10
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
lbl = Gtk.Label(_("Static Workspaces"), xalign=0)
lbl.props.xalign = 0.0
desc = _("Number of workspaces is fixed.")
lbl_desc = Gtk.Label()
lbl_desc.set_line_wrap(True)
lbl_desc.get_style_context().add_class("dim-label")
lbl_desc.set_markup("<span size='small'>"+GLib.markup_escape_text(desc)+"</span>")
self.check2 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
self.check2.set_no_show_all(True)
self.check2.set_visible(not self.settings[self.key_name])
vbox.pack_start(lbl, False, False, 0)
vbox.pack_start(lbl_desc, False, False, 0)
hbox.pack_start(vbox, False, False, 0)
hbox.pack_end(self.check2, False, False, 0)
self.add(row)
self.connect('row-activated', self.on_row_clicked)
def on_row_clicked(self, box, row):
if row.get_index() == 0:
self.settings[self.key_name] = True
self.check1.show()
self.check2.hide()
else:
self.settings[self.key_name] = False
self.check1.hide()
self.check2.show()
class PrimaryWorkspaceTweak(Gtk.ListBox, Tweak):
def __init__(self, **options):
name = _("Workspaces")
Gtk.ListBox.__init__(self)
Tweak.__init__(self, _("Display Handling"), _("Workspaces span displays"), loaded=_shell_loaded,)
_GSettingsTweak.__init__(self, name, "org.gnome.mutter", "workspaces-only-on-primary", loaded=_shell_loaded)
self.set_selection_mode(Gtk.SelectionMode.NONE)
# Needs other page elements to get margins too
# self.props.margin_left = 50
# self.props.margin_right = 50
row = Gtk.ListBoxRow()
hbox = Gtk.Box()
hbox.props.margin = 10
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
lbl = Gtk.Label(_("Workspaces on primary display only"), xalign=0)
lbl.props.xalign = 0.0
desc = _("Additional displays are treated as independent workspaces.")
lbl_desc = Gtk.Label()
lbl_desc.set_line_wrap(True)
lbl_desc.get_style_context().add_class("dim-label")
lbl_desc.set_markup("<span size='small'>"+GLib.markup_escape_text(desc)+"</span>")
self.check1 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
self.check1.set_no_show_all(True)
self.check1.set_visible(self.settings[self.key_name])
vbox.pack_start(lbl, False, False, 0)
vbox.pack_start(lbl_desc, False, False, 0)
hbox.pack_start(vbox, False, False, 0)
hbox.pack_end(self.check1, False, False, 0)
self.add(row)
row = Gtk.ListBoxRow()
hbox = Gtk.Box()
hbox.props.margin = 10
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
lbl = Gtk.Label(_("Workspaces span displays"), xalign=0)
lbl.props.xalign = 0.0
desc = _("The current workspace includes additional displays.")
lbl_desc = Gtk.Label()
lbl_desc.set_line_wrap(True)
lbl_desc.get_style_context().add_class("dim-label")
lbl_desc.set_markup("<span size='small'>"+GLib.markup_escape_text(desc)+"</span>")
self.check2 = Gtk.Image.new_from_icon_name("object-select-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
self.check2.set_no_show_all(True)
self.check2.set_visible(not self.settings[self.key_name])
vbox.pack_start(lbl, False, False, 0)
vbox.pack_start(lbl_desc, False, False, 0)
hbox.pack_start(vbox, False, False, 0)
hbox.pack_end(self.check2, False, False, 0)
self.add(row)
self.connect('row-activated', self.on_row_clicked)
def on_row_clicked(self, box, row):
if row.get_index() == 0:
self.settings[self.key_name] = True
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(),
)
]
......@@ -19,7 +19,7 @@ class Window(Gtk.ApplicationWindow):
self.set_default_size(980, 640)
self.set_size_request(-1, 300)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_icon_name("org.gnome.tweaks")
self.set_icon_name(gtweak.APP_ID)
self.hsize_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
......@@ -70,7 +70,7 @@ class Window(Gtk.ApplicationWindow):
header = Handy.Leaflet()
header.set_transition_type(Handy.LeafletTransitionType.SLIDE)
header.connect("notify::visible-child", self._update_decorations)
header.connect("notify::fold", self._update_decorations)
header.connect("notify::folded", self._update_decorations)
left_header = Gtk.HeaderBar()
left_header.props.show_close_button = True
......@@ -177,6 +177,9 @@ class Window(Gtk.ApplicationWindow):
return right_box
def load_css(self):
window_context = self.get_style_context()
if gtweak.APP_ID.endswith('Devel'):
window_context.add_class('devel')
css_provider = Gtk.CssProvider()
css_provider.load_from_path(
os.path.join(gtweak.PKG_DATA_DIR, 'shell.css'))
......
......@@ -331,7 +331,7 @@ class Notification:
)
self.notification.set_hint(
"desktop-entry",
GLib.Variant('s', 'org.gnome.tweaks'))
GLib.Variant('s', gtweak.APP_ID))
self.notification.show()
else:
raise Exception("Not Supported")
......@@ -351,7 +351,7 @@ class LogoutNotification:
self._logout, None, None)
self.notification.set_hint(
"desktop-entry",
GLib.Variant('s', 'org.gnome.tweaks'))
GLib.Variant('s', gtweak.APP_ID))
self.notification.show()
else:
raise Exception("Not Supported")
......
project('gnome-tweaks',
version: '40.0',
meson_version: '>= 0.46.0'
version: '42.beta',
meson_version: '>= 0.50.0'
)
gnome = import('gnome')
......@@ -12,6 +12,8 @@ if not python3.found()
error('No valid python3 installation found!')
endif
dependency('libhandy-1', version: '>=1.5')
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))
......@@ -22,6 +24,13 @@ pythondir = join_paths(prefix, python3.get_path('purelib'))
pkgdatadir = join_paths(datadir, meson.project_name())
default_pkgappid = 'org.gnome.tweaks'
pkgappid = default_pkgappid
if get_option('profile') == 'development'
pkgappid = 'org.gnome.TweaksDevel'
endif
appdatadir = join_paths(datadir, 'metainfo')
desktopdir = join_paths(datadir, 'applications')
gtweakdir = python3.get_install_dir(subdir: 'gtweak')
......