├── .is-devel-dir
├── debian
├── compat
├── source
│ └── format
├── unity-tweak-tool.manpages
├── install
├── source_unity-tweak-tool.py
├── rules
├── control
├── copyright
└── changelog
├── MANIFEST.in
├── UnityTweakTool
├── utils
│ ├── __init__.py
│ └── unityreset.py
├── backends
│ ├── __init__.py
│ └── gsettings.py
├── config
│ ├── __init__.py
│ ├── u1sync.py
│ ├── logging.py
│ ├── ui.py
│ └── data.py
├── section
│ ├── __init__.py
│ ├── spaghetti
│ │ ├── __init__.py
│ │ ├── values.py
│ │ ├── unitytweakconfig.py
│ │ ├── gsettings.py
│ │ └── theme.py
│ ├── dynamic.py
│ ├── skeletonpage.py
│ ├── overview.py
│ ├── appearance.py
│ ├── system.py
│ └── windowmanager.py
├── elements
│ ├── __init__.py
│ ├── button.py
│ ├── toolbutton.py
│ ├── resetbutton.py
│ ├── filechooser.py
│ ├── option.py
│ ├── fontbutton.py
│ ├── cbox.py
│ ├── spin.py
│ ├── scale.py
│ ├── radio.py
│ ├── switch.py
│ ├── checkbox.py
│ ├── togglebutton.py
│ ├── treeview.py
│ └── colorchooser.py
├── about.py
└── __init__.py
├── unity-tweak-tool.service
├── data
├── monitor-hotcorners.png
├── monitor-window-snapping.png
├── glib-2.0
│ └── schemas
│ │ ├── gschemas.compiled
│ │ └── org.frejya.unity-tweak-tool.gschema.xml
├── media
│ ├── hicolor
│ │ ├── 16x16
│ │ │ └── apps
│ │ │ │ └── unity-tweak-tool.png
│ │ ├── 22x22
│ │ │ └── apps
│ │ │ │ └── unity-tweak-tool.png
│ │ ├── 24x24
│ │ │ └── apps
│ │ │ │ └── unity-tweak-tool.png
│ │ ├── 32x32
│ │ │ └── apps
│ │ │ │ └── unity-tweak-tool.png
│ │ ├── 48x48
│ │ │ └── apps
│ │ │ │ └── unity-tweak-tool.png
│ │ ├── 64x64
│ │ │ └── apps
│ │ │ │ └── unity-tweak-tool.png
│ │ └── 256x256
│ │ │ └── apps
│ │ │ └── unity-tweak-tool.png
│ └── scalable
│ │ ├── unity-tweak-tool-wm-symbolic.svg
│ │ ├── unity-tweak-tool-unity-symbolic.svg
│ │ ├── unity-tweak-tool-system-symbolic.svg
│ │ ├── unity-tweak-tool-overview-symbolic.svg
│ │ └── unity-tweak-tool-appearance-symbolic.svg
├── errordialog.ui
├── about.ui
└── filechooser-theme.ui
├── notes
├── wizardry.py
├── TODO
└── launcher_color.txt
├── .gitignore
├── unity-tweak-tool.desktop.in
├── unity-tweak-tool.1
├── README.md
├── unity-tweak-tool
└── setup.py
/.is-devel-dir:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include COPYING
2 |
--------------------------------------------------------------------------------
/UnityTweakTool/utils/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/debian/unity-tweak-tool.manpages:
--------------------------------------------------------------------------------
1 | unity-tweak-tool.1
2 |
--------------------------------------------------------------------------------
/UnityTweakTool/backends/__init__.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 |
--------------------------------------------------------------------------------
/UnityTweakTool/config/__init__.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/__init__.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/__init__.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 |
3 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/spaghetti/__init__.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 |
--------------------------------------------------------------------------------
/debian/install:
--------------------------------------------------------------------------------
1 | debian/source_unity-tweak-tool.py usr/share/apport/package-hooks/
2 |
--------------------------------------------------------------------------------
/unity-tweak-tool.service:
--------------------------------------------------------------------------------
1 | [D-BUS Service]
2 | Name=org.freyja.utt
3 | Exec=/usr/bin/unity-tweak-tool
4 |
--------------------------------------------------------------------------------
/data/monitor-hotcorners.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/monitor-hotcorners.png
--------------------------------------------------------------------------------
/data/monitor-window-snapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/monitor-window-snapping.png
--------------------------------------------------------------------------------
/data/glib-2.0/schemas/gschemas.compiled:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/glib-2.0/schemas/gschemas.compiled
--------------------------------------------------------------------------------
/data/media/hicolor/16x16/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/16x16/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/data/media/hicolor/22x22/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/22x22/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/data/media/hicolor/24x24/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/24x24/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/data/media/hicolor/32x32/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/32x32/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/data/media/hicolor/48x48/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/48x48/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/data/media/hicolor/64x64/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/64x64/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/data/media/hicolor/256x256/apps/unity-tweak-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freyja-dev/unity-tweak-tool/HEAD/data/media/hicolor/256x256/apps/unity-tweak-tool.png
--------------------------------------------------------------------------------
/notes/wizardry.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/python
2 |
3 | import compizconfig
4 | from gi.repository import Gdk
5 |
6 | screen= Gdk.Screen.get_default()
7 | n = screen.get_number()
8 | context = compizconfig.Context(n)
9 | print context.CurrentProfile.Name
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
2 |
3 | *~
4 | *.bak
5 | *.orig
6 |
7 | build
8 |
9 | debian/files
10 | debian/unity-tweak-tool.debhelper.log
11 | debian/unity-tweak-tool.postinst.debhelper
12 | debian/unity-tweak-tool.prerm.debhelper
13 | debian/unity-tweak-tool.substvars
14 | debian/unity-tweak-tool
15 |
--------------------------------------------------------------------------------
/debian/source_unity-tweak-tool.py:
--------------------------------------------------------------------------------
1 | import os
2 | from os import path
3 |
4 | import apport
5 | from apport.hookutils import *
6 |
7 |
8 | def add_info(report):
9 | if not apport.packaging.is_distro_package(report['Package'].split()[0]):
10 | report['CrashDB'] = '{"impl": "launchpad", "project": "unity-tweak-tool"}'
11 |
--------------------------------------------------------------------------------
/data/glib-2.0/schemas/org.frejya.unity-tweak-tool.gschema.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ''
6 | Summary
7 | Description
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | PYTHON3_VERSIONS = $(shell py3versions -r)
4 |
5 | %:
6 | dh $@ --with python3
7 |
8 |
9 | override_dh_auto_clean:
10 | rm -rf build/
11 |
12 | override_dh_auto_build:
13 | set -ex; for python in $(PYTHON3_VERSIONS); do \
14 | $$python setup.py build \
15 | --executable=/usr/bin/python3; \
16 | done
17 |
18 | override_dh_auto_install:
19 | set -ex; for python in $(PYTHON3_VERSIONS); do \
20 | $$python setup.py install \
21 | --install-layout=deb \
22 | --root=$(CURDIR)/debian/unity-tweak-tool; \
23 | done
24 |
25 |
--------------------------------------------------------------------------------
/unity-tweak-tool.desktop.in:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | _Name=Unity Tweak Tool
3 | _Comment=Configuration frontend for the Unity desktop environment
4 | Categories=Settings;
5 | Exec=unity-tweak-tool %f
6 | Icon=unity-tweak-tool
7 | GenericName=Unity Tweak Tool
8 | OnlyShowIn=Unity;
9 | StartupNotify=true
10 | Terminal=false
11 | Type=Application
12 | Actions=Unity;WinMng;Appearance;System;
13 | X-Unity-IconBackgroundColor=#ff0025
14 |
15 | [Desktop Action Unity]
16 | _Name=Unity
17 | Exec=unity-tweak-tool -u
18 | OnlyShowIn=Unity;
19 |
20 | [Desktop Action WinMng]
21 | _Name=Window Manager
22 | Exec=unity-tweak-tool -w
23 | OnlyShowIn=Unity;
24 |
25 | [Desktop Action Appearance]
26 | _Name=Appearance
27 | Exec=unity-tweak-tool -a
28 | OnlyShowIn=Unity;
29 |
30 | [Desktop Action System]
31 | _Name=System
32 | Exec=unity-tweak-tool -s
33 | OnlyShowIn=Unity;
34 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: unity-tweak-tool
2 | Section: gnome
3 | Priority: optional
4 | Maintainer: Barneedhar Vigneshwar
5 | Build-Depends: debhelper (>= 9~), python3-all (>= 3.2), python3-distutils-extra (>= 2.10)
6 | Build-Depends-Indep: python (>= 2.6.6-3~)
7 | Standards-Version: 3.9.5
8 | X-Python3-Version: >= 3.2
9 | Homepage: https://github.com/freyja-dev/unity-tweak-tool
10 |
11 | Package: unity-tweak-tool
12 | Architecture: all
13 | Depends: ${python3:Depends},
14 | gir1.2-glib-2.0,
15 | gir1.2-gtk-3.0,
16 | unity (>= 6.8),
17 | python3-xdg,
18 | python3-cairo,
19 | ${misc:Depends}
20 | Description: configuration tool for the Unity desktop environment
21 | Unity Tweak Tool is a settings manager for the Unity desktop.
22 | It provides users with a fast, simple and easy-to-use interface
23 | with which to access many useful and little known features and settings
24 | of the desktop environment that one may want to configure.
25 |
--------------------------------------------------------------------------------
/notes/TODO:
--------------------------------------------------------------------------------
1 | ###Priorities
2 |
3 | 1. Gtk Application and preventing multiple instances
4 | 2. Insensitive checks in Appearance sections
5 | 3. Installation and removable themes in Appearance sections
6 | 4. Prevent crashing upon missing schema / key -- AssertionError
7 | - Mainly Touchpad (Under System Section - Touch - Scrolling and
8 | - Overlay scrollbar (Under System Section - Scrollbars)
9 | 5. [Only on 13.04] Launcher icon size can be set below 32 -- up to 8 pixels.
10 | 6. Prevent same keybindings from being set
11 |
12 | -----------------------
13 |
14 | ###Wishlist
15 |
16 | * Search
17 | * Ubuntu-one sync (#TODO: Need to write spec for this feature)
18 | * Preset settings
19 | * Apport hook attached with debug logs
20 | * Backup and restore settings
21 | * Auto packaging tests [http://developer.ubuntu.com/packaging/html/auto-pkg-test.html]
22 | * Unit tests
23 | * libcolumbus (python bindings)
24 | * get/\_color() / get_rgba() --> deprecated stuff
25 |
--------------------------------------------------------------------------------
/UnityTweakTool/config/u1sync.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | # Any Unity One Sync settings should appear here.
33 |
--------------------------------------------------------------------------------
/unity-tweak-tool.1:
--------------------------------------------------------------------------------
1 | .TH unity-tweak-tool "1" "11 February 2013" "" "Unity User's Manual"
2 |
3 | .SH NAME
4 | unity-tweak-tool \- configuration manager for Unity desktop environment
5 |
6 | .SH SYNOPSIS
7 | .B unity-tweak-tool
8 | .RI [ options ]
9 | .br
10 |
11 | .SH DESCRIPTION
12 | The \fBunity-tweak-tool\fP program can be used to tweak Unity desktop environment. Unity Tweak Tool is a one-stop settings manager for Ubuntu Unity.
13 |
14 | .SH OPTIONS
15 | .IP \fB\-u\fP
16 | Starts \fBunity-tweak-tool\fP in Unity section.
17 |
18 | .IP \fB\-w\fP
19 | Starts \fBunity-tweak-tool\fP in Window Manager section.
20 |
21 | .IP \fB\-a\fP
22 | Starts \fBunity-tweak-tool\fP in Appearance section.
23 |
24 | .IP \fB\-s\fP
25 | Starts \fBunity-tweak-tool\fP in System section.
26 |
27 | .IP \fB\--reset-unity\fP
28 | Reset Unity, wiping all changes to configuration.
29 |
30 | .SH BUGS
31 | Please report any bug you may experience to the \fBunity-tweak-tool\fP developers, who can
32 | be reached at \fRhttps://launchpad.net/unity-tweak-tool\fP.
33 |
34 | .SH AUTHOR
35 | \fBunity-tweak-tool\fR was written by Freyja Development Team and this manual page by Barneedhar Vigneshwar .
36 |
37 | Both are released under the GNU General Public License, version 3 or later.
38 |
--------------------------------------------------------------------------------
/debian/copyright:
--------------------------------------------------------------------------------
1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2 | Upstream-Name: unity-tweak-tool
3 | Upstream-Contact: Barneedhar Vigneshwar
4 | Source: https://launchpad.net/unity-tweak-tool/+download
5 |
6 | Files: *
7 | Copyright: 2012, Barneedhar Vigneshwar
8 | License: GPL-3+
9 |
10 | Files: debian/*
11 | Copyright: 2012, Barneedhar Vigneshwar
12 | License: GPL-3+
13 |
14 | License: GPL-3+
15 | This program is free software: you can redistribute it and/or modify
16 | it under the terms of the GNU General Public License as published by
17 | the Free Software Foundation, either version 3 of the License, or
18 | (at your option) any later version.
19 | .
20 | This package is distributed in the hope that it will be useful,
21 | but WITHOUT ANY WARRANTY; without even the implied warranty of
22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 | GNU General Public License for more details.
24 | .
25 | You should have received a copy of the GNU General Public License
26 | along with this program. If not, see .
27 | .
28 | On Debian systems, the complete text of the GNU General
29 | Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | unity-tweak-tool
2 | ================
3 |
4 | Unity Tweak Tool is a configuration tool for the Unity Desktop.
5 |
6 | License: GPLv3
7 |
8 | Unity Tweak Tool can be found at http://launchpad.net/unity-tweak-tool.
9 |
10 | You can get the latest sources from the git repository:
11 |
12 | git clone https://github.com/freyja-dev/unity-tweak-tool.git .
13 |
14 | You can also browse the sources on GitHub:
15 |
16 | https://github.com/freyja-dev/unity-tweak-tool
17 |
18 |
19 | ###Usage:
20 |
21 |
22 | On Ubuntu systems (>12.10) you can install from the Freyja Development PPA:
23 |
24 | sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily
25 |
26 | or, from source folder:
27 |
28 | ./unity-tweak-tool
29 |
30 | Unity Tweak Tool depends on:
31 |
32 | * debhelper (>= 9~)
33 | * python3 (>= 3.2)
34 | * python3-distutils-extra (>= 2.10)
35 | * python (>= 2.6.6-3~)
36 | * gir1.2-glib-2.0
37 | * gir1.2-gtk-3.0
38 | * python3-xdg
39 |
40 | -----------
41 |
42 | ###Contributing:
43 |
44 | If you want to contribute code, please either send patches or a pull request to GitHub:
45 |
46 | https://github.com/freyja-dev/unity-tweak-tool
47 |
48 | Bugs are managed via Launchpad and can be reported at:
49 |
50 | https://bugs.launchpad.net/unity-tweak-tool
51 |
52 | Translations are managed on launchpad. You can edit / contribute new translations using the web interface at:
53 |
54 | https://translations.launchpad.net/unity-tweak-tool
55 |
--------------------------------------------------------------------------------
/notes/launcher_color.txt:
--------------------------------------------------------------------------------
1 | # Author : J Phani Mahesh
2 |
3 | Issue: The launcher background colour is currently superimposed on the chamelonic launcher. The result is an awkward unpredictable mixture. This is a result of implementation in unity. Absolutely nothing can be done about it, unless the unity devs change their mind.
4 |
5 | Details:
6 | Imagine two sheets. One above other. Lower one is chamelonic. Its color is decided by the background. Upper one can be set by you separately. Upper layer can be made transparent by using rgba instead of rgb. Now, you see a resultant color, looking from the top. The launcher transparency setting affects the transparency of the overall color thus formed.
7 |
8 | Solution:
9 | - Do not expose the opacity setting at all. (In the custom Color chooser dialog)
10 | - Chamelonic => top-opacity=0. Then no matter what the choosen color is, the top layer remains transparent and the result is chamelonic launcher.
11 | - Custom => top-opacity=1. Now the top layer is opaque, so the result is the choosen color.
12 |
13 | AdditionalNotes:
14 | Color chooser gives a Gdk.Color object. This has rgb values from 0 to 65535. Gsettings understands 0 to 255. Hence use color.red_float and sister attributes to get value in range 0 to 1, *255, round, convert to hex and use the resultant '#rrggbbaa' string to set gsettings.
15 |
16 | Docs mark get_color() as deprecated. However, get_rgba() needs a RGBA object made beforehand, and hence isn't pythonic. Lets change when color goes unsupported. Added necessary code to accomodate both to the color_to_hex function just in case.
17 |
--------------------------------------------------------------------------------
/UnityTweakTool/config/logging.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | # This file should control the logging setup for entire application
33 |
34 | import logging
35 | import xdg.BaseDirectory
36 | import os
37 |
38 | logger=logging.getLogger('UnityTweakTool.config.logging')
39 |
40 | # This makes the directory if missing.
41 | CACHEDIR = xdg.BaseDirectory.save_cache_path('unity-tweak-tool')
42 | LOGFILE = os.path.join(CACHEDIR,'debug.log')
43 | LOGFMT = '%(asctime)s - %(levelname)-8s :: %(name)s - %(funcName)s - %(message)s'
44 | LOGLVL = logging.DEBUG
45 |
46 |
--------------------------------------------------------------------------------
/UnityTweakTool/about.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | import os, os.path
33 |
34 | from gi.repository import Gtk, Gio
35 | from UnityTweakTool.config.data import get_data_path
36 |
37 | class About ():
38 | def __init__(self):
39 | '''Handler Initialisations.
40 | Obtain all references here.'''
41 | self.builder = Gtk.Builder()
42 | self.builder.set_translation_domain('unity-tweak-tool')
43 | self.glade = (os.path.join(get_data_path(),
44 | 'about.ui'))
45 | self.builder.add_from_file(self.glade)
46 | self.builder.connect_signals(self)
47 | self.dialog=self.builder.get_object('about_unitytweak')
48 | self.dialog.run()
49 | self.dialog.destroy()
50 |
--------------------------------------------------------------------------------
/UnityTweakTool/config/ui.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | class ui():
33 | def __init__(self, builder):
34 | self.builder = builder
35 | def __getitem__(self, obj):
36 | return self.builder.get_object(obj)
37 | def sensitize(self, list):
38 | for item in list:
39 | self.__getitem__(item).set_sensitive(True)
40 | def unsensitize(self,list):
41 | for item in list:
42 | self.__getitem__(item).set_sensitive(False)
43 | def tooltip(self, list):
44 | for item in list:
45 | tooltip = "Schema / key missing for this widget."
46 | self.unsensitize(list)
47 | self.__getitem__(item).set_tooltip_text(tooltip)
48 | self.__getitem__(item).set_tooltip_markup(tooltip)
49 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/dynamic.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | from gi.repository import Gio
33 |
34 | schema_list = Gio.Settings.list_schemas()
35 |
36 | # in Ubuntu >15.04 org.gnome.settings-daemon.peripherals was moved to org.gnome.desktop.peripherals.
37 | # lets check if we're using an older version and fix it if needed
38 | if "org.gnome.desktop.peripherals" not in schema_list:
39 | touchpad_schema = 'settings-daemon'
40 | else:
41 | touchpad_schema = 'desktop'
42 |
43 |
44 | # Desktop feature was removed in nautilus >=3.28. So we use nemo to draw desktop icons.
45 | #See https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1814506
46 | if "org.gnome.nautilus.desktop" not in schema_list:
47 | desktop_schema = 'org.nemo.desktop'
48 | else:
49 | desktop_schema = 'org.gnome.nautilus.desktop'
50 |
--------------------------------------------------------------------------------
/data/errordialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
44 |
45 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/button.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | import logging
33 | logger=logging.getLogger('UnityTweakTool.elements.button')
34 |
35 | class OverviewButton:
36 | def __init__(self,section,page,id,notebook):
37 | self.section=section
38 | self.id=id
39 | self.page=page
40 | self.notebook=notebook
41 | logger.debug('Initialised a button with id {self.id} in section {self.section} and page {self.page}'.format(self=self))
42 |
43 | def handler(self,*args,**kwargs):
44 | self.notebook.set_current_page(self.section)
45 | self.notebook.get_nth_page(self.section).set_current_page(self.page)
46 | logger.info('Handler for {self.id} executed'.format(self=self))
47 |
48 | def register(self,handler):
49 | handler['on_%s_clicked'%self.id]=self.handler
50 | logger.debug('Handler for {self.id} registered'.format(self=self))
51 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/toolbutton.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | import logging
33 | logger=logging.getLogger('UnityTweakTool.elements.toolbutton')
34 |
35 | class OverviewToolButton:
36 | def __init__(self,section,page,id,notebook):
37 | self.section=section
38 | self.id=id
39 | self.page=page
40 | self.notebook=notebook
41 | logger.debug('Initialised a toolbutton with id {self.id} in section {self.section} and page {self.page}'.format(self=self))
42 |
43 | def handler(self,*args,**kwargs):
44 | self.notebook.set_current_page(self.section)
45 | self.notebook.get_nth_page(self.section).set_current_page(self.page)
46 | logger.info('Handler for {self.id} executed'.format(self=self))
47 |
48 | def register(self,handler):
49 | handler['on_%s_clicked'%self.id]=self.handler
50 | logger.debug('Handler for {self.id} registered'.format(self=self))
51 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/resetbutton.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for ResetButton element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.resetbutton')
37 |
38 | class ResetButton:
39 | def __init__(self,controlObj):
40 | ''' Initialise a ResetButton from a controlObj dictionary '''
41 | self.id = controlObj['id']
42 | self.tab = controlObj['tab']
43 | logger.debug('Initialised a ResetButton with id {self.id}'.format(self=self))
44 |
45 | def register(self,handler):
46 | ''' Register handler on a handler object '''
47 | handler['on_%s_clicked'% self.id]=self.handler
48 | logger.debug('Handler for {self.id} registered'.format(self=self))
49 |
50 | def handler(self,*args,**kwargs):
51 | ''' Handle clicked signals '''
52 | self.tab.reset()
53 | self.tab.refresh()
54 | logger.info('Handler for {self.id} executed'.format(self=self))
55 |
56 | # The following are required to allow RB to be considered just like any other element
57 | def reset(self):
58 | pass
59 | def refresh(self):
60 | pass
61 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/filechooser.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for FileChooser element. '''
33 | import UnityTweakTool.config.data as data
34 | from gi.repository import Gtk
35 | import os
36 |
37 | import logging
38 | logger=logging.getLogger('UnityTweakTool.elements.filechooser')
39 |
40 | class FileChooser:
41 | def __init__(self,controlObj):
42 | ''' Initialise a FileChooser element from a dictionary'''
43 | self.builder = Gtk.Builder()
44 | self.ui = os.path.join(data.get_data_path(),'filechooser-theme.ui')
45 | self.builder.add_from_file(self.ui)
46 | self.widget=self.builder.get_object('themeselector')
47 | self.builder.connect_signals(self)
48 | def run(self):
49 | self.widget.run()
50 | def on_button_cancel_clicked(self,*args,**kwargs):
51 | logger.info('Theme selection cancelled by user')
52 | self.widget.destroy()
53 | def on_button_install_clicked(self,*args,**kwargs):
54 | logger.debug('Install clicked')
55 | file=self.widget.get_filename()
56 | if file is None:
57 | return
58 | logger.info('Attempting to install %s'%file)
59 | logger.warn('Unimplemented logic')
60 | # TODO : Get file name and do the installation
61 | self.widget.destroy()
62 |
63 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/spaghetti/values.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | from . import gsettings
33 | from UnityTweakTool.config.ui import ui
34 |
35 | class values():
36 |
37 | def get_value(self, type, schema, key, key_list):
38 | if schema is not None:
39 | if gsettings.test_key(schema, key):
40 | attr = 'get_' + type
41 | return getattr(schema, attr)(key)
42 | else:
43 | print('%s key not present.' % key)
44 | self.ui.tooltip(key_list)
45 | else:
46 | print('%s schema not present.' % schema)
47 |
48 | def set_value(self, type, schema, key, setting):
49 | if schema is not None:
50 | if gsettings.test_key(schema, key):
51 | attr = 'set_' + type
52 | return getattr(schema, attr)(key, setting)
53 | else:
54 | print('%s key not present.' % key)
55 | else:
56 | print('%s schema not present.' % schema)
57 |
58 | def reset_value(self, schema, key):
59 | if schema is not None:
60 | if gsettings.test_key(schema, key):
61 | return schema.reset(key)
62 | else:
63 | print('%s key not present.' % key)
64 | else:
65 | print('%s schema not present.' % schema)
66 |
--------------------------------------------------------------------------------
/UnityTweakTool/config/data.py:
--------------------------------------------------------------------------------
1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2 | #
3 | # Team:
4 | # J Phani Mahesh
5 | # Barneedhar (jokerdino)
6 | # Amith KK
7 | # Georgi Karavasilev
8 | # Sam Tran
9 | # Sam Hewitt
10 | # Angel Araya
11 | #
12 | # Description:
13 | # A One-stop configuration tool for Unity.
14 | #
15 | # Legal Stuff:
16 | #
17 | # This file is a part of Unity Tweak Tool
18 | #
19 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
20 | # the terms of the GNU General Public License as published by the Free Software
21 | # Foundation; version 3.
22 | #
23 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
24 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
26 | # details.
27 | #
28 | # You should have received a copy of the GNU General Public License along with
29 | # this program; if not, see
30 |
31 | __all__ = [
32 | 'project_path_not_found',
33 | 'get_data_file',
34 | 'get_data_path',
35 | ]
36 |
37 | # Where your project will look for your data (for instance, images and ui
38 | # files). By default, this is ../data, relative your trunk layout
39 | __unity_tweak_tool_data_directory__ = '../../data/'
40 | __license__ = 'GPL-3'
41 | __version__ = '0.0.7'
42 |
43 | import os
44 |
45 | from locale import gettext as _
46 |
47 | class project_path_not_found(Exception):
48 | """Raised when we can't find the project directory."""
49 |
50 |
51 | def get_data_file(*path_segments):
52 | """Get the full path to a data file.
53 |
54 | Returns the path to a file underneath the data directory (as defined by
55 | `get_data_path`). Equivalent to os.path.join(get_data_path(),
56 | *path_segments).
57 | """
58 | return os.path.join(get_data_path(), *path_segments)
59 |
60 |
61 | def get_data_path():
62 | """Retrieve unity-tweak-tool data path"""
63 |
64 | # Get pathname absolute or relative.
65 | path = os.path.join(
66 | os.path.dirname(__file__), __unity_tweak_tool_data_directory__)
67 |
68 | abs_data_path = os.path.abspath(path)
69 | if not os.path.exists(abs_data_path):
70 | raise project_path_not_found
71 |
72 | return abs_data_path
73 |
74 | def get_version():
75 | return __version__
76 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/skeletonpage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | import os, os.path
33 | import UnityTweakTool.config.data as data
34 | from UnityTweakTool.elements.resetbutton import ResetButton
35 | from gi.repository import Gtk, Gio
36 |
37 | class Section ():
38 | def __init__(self, ui,id):
39 | self.builder = Gtk.Builder()
40 | self.builder.set_translation_domain('unity-tweak-tool')
41 | self.ui = os.path.join(data.get_data_path(),ui)
42 | self.builder.add_from_file(self.ui)
43 | self.page = self.builder.get_object(id)
44 | self.page.unparent()
45 | self.handler={}
46 | def add_page(self,page):
47 | page.register_tab(self.handler)
48 | page.refresh()
49 | def register(self):
50 | self.builder.connect_signals(self.handler)
51 |
52 | class Tab():
53 | def __init__(self,elements):
54 | self.registered=False
55 | self.elements=elements
56 |
57 | def register_tab(self,handler):
58 | assert self.registered is False
59 | for element in self.elements:
60 | element.register(handler)
61 | self.registered=True
62 | def enable_restore(self,id):
63 | self.elements.append(ResetButton({'id':id,'tab':self}))
64 | def reset(self):
65 | for element in self.elements:
66 | element.reset()
67 | def refresh(self):
68 | for element in self.elements:
69 | element.refresh()
70 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/spaghetti/unitytweakconfig.py:
--------------------------------------------------------------------------------
1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2 | #
3 | # Team:
4 | # J Phani Mahesh
5 | # Barneedhar (jokerdino)
6 | # Amith KK
7 | # Georgi Karavasilev
8 | # Sam Tran
9 | # Sam Hewitt
10 | # Angel Araya
11 | #
12 | # Description:
13 | # A One-stop configuration tool for Unity.
14 | #
15 | # Legal Stuff:
16 | #
17 | # This file is a part of Unity Tweak Tool
18 | #
19 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
20 | # the terms of the GNU General Public License as published by the Free Software
21 | # Foundation; version 3.
22 | #
23 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
24 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
26 | # details.
27 | #
28 | # You should have received a copy of the GNU General Public License along with
29 | # this program; if not, see
30 |
31 | __all__ = [
32 | 'project_path_not_found',
33 | 'get_data_file',
34 | 'get_data_path',
35 | ]
36 |
37 | # Where your project will look for your data (for instance, images and ui
38 | # files). By default, this is ../data, relative your trunk layout
39 | __unity_tweak_tool_data_directory__ = '../../../data/'
40 | __license__ = 'GPL-3'
41 | __version__ = '0.0.7'
42 |
43 | import os
44 |
45 | from locale import gettext as _
46 |
47 | class project_path_not_found(Exception):
48 | """Raised when we can't find the project directory."""
49 |
50 |
51 | def get_data_file(*path_segments):
52 | """Get the full path to a data file.
53 |
54 | Returns the path to a file underneath the data directory (as defined by
55 | `get_data_path`). Equivalent to os.path.join(get_data_path(),
56 | *path_segments).
57 | """
58 | return os.path.join(get_data_path(), *path_segments)
59 |
60 |
61 | def get_data_path():
62 | """Retrieve unity-tweak-tool data path"""
63 |
64 | # Get pathname absolute or relative.
65 | path = os.path.join(
66 | os.path.dirname(__file__), __unity_tweak_tool_data_directory__)
67 |
68 | abs_data_path = os.path.abspath(path)
69 | if not os.path.exists(abs_data_path):
70 | raise project_path_not_found
71 |
72 | return abs_data_path
73 |
74 | def get_version():
75 | return __version__
76 |
--------------------------------------------------------------------------------
/data/about.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | False
6 | 5
7 | False
8 | 70
9 | dialog
10 | Unity Tweak Tool
11 | 0.0.7
12 | Copyright © 2013 Freyja Development team
13 | Unity Tweak Tool is a settings manager intended to be used with Ubuntu Unity.
14 | https://launchpad.net/unity-tweak-tool
15 | Unity Tweak Tool on Launchpad
16 | GPL3
17 | Amith KK <amithkumaran@gmail.com>
18 | Angel Araya <al.arayaq@gmail.com>
19 | Barneedhar (jokerdino) <barneedhar@ubuntu.com>
20 | Georgi Karavasilev <kokoto-java@ubuntu.com>
21 | J Phani Mahesh <phanimahesh@gmail.com>
22 | Sam Hewitt <snwh@ubuntu.com>
23 | Sam Tran <samvtran@gmail.com>
24 | Barneedhar (jokerdino) <barneedhar@ubuntu.com>
25 | Sam Hewitt <hewittsamuel@gmail.com>
26 | /usr/share/icons/hicolor/64x64/apps/unity-tweak-tool.png
27 | gpl-3-0
28 |
29 |
30 | False
31 | vertical
32 | 2
33 |
34 |
35 | False
36 | end
37 |
38 |
39 | False
40 | True
41 | end
42 | 0
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/unity-tweak-tool:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | import argparse
33 | import UnityTweakTool
34 | import os
35 |
36 | import gettext
37 | gettext.bindtextdomain('unity-tweak-tool')
38 | _=gettext.gettext
39 |
40 |
41 | parser = argparse.ArgumentParser()
42 | optgrp = parser.add_mutually_exclusive_group()
43 |
44 | optgrp.add_argument('-u', '--unity', help=_('Start in the Unity tab'), action='store_true')
45 | optgrp.add_argument('-w', '--winmng', help=_('Start in the WindowManager tab'), action='store_true')
46 | optgrp.add_argument('-a', '--appearance', help=_('Start in the appearance tab'), action='store_true')
47 | optgrp.add_argument('-s', '--system', help=_('Start in the system tab'), action='store_true')
48 | optgrp.add_argument('--reset-unity', help=_('Reset Unity, wiping all configuration changes.'), action='store_true')
49 |
50 |
51 | # DBUS crashes if DISPLAY is not set.
52 | # https://errors.ubuntu.com/problem/5ce3e25dca09d233db038f04e57e179dda28ec9b
53 | # Make a safe bet that it is :0.
54 | # If you have multi display/ ssh -X, you can prolly debug if there's an issue.
55 | if "DISPLAY" not in os.environ:
56 | os.environ["DISPLAY"] = ":0"
57 |
58 | args=parser.parse_args()
59 | if args.unity:
60 | UnityTweakTool.Application(1)
61 | elif args.winmng:
62 | UnityTweakTool.Application(2)
63 | elif args.appearance:
64 | UnityTweakTool.Application(3)
65 | elif args.system:
66 | UnityTweakTool.Application(4)
67 | elif args.reset_unity:
68 | print(_("""
69 | WARNING: You are about to reset Unity to its default configuration.
70 | This will result in loss of configuration.
71 | It is normal for your desktop to flicker during the process.
72 | Type yes to continue, anything else to exit.
73 | """))
74 | prompt = input(_("Do you wish to continue?"))
75 | if prompt.lower() == 'yes':
76 | UnityTweakTool.reset_all()
77 | print(_("Please log out and log back in."))
78 | else:
79 | UnityTweakTool.Application()
80 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/option.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Generic option '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | #import logging
36 | #logger=logging.getLogger('UnityTweakTool.elements.option')
37 |
38 | class Option:
39 | ''' Generic class to be used for those options which
40 | are not straightforward to port. Will be removed in due time.'''
41 | def __init__(self,controlObj):
42 | self.handler=controlObj['handler']
43 | self.reset =controlObj['reset']
44 | self.handlerid=controlObj['handlerid']
45 | self.refresh=controlObj['refresh']
46 | def register(self,handler):
47 | handler[self.handlerid]=self.handler
48 |
49 | class HandlerObject:
50 | def __init__(self,ho):
51 | self.ho=ho
52 | def isHandler(attrname,ho=ho,prefix='on',suffix='reset_clicked'):
53 | return attrname.startswith(prefix) and \
54 | not attrname.endswith(suffix) and \
55 | callable(getattr(ho, attrname))
56 | def isResetHandler(attrname,ho=ho,prefix='on',suffix='reset_clicked'):
57 | return attrname.startswith(prefix) and \
58 | attrname.endswith(suffix) and \
59 | callable(getattr(ho, attrname))
60 | handlers = list(filter(isHandler, dir(ho)))
61 | self.hodict={key:getattr(ho,key) for key in handlers}
62 | reset_handlers = list(filter(isResetHandler,dir(ho)))
63 | self.hodict_reset={key:getattr(ho,key) for key in reset_handlers}
64 | self.register_tab=self.register
65 | def register(self,handler):
66 | handler.update(self.hodict)
67 | for key,val in self.hodict_reset.items():
68 | if key in handler:
69 | def reset_fix(*args,ported_reset=handler[key],old_reset=val,**kwargs):
70 | old_reset(*args,**kwargs)
71 | ported_reset(*args,**kwargs)
72 | handler[key]=reset_fix
73 | else:
74 | handler[key]=val
75 | def refresh(self):
76 | self.ho.refresh()
77 | def reset(self):
78 | self.ho.reset()
79 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/fontbutton.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for FontButton element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.fontbutton')
37 |
38 | class FontButton:
39 | def __init__(self,controlObj):
40 | ''' Initialise a FontButton element from a dictionary'''
41 | self.id = controlObj['id']
42 | self.ui = controlObj['builder'].get_object(controlObj['id'])
43 | self.schema = controlObj['schema']
44 | self.path = controlObj['path']
45 | self.key = controlObj['key']
46 | self.type = 'string'
47 | assert gsettings.is_valid(
48 | schema=self.schema,
49 | path=self.path,
50 | key=self.key
51 | )
52 | logger.debug('Initialised a fontbutton with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
53 |
54 | def register(self,handler):
55 | ''' register handler on a handler object '''
56 | handler['on_%s_font_set'%self.id]=self.handler
57 | logger.debug('Handler for {self.id} registered'.format(self=self))
58 |
59 | def refresh(self):
60 | ''' Refresh UI reading from backend '''
61 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
62 | self.ui.set_font_name(
63 | gsettings.get(
64 | schema=self.schema,
65 | path =self.path,
66 | key =self.key,
67 | type =self.type
68 | )
69 | )
70 |
71 | def handler(self,*args,**kwargs):
72 | ''' handle toggle signals '''
73 | gsettings.set(
74 | schema=self.schema,
75 | path=self.path,
76 | key=self.key,
77 | type=self.type,
78 | value=self.ui.get_font_name()
79 | )
80 | logger.info('Handler for {self.id} executed'.format(self=self))
81 |
82 | def reset(self):
83 | ''' Reset the controlled key '''
84 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
85 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
86 |
--------------------------------------------------------------------------------
/data/media/scalable/unity-tweak-tool-wm-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
92 |
--------------------------------------------------------------------------------
/data/filechooser-theme.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | application/x-gtar
7 | application/zip
8 | application/x-tar
9 | application/x-gzip
10 | application/x-7z-compressed
11 |
12 |
13 |
14 | False
15 | 5
16 | popup
17 | Choose a Theme file to install
18 | GtkFileChooserDialog
19 | True
20 | True
21 | dialog
22 | True
23 | False
24 | ArchiveFilter
25 |
26 |
27 | False
28 | vertical
29 | 2
30 |
31 |
32 | False
33 | end
34 |
35 |
36 | gtk-cancel
37 | True
38 | True
39 | True
40 | True
41 |
42 |
43 |
44 | False
45 | True
46 | 0
47 |
48 |
49 |
50 |
51 | Install Theme
52 | True
53 | True
54 | True
55 |
56 |
57 |
58 | False
59 | True
60 | 1
61 |
62 |
63 |
64 |
65 | False
66 | True
67 | end
68 | 0
69 |
70 |
71 |
72 |
73 |
74 | button_cancel
75 | button_install
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/cbox.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for cbox element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.cbox')
37 |
38 | class ComboBox:
39 | def __init__(self,controlObj):
40 | ''' Initialise a ComboBox element from a dictionary'''
41 | self.id = controlObj['id']
42 | self.ui = controlObj['builder'].get_object(controlObj['id'])
43 | self.schema = controlObj['schema']
44 | self.path = controlObj['path']
45 | self.key = controlObj['key']
46 | self.type = controlObj['type']
47 | self.map = controlObj['map']
48 | self.invmap = dict([ (v,k) for (k,v) in self.map.items() ])
49 | self.disabled = False
50 | try:
51 | assert gsettings.is_valid(
52 | schema=self.schema,
53 | path=self.path,
54 | key=self.key
55 | )
56 | except AssertionError as e:
57 | self.disabled = True
58 | logger.debug('Initialised a ComboBox with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
59 |
60 | def register(self,handler):
61 | ''' register handler on a handler object '''
62 | handler['on_%s_changed'%self.id]=self.handler
63 | logger.debug('Handler for {self.id} registered'.format(self=self))
64 |
65 | def refresh(self):
66 | ''' Refresh UI reading from backend '''
67 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
68 | if self.disabled:
69 | self.ui.set_active(False)
70 | return
71 | self.ui.set_active(
72 | self.map[
73 | gsettings.get(
74 | schema=self.schema,
75 | path =self.path,
76 | key =self.key,
77 | type =self.type
78 | )
79 | ]
80 | )
81 |
82 | def handler(self,*args,**kwargs):
83 | ''' handle toggle signals '''
84 | if self.disabled:
85 | return
86 | gsettings.set(
87 | schema=self.schema,
88 | path=self.path,
89 | key=self.key,
90 | type=self.type,
91 | value=self.invmap[self.ui.get_active()]
92 | )
93 | logger.info('Handler for {self.id} executed'.format(self=self))
94 |
95 | def reset(self):
96 | ''' Reset the controlled key '''
97 | if self.disabled:
98 | return
99 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
100 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
101 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/spin.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for Spin button element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.spin')
37 |
38 | class SpinButton:
39 | def __init__(self,controlObj):
40 | ''' Initialise a SpinButton from a controlObj dictionary '''
41 | self.id = controlObj['id']
42 | self.ui = controlObj['builder'].get_object(controlObj['id'])
43 | self.schema = controlObj['schema']
44 | self.path = controlObj['path']
45 | self.key = controlObj['key']
46 | self.type = controlObj['type']
47 | self.min = controlObj['min']
48 | self.max = controlObj['max']
49 | self.disabled = False
50 | try:
51 | assert gsettings.is_valid(
52 | schema=self.schema,
53 | path=self.path,
54 | key=self.key
55 | )
56 | except AssertionError as e:
57 | self.disabled = True
58 | # TODO : set the range mased on the config min-max
59 | # self.ui.
60 | logger.debug('Initialised a spin with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
61 |
62 |
63 | def register(self,handler):
64 | ''' Register handler on a handler object '''
65 | handler['on_%s_value_changed'% self.id]=self.handler
66 | logger.debug('Handler for {self.id} registered'.format(self=self))
67 |
68 | def refresh(self):
69 | ''' Refresh the UI querying the backend '''
70 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
71 | if self.disabled:
72 | self.ui.set_sensitive(False)
73 | return
74 | self.ui.set_value(
75 | gsettings.get(
76 | schema= self.schema,
77 | path = self.path,
78 | key = self.key,
79 | type = self.type
80 | )
81 | )
82 |
83 | def handler(self,*args,**kwargs):
84 | ''' Handle notify::active signals '''
85 | if self.disabled:
86 | return
87 | gsettings.set(
88 | schema = self.schema,
89 | path = self.path,
90 | key = self.key,
91 | type = self.type,
92 | value = self.ui.get_value()
93 | )
94 | logger.info('Handler for {self.id} executed'.format(self=self))
95 |
96 | def reset(self):
97 | ''' Reset the controlled key '''
98 | if self.disabled:
99 | return
100 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
101 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
102 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/scale.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for Scale element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.scale')
37 |
38 | class Scale:
39 | def __init__(self,controlObj):
40 | ''' Initialise a scale from a controlObj dictionary '''
41 | self.id = controlObj['id']
42 | self.ui = controlObj['builder'].get_object(controlObj['id'])
43 | self.schema = controlObj['schema']
44 | self.path = controlObj['path']
45 | self.key = controlObj['key']
46 | self.type = controlObj['type']
47 | self.min = controlObj['min']
48 | self.max = controlObj['max']
49 | self.ticks = controlObj['ticks']
50 | self.disabled = False
51 | try:
52 | assert gsettings.is_valid(
53 | schema = self.schema,
54 | path = self.path,
55 | key = self.key
56 | )
57 | except AssertionError as e:
58 | self.disabled=True
59 | for tick in self.ticks:
60 | self.ui.add_mark(*tick)
61 | # TODO : Set range using min, max
62 | logger.debug('Initialised a scale with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
63 |
64 |
65 | def register(self,handler):
66 | ''' Register handler on a handler object '''
67 | handler['on_%s_value_changed'% self.id]=self.handler
68 | logger.debug('Handler for {self.id} registered'.format(self=self))
69 |
70 | def refresh(self):
71 | ''' Refresh the UI querying the backend '''
72 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
73 | if self.disabled:
74 | self.ui.set_sensitive(False)
75 | return
76 | self.ui.set_value(
77 | gsettings.get(
78 | schema=self.schema,
79 | path =self.path,
80 | key =self.key,
81 | type =self.type
82 | )
83 | )
84 |
85 | def handler(self,*args,**kwargs):
86 | ''' Handle value_changed signals '''
87 | if self.disabled:
88 | return
89 | gsettings.set(
90 | schema=self.schema,
91 | path=self.path,
92 | key=self.key,
93 | type=self.type,
94 | value=self.ui.get_value()
95 | )
96 | logger.info('Handler for {self.id} executed'.format(self=self))
97 |
98 | def reset(self):
99 | ''' Reset the controlled key '''
100 | if self.disabled:
101 | return
102 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
103 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
104 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/radio.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for Radio element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.radio')
37 |
38 | class Radio:
39 | def __init__(self,controlObj):
40 | ''' Initialise a Radio from a controlObj dictionary '''
41 | self.id = controlObj['id']
42 | self.builder = controlObj['builder']
43 | self.ui = controlObj['builder'].get_object(controlObj['id'])
44 | self.schema = controlObj['schema']
45 | self.path = controlObj['path']
46 | self.key = controlObj['key']
47 | self.type = controlObj['type']
48 | self.group = controlObj['group']
49 | self.value = controlObj['value']
50 | self.dependants = controlObj['dependants']
51 | self.active = False
52 | self.disabled = False
53 | try:
54 | assert gsettings.is_valid(
55 | schema=self.schema,
56 | path=self.path,
57 | key=self.key
58 | )
59 | except AssertionError as e:
60 | self.disabled=True
61 | logger.debug('Initialised a radiobutton with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
62 |
63 | def register(self,handler):
64 | ''' Register handler on a handler object '''
65 | handler['on_%s_toggled'% self.id]=self.handler
66 | logger.debug('Handler for {self.id} registered'.format(self=self))
67 |
68 | def refresh(self):
69 | ''' Refresh the UI querying the backend '''
70 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
71 | if self.disabled:
72 | self.ui.set_sensitive(False)
73 | return
74 | self.active=gsettings.get(
75 | schema=self.schema,
76 | path =self.path,
77 | key =self.key,
78 | type =self.type
79 | ) == self.value
80 | self.ui.set_active(self.active)
81 | self.handledependants()
82 |
83 | def handler(self,*args,**kwargs):
84 | ''' Handle toggled signals '''
85 | if self.disabled:
86 | return
87 | self.active=self.ui.get_active()
88 | if self.active:
89 | gsettings.set(
90 | schema=self.schema,
91 | path=self.path,
92 | key=self.key,
93 | type=self.type,
94 | value=self.value
95 | )
96 | self.handledependants()
97 | logger.info('Handler for {self.id} executed'.format(self=self))
98 |
99 | def reset(self):
100 | ''' Reset the controlled key '''
101 | if self.disabled:
102 | return
103 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
104 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
105 |
106 | def handledependants(self):
107 | status = False if self.disabled else self.active
108 | for element in self.dependants:
109 | self.builder.get_object(element).set_sensitive(status)
110 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/switch.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for Switch element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.switch')
37 |
38 | class Switch:
39 | def __init__(self,controlObj):
40 | ''' Initialise a switch from a controlObj dictionary '''
41 | self.id = controlObj['id']
42 | self.builder = controlObj['builder']
43 | self.ui = controlObj['builder'].get_object(controlObj['id'])
44 | self.schema = controlObj['schema']
45 | self.path = controlObj['path']
46 | self.key = controlObj['key']
47 | self.type = controlObj['type']
48 | self.map = controlObj['map']
49 | self.invmap = dict([ (v,k) for (k,v) in self.map.items() ])
50 | self.dependants = controlObj['dependants']
51 | self.disabled = False
52 | try:
53 | assert gsettings.is_valid(
54 | schema=self.schema,
55 | path=self.path,
56 | key=self.key
57 | )
58 | except AssertionError as e:
59 | self.disabled = True
60 | logger.debug('Initialised a switch with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
61 |
62 | def register(self,handler):
63 | ''' Register handler on a handler object '''
64 | handler['on_%s_active_notify'% self.id]=self.handler
65 | logger.debug('Handler for {self.id} registered'.format(self=self))
66 |
67 | def refresh(self):
68 | ''' Refresh the UI querying the backend '''
69 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
70 | if self.disabled:
71 | self.ui.set_sensitive(False)
72 | return
73 | self.active=self.map[
74 | gsettings.get(
75 | schema=self.schema,
76 | path =self.path,
77 | key =self.key,
78 | type =self.type
79 | )
80 | ]
81 | self.ui.set_active(self.active)
82 | self.handledependants()
83 |
84 | def handler(self,*args,**kwargs):
85 | ''' Handle notify::active signals '''
86 | if self.disabled:
87 | return
88 | self.active=self.ui.get_active()
89 | gsettings.set(
90 | schema=self.schema,
91 | path=self.path,
92 | key=self.key,
93 | type=self.type,
94 | value=self.invmap[self.active]
95 | )
96 | self.handledependants()
97 | logger.info('Handler for {self.id} executed'.format(self=self))
98 |
99 | def reset(self):
100 | ''' Reset the controlled key '''
101 | if self.disabled:
102 | return
103 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
104 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
105 |
106 | def handledependants(self):
107 | status = False if self.disabled else self.active
108 | for element in self.dependants:
109 | self.builder.get_object(element).set_sensitive(status)
110 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/checkbox.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for Checkbox element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.checkbox')
37 |
38 | class CheckBox:
39 | def __init__(self,controlObj):
40 | ''' Initialise a Checkbox element from a dictionary'''
41 | self.id = controlObj['id']
42 | self.builder = controlObj['builder']
43 | self.ui = controlObj['builder'].get_object(controlObj['id'])
44 | self.schema = controlObj['schema']
45 | self.path = controlObj['path']
46 | self.key = controlObj['key']
47 | self.type = controlObj['type']
48 | self.map = controlObj['map']
49 | self.invmap = dict([ (v,k) for (k,v) in self.map.items() ])
50 | self.dependants = controlObj['dependants']
51 | self.active = False
52 | self.disabled = False
53 | try:
54 | assert gsettings.is_valid(
55 | schema=self.schema,
56 | path=self.path,
57 | key=self.key
58 | )
59 | except AssertionError as e:
60 | self.disabled = True
61 | logger.debug('Initialised a checkbox with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
62 |
63 | def register(self,handler):
64 | ''' register handler on a handler object '''
65 | handler['on_%s_toggled'%self.id]=self.handler
66 | logger.debug('Handler for {self.id} registered'.format(self=self))
67 |
68 | def refresh(self):
69 | ''' Refresh UI reading from backend '''
70 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
71 | if self.disabled:
72 | self.ui.set_sensitive(False)
73 | return
74 | self.active=self.map[
75 | gsettings.get(
76 | schema=self.schema,
77 | path =self.path,
78 | key =self.key,
79 | type =self.type
80 | )
81 | ]
82 | self.ui.set_active(self.active)
83 | self.handledependants()
84 |
85 | def handler(self,*args,**kwargs):
86 | ''' handle toggle signals '''
87 | if self.disabled:
88 | return
89 | self.active=self.ui.get_active()
90 | gsettings.set(
91 | schema=self.schema,
92 | path=self.path,
93 | key=self.key,
94 | type=self.type,
95 | value=self.invmap[self.active]
96 | )
97 | self.handledependants()
98 | logger.info('Handler for {self.id} executed'.format(self=self))
99 |
100 | def reset(self):
101 | ''' Reset the controlled key '''
102 | if self.disabled:
103 | return
104 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
105 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
106 |
107 | def handledependants(self):
108 | status=False if self.disabled else self.active
109 | for element in self.dependants:
110 | self.builder.get_object(element).set_sensitive(status)
111 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/togglebutton.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for ToggleButton element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.togglebutton')
37 |
38 | class ToggleButton:
39 | def __init__(self,controlObj):
40 | ''' Initialise a Toggle Button element from a dictionary'''
41 | self.id = controlObj['id']
42 | self.builder = controlObj['builder']
43 | self.ui = controlObj['builder'].get_object(controlObj['id'])
44 | self.schema = controlObj['schema']
45 | self.path = controlObj['path']
46 | self.key = controlObj['key']
47 | self.type = controlObj['type']
48 | self.map = controlObj['map']
49 | self.invmap = dict([ (v,k) for (k,v) in self.map.items() ])
50 | self.dependants = controlObj['dependants']
51 | self.active = False
52 | self.disabled = False
53 | try:
54 | assert gsettings.is_valid(
55 | schema=self.schema,
56 | path=self.path,
57 | key=self.key
58 | )
59 | except AssertionError as e:
60 | self.disabled = True
61 | logger.debug('Initialised a toggle button with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
62 |
63 | def register(self,handler):
64 | ''' register handler on a handler object '''
65 | handler['on_%s_toggled'%self.id]=self.handler
66 | logger.debug('Handler for {self.id} registered'.format(self=self))
67 |
68 | def refresh(self):
69 | ''' Refresh UI reading from backend '''
70 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
71 | if self.disabled:
72 | self.ui.set_sensitive(False)
73 | return
74 | self.active=self.map[
75 | gsettings.get(
76 | schema=self.schema,
77 | path =self.path,
78 | key =self.key,
79 | type =self.type
80 | )
81 | ]
82 | self.ui.set_active(self.active)
83 | self.handledependants()
84 |
85 | def handler(self,*args,**kwargs):
86 | ''' handle toggle signals '''
87 | if self.disabled:
88 | return
89 | self.active=self.ui.get_active()
90 | gsettings.set(
91 | schema=self.schema,
92 | path=self.path,
93 | key=self.key,
94 | type=self.type,
95 | value=self.invmap[self.active]
96 | )
97 | self.handledependants()
98 | logger.info('Handler for {self.id} executed'.format(self=self))
99 |
100 | def reset(self):
101 | ''' Reset the controlled key '''
102 | if self.disabled:
103 | return
104 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
105 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
106 |
107 | def handledependants(self):
108 | status=False if self.disabled else self.active
109 | for element in self.dependants:
110 | self.builder.get_object(element).set_sensitive(status)
111 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/treeview.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for Treeview element. '''
33 | from UnityTweakTool.backends import gsettings
34 |
35 | import logging
36 | logger=logging.getLogger('UnityTweakTool.elements.treeview')
37 |
38 | class TreeView:
39 | def __init__(self,controlObj):
40 | ''' Initialise a Treeview element from a dictionary'''
41 | self.id = controlObj['id']
42 | self.ui = controlObj['builder'].get_object(controlObj['id'])
43 | self.schema = controlObj['schema']
44 | self.path = controlObj['path']
45 | self.key = controlObj['key']
46 | self.type = controlObj['type']
47 | self.map = controlObj['map']
48 | self.invmap = dict([ (v,k) for (k,v) in self.map.items() ])
49 | assert gsettings.is_valid(
50 | schema=self.schema,
51 | path=self.path,
52 | key=self.key
53 | )
54 | logger.debug('Initialised a treeview with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
55 |
56 | def register(self,handler):
57 | ''' register handler on a handler object '''
58 | self.treeselection.register(handler)
59 | logger.debug('Handler for {self.id} registered'.format(self=self))
60 |
61 | def refresh(self):
62 | ''' Refresh UI reading from backend '''
63 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
64 | self.ui.set_active(
65 | self.map[
66 | gsettings.get(
67 | schema=self.schema,
68 | path =self.path,
69 | key =self.key,
70 | type =self.type
71 | )
72 | ]
73 | )
74 |
75 | def handler(self,*args,**kwargs):
76 | ''' handle treeselection changed signals '''
77 | logger.info('Handler for {self.id} executed'.format(self=self))
78 |
79 | def reset(self):
80 | ''' Reset the controlled key '''
81 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
82 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
83 |
84 | class TreeSelection:
85 | def __init__(self,controlObj):
86 | self.id=controlObj['id']
87 | logger.debug('Initialised a Treeselection with id {self.id}'.format(self=self))
88 |
89 | def register(self,handler):
90 | handler['on_%s_changed']=self.handler
91 | logger.debug('Handler for {self.id} registered'.format(self=self))
92 |
93 | def handler(self,*args,**kwargs):
94 | ''' handle treeselection changed signals '''
95 | store,iter=self.ui.get_selected()
96 | gsettings.set(
97 | schema=self.schema,
98 | path=self.path,
99 | key=self.key,
100 | type=self.type,
101 | value=self.invmap[self.ui.get_active()]
102 | )
103 | logger.info('Handler for {self.id} executed'.format(self=self))
104 |
105 | def reset(self):
106 | ''' Reset the controlled key '''
107 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
108 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
109 |
--------------------------------------------------------------------------------
/data/media/scalable/unity-tweak-tool-unity-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
100 |
--------------------------------------------------------------------------------
/UnityTweakTool/elements/colorchooser.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | ''' Definitions for ColorChooser element. '''
33 | from UnityTweakTool.backends import gsettings
34 | from gi.repository import Gdk
35 |
36 | import logging
37 | logger=logging.getLogger('UnityTweakTool.elements.colorchooser')
38 |
39 | class ColorChooser:
40 | def __init__(self,controlObj):
41 | ''' Initialise a ColorChooser element from a dictionary'''
42 | self.id = controlObj['id']
43 | self.ui = controlObj['builder'].get_object(controlObj['id'])
44 | self.schema = controlObj['schema']
45 | self.path = controlObj['path']
46 | self.key = controlObj['key']
47 | self.type = 'string'
48 | self.disabled = False
49 | try:
50 | assert gsettings.is_valid(
51 | schema=self.schema,
52 | path=self.path,
53 | key=self.key
54 | )
55 | except AssertionError as e:
56 | self.disabled = True
57 | self.color=Gdk.RGBA()
58 | logger.debug('Initialised a colorchooser with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
59 |
60 | def register(self,handler):
61 | ''' register handler on a handler object '''
62 | handler['on_%s_color_set'%self.id]=self.handler
63 | logger.debug('Handler for {self.id} registered'.format(self=self))
64 |
65 | def refresh(self):
66 | ''' Refresh UI reading from backend '''
67 | logger.debug('Refreshing UI display for {self.id}'.format(self=self))
68 | if self.disabled:
69 | self.ui.set_sensitive(False)
70 | return
71 | color = gsettings.get(
72 | schema=self.schema,
73 | path =self.path,
74 | key =self.key,
75 | type =self.type
76 | )
77 | components =(
78 | int(color[1:3],16),
79 | int(color[3:5],16),
80 | int(color[5:7],16),
81 | int(color[7:9],16)/255
82 | )
83 | colorspec='rgba(%s,%s,%s,%f)'%components
84 | valid = Gdk.RGBA.parse(self.color,colorspec)
85 | if valid:
86 | self.ui.set_rgba(self.color)
87 |
88 | def get_color(self):
89 | logger.debug('Getting color for {self.id}'.format(self=self))
90 | # This try catch is a fix for LP 1165627
91 | try:
92 | self.color = self.ui.get_rgba()
93 | except TypeError:
94 | self.ui.get_rgba(self.color)
95 | return '#{:02x}{:02x}{:02x}{:02x}'.format(*[round(x*255) for x in [self.color.red, self.color.green, self.color.blue, self.color.alpha]])
96 |
97 | def handler(self,*args,**kwargs):
98 | ''' handle toggle signals '''
99 | if self.disabled:
100 | return
101 | gsettings.set(
102 | schema=self.schema,
103 | path=self.path,
104 | key=self.key,
105 | type=self.type,
106 | value=self.get_color()
107 | )
108 | logger.info('Handler for {self.id} executed'.format(self=self))
109 |
110 | def reset(self):
111 | ''' Reset the controlled key '''
112 | if self.disabled:
113 | return
114 | gsettings.reset(schema=self.schema,path=self.path,key=self.key)
115 | logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
116 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/overview.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | from UnityTweakTool.section.skeletonpage import Section,Tab,Gtk
33 | from UnityTweakTool.elements.button import OverviewButton
34 |
35 | class Overview(Tab,Section):
36 | def __init__(self,notebook):
37 | Section.__init__(self,ui='overview.ui',id='box_overview')
38 | self.sections={
39 | 1:{ 0:'b_unity-launcher',
40 | 1:'b_unity-search',
41 | 2:'b_unity-panel',
42 | 3:'b_unity-switcher',
43 | 4:'b_unity-additional'},
44 | 2:{ 0:'b_wm-general',
45 | 1:'b_wm-workspaces',
46 | 2:'b_wm-window-spread',
47 | 3:'b_wm-window-snapping',
48 | 4:'b_wm-hotcorners',
49 | 5:'b_wm-additional'},
50 | 3:{ 0:'b_appearance-theme',
51 | 1:'b_appearance-icons',
52 | 2:'b_appearance-cursors',
53 | 3:'b_appearance-fonts'},
54 | 4:{ 0:'b_system-desktop-icons',
55 | 1:'b_system-security',
56 | 2:'b_system-scrolling'}
57 | }
58 |
59 | Tab.__init__(self,[OverviewButton(
60 | section=section,page=page,id=id,notebook=notebook)
61 | for section,set in self.sections.items()
62 | for page,id in set.items()
63 | ]
64 | )
65 |
66 | self.register_tab(self.handler)
67 | self.register()
68 |
69 | # Symbolic icons
70 | self.icons = Gtk.IconTheme.get_default()
71 | self.style_context = self.builder.get_object('overview_window').get_style_context()
72 | self.style_context.connect('changed', self.on_style_context_change)
73 |
74 | def on_style_context_change(self, *args):
75 | try:
76 | self.symbolic_color = self.style_context.get_color(Gtk.StateFlags.ACTIVE)
77 |
78 | appearance_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-appearance-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
79 | if appearance_symbolic_icon:
80 | appearance_symbolic_icon_pixbuf, was_sym = appearance_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
81 | self.builder.get_object('i_appearance-title').set_from_pixbuf(appearance_symbolic_icon_pixbuf)
82 |
83 | unity_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-unity-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
84 | if unity_symbolic_icon:
85 | unity_symbolic_icon_pixbuf, was_sym = unity_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
86 | self.builder.get_object('i_unity-title').set_from_pixbuf(unity_symbolic_icon_pixbuf)
87 |
88 | system_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-system-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
89 | if system_symbolic_icon:
90 | system_symbolic_icon_pixbuf, was_sym = system_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
91 | self.builder.get_object('i_system-title').set_from_pixbuf(system_symbolic_icon_pixbuf)
92 |
93 | wm_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-wm-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
94 | if wm_symbolic_icon:
95 | wm_symbolic_icon_pixbuf, was_sym = wm_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
96 | self.builder.get_object('i_wm-title').set_from_pixbuf(wm_symbolic_icon_pixbuf)
97 | except Exception:
98 | pass
99 | # XXX : Temporary fix to prevent random attributeerrors.
100 |
101 |
--------------------------------------------------------------------------------
/data/media/scalable/unity-tweak-tool-system-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
103 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/spaghetti/gsettings.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | import sys,os
33 | from gi.repository import Gio, Gdk,Gtk
34 | import UnityTweakTool.config.data as data
35 | import UnityTweakTool.section.dynamic as dynamic
36 |
37 |
38 | def test_schema(schema):
39 | if schema in Gio.Settings.list_relocatable_schemas():
40 | pass
41 | elif schema in Gio.Settings.list_schemas():
42 | pass
43 | else:
44 | print("Error: schema %s not installed" % schema)
45 | builder=Gtk.Builder()
46 | builder.set_translation_domain('unity-tweak-tool')
47 | ui = os.path.join(data.get_data_path(),'errordialog.ui')
48 | builder.add_from_file(ui)
49 | dialog = builder.get_object('errordialog')
50 | message = schema + "\n\nIn order to work properly, Unity Tweak Tool recommends you install the necessary packages"
51 | dialog.format_secondary_text(message)
52 | dialog.run()
53 | sys.exit()
54 |
55 | def test_key(schema, key):
56 | if key in schema.list_keys():
57 | return True
58 | else:
59 | return False
60 |
61 | def plugin(plugin):
62 | schema = 'org.compiz.'+plugin
63 | path = '/org/compiz/profiles/unity/plugins/'+plugin+'/'
64 | test_schema(schema)
65 | return Gio.Settings(schema = schema, path = path)
66 |
67 | def unity(child = None):
68 | schema = 'com.canonical.Unity'
69 | schema = schema+'.'+child if child else schema
70 | test_schema(schema)
71 | return Gio.Settings(schema)
72 |
73 | def canonical(child):
74 | schema = 'com.canonical.'+child
75 | test_schema(schema)
76 | return Gio.Settings(schema)
77 |
78 | def compiz(child):
79 | schema = 'org.compiz.'+child
80 | test_schema(schema)
81 | return Gio.Settings(schema)
82 |
83 | def gnome(child):
84 | schema = 'org.gnome.'+child
85 | test_schema(schema)
86 | return Gio.Settings(schema)
87 |
88 | def color_to_hash(c,alpha=1):
89 | """Convert a Gdk.Color or Gdk.RGBA object to hex representation, overriding the alpha if asked"""
90 | if isinstance(c, Gdk.Color):
91 | return "#{:02x}{:02x}{:02x}{:02x}".format(*[round(x*255) for x in [c.red_float, c.green_float, c.blue_float,alpha]])
92 | if isinstance(x, Gdk.RGBA):
93 | return "#{:02x}{:02x}{:02x}{:02x}".format(*[round(x*255) for x in [c.red, c.green, c.blue, alpha]])
94 | # If it is neither a Gdk.Color object nor a Gdk.RGBA object,
95 | raise NotImplementedError
96 |
97 | # GSettings objects go here
98 |
99 | # Sorted by function type and alphabetical order
100 |
101 | bluetooth = canonical('indicator.bluetooth')
102 | datetime = canonical('indicator.datetime')
103 | hud = canonical('indicator.appmenu.hud')
104 | power = canonical('indicator.power')
105 | notifyosd = canonical('notify-osd')
106 | session = canonical('indicator.session')
107 | sound = canonical('indicator.sound')
108 |
109 | antialiasing = gnome('settings-daemon.plugins.xsettings')
110 | background = gnome('desktop.background')
111 | desktop = gnome('nautilus.desktop')
112 | interface = gnome('desktop.interface')
113 | lockdown = gnome('desktop.lockdown')
114 | wm = gnome('desktop.wm.preferences')
115 | touch = gnome(dynamic.touchpad_schema + '.peripherals.touchpad')
116 |
117 | animation = plugin('animation')
118 | core = plugin('core')
119 | expo = plugin('expo')
120 | grid = plugin('grid')
121 | move = plugin('move')
122 | opengl = plugin('opengl')
123 | resize = plugin('resize')
124 | scale = plugin('scale')
125 | unityshell = plugin('unityshell')
126 | zoom = plugin('ezoom')
127 |
128 | launcher = unity('Launcher')
129 | lenses = unity('Lenses')
130 | lens_apps = unity('ApplicationsLens')
131 | lens_files = unity('FilesLens')
132 | runner = unity('Runner')
133 |
--------------------------------------------------------------------------------
/UnityTweakTool/backends/gsettings.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 | '''This file contains the bindings to Gio.Settings'''
33 | from gi.repository import Gio
34 | import logging
35 |
36 | logger=logging.getLogger('UnityTweakTool.backends.gsettings')
37 |
38 | all_schemas = frozenset(
39 | Gio.Settings.list_schemas()
40 | )
41 | all_relocatable_schemas = frozenset(
42 | Gio.Settings.list_relocatable_schemas()
43 | )
44 |
45 | GSettings = dict()
46 |
47 |
48 | def is_valid(*,schema,path=None,key=None):
49 | '''
50 | Check if the given schema,path,key,type combination is valid. All arguments are keyword-only. path is used to instantiate Gio.Settings only if schema is relocatable. Relocatable schemas are expected to be accompanied by path.
51 | '''
52 | logger.debug('Checking if schema %s with path %s has key %s',schema,path,key)
53 | if schema in all_schemas:
54 | logger.debug('Ignoring path for static schema')
55 | if key is not None:
56 | try:
57 | _gs=GSettings[schema]
58 | except KeyError as e:
59 | _gs=Gio.Settings(schema)
60 | return key in _gs.list_keys()
61 | else:
62 | return True
63 | if schema in all_relocatable_schemas:
64 | if key is not None:
65 | assert path is not None, 'Relocatable schemas must be accompanied with path'
66 | try:
67 | _gs=GSettings[schema]
68 | except KeyError as e:
69 | _gs=Gio.Settings(schema,path)
70 | return key in _gs.list_keys()
71 | else:
72 | return True
73 |
74 | # get_ and set_ are available for the following in Gio.Settings
75 | VALID_TYPES=frozenset([
76 | 'boolean',
77 | 'int',
78 | 'uint',
79 | 'double',
80 | 'string',
81 | 'strv',
82 | 'enum',
83 | 'flags'
84 | ])
85 |
86 | def get(*,schema,key,type,path=None):
87 | '''
88 | Getter that calls appropriate function on Gio.Settings depending on type. The schema,path,key,type combination is expected to be valid. Uses cache wherever possible.
89 | '''
90 | logger.debug('Attempting to get key %s of type %s from schema %s with path %s',key,type,schema,path)
91 | _gskey=schema+(':'+path if path is not None else '')
92 | try:
93 | _gs=GSettings[_gskey]
94 | logger.debug('Using cached Settings object for %s',_gskey)
95 | except KeyError as e:
96 | logger.debug('Cache miss for Settings object %s',_gskey)
97 | _gs=Gio.Settings(schema,path)
98 | GSettings[_gskey]=_gs
99 | return _gs.__getattribute__('get_'+type)(key)
100 |
101 | def set(*,schema,key,type,path=None,value):
102 | '''
103 | Setter that calls appropriate function on Gio.Settings depending on the type. The schema,path,key,type combination is expected to be valid, and the value must be of the proper type. Uses cache wherever possible.
104 | '''
105 | logger.debug('Attempting to set key %s of type %s from schema %s with path %s to value %s',key,type,schema,path,value)
106 | _gskey=schema+(':'+path if path is not None else '')
107 | try:
108 | _gs=GSettings[_gskey]
109 | logger.debug('Using cached Settings object for %s',_gskey)
110 | except KeyError as e:
111 | logger.debug('Cache miss for Settings object %s',_gskey)
112 | _gs=Gio.Settings(schema,path)
113 | GSettings[_gskey]=_gs
114 | # TODO : check if value is legal, if possible.
115 | return _gs.__getattribute__('set_'+type)(key,value)
116 |
117 | def reset(*,schema,key,path=None):
118 | ''' Reset the given key. schema,path,key combination is expected to be valid. '''
119 | logger.debug('Attempting to reset key %s from schema %s with path %s',key,schema,path)
120 | _gskey=schema+(':'+path if path is not None else '')
121 | try:
122 | _gs=GSettings[_gskey]
123 | logger.debug('Using cached Settings object for %s',_gskey)
124 | except KeyError as e:
125 | logger.debug('Cache miss for Settings object %s',_gskey)
126 | _gs=Gio.Settings(schema,path)
127 | GSettings[_gskey]=_gs
128 | _gs.reset(key)
129 |
130 |
--------------------------------------------------------------------------------
/UnityTweakTool/section/appearance.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Team:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | # Georgi Karavasilev
9 | # Sam Tran
10 | # Sam Hewitt
11 | # Angel Araya
12 | #
13 | # Description:
14 | # A One-stop configuration tool for Unity.
15 | #
16 | # Legal Stuff:
17 | #
18 | # This file is a part of Unity Tweak Tool
19 | #
20 | # Unity Tweak Tool is free software; you can redistribute it and/or modify it under
21 | # the terms of the GNU General Public License as published by the Free Software
22 | # Foundation; version 3.
23 | #
24 | # Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
25 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
26 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
27 | # details.
28 | #
29 | # You should have received a copy of the GNU General Public License along with
30 | # this program; if not, see
31 |
32 |
33 | from UnityTweakTool.section.skeletonpage import Section,Tab
34 | from UnityTweakTool.elements.fontbutton import FontButton
35 | from UnityTweakTool.elements.cbox import ComboBox
36 | from UnityTweakTool.elements.spin import SpinButton
37 | from UnityTweakTool.elements.radio import Radio
38 | from UnityTweakTool.elements.checkbox import CheckBox
39 | from UnityTweakTool.section.spaghetti.theme import Themesettings as SpaghettiThemeSettings
40 | from UnityTweakTool.elements.option import Option,HandlerObject
41 |
42 | from collections import defaultdict
43 |
44 | Appearance =Section(ui='appearance.ui',id='nb_themesettings')
45 |
46 | #=============== THEME ==========================
47 |
48 | #=============== ICONS ==========================
49 |
50 | #=============== CURSOR =========================
51 |
52 | #=============== FONTS ==========================
53 |
54 | font_default= FontButton({
55 | 'id' : 'font_default',
56 | 'builder' : Appearance.builder,
57 | 'schema' : 'org.gnome.desktop.interface',
58 | 'path' : None,
59 | 'key' : 'font-name',
60 | 'type' : 'string'
61 | })
62 |
63 | font_document= FontButton({
64 | 'id' : 'font_document',
65 | 'builder' : Appearance.builder,
66 | 'schema' : 'org.gnome.desktop.interface',
67 | 'path' : None,
68 | 'key' : 'document-font-name',
69 | 'type' : 'string'
70 | })
71 |
72 | font_monospace= FontButton({
73 | 'id' : 'font_monospace',
74 | 'builder' : Appearance.builder,
75 | 'schema' : 'org.gnome.desktop.interface',
76 | 'path' : None,
77 | 'key' : 'monospace-font-name',
78 | 'type' : 'string'
79 | })
80 |
81 | font_window_title= FontButton({
82 | 'id' : 'font_window_title',
83 | 'builder' : Appearance.builder,
84 | 'schema' : 'org.gnome.desktop.wm.preferences',
85 | 'path' : None,
86 | 'key' : 'titlebar-font',
87 | 'type' : 'string'
88 | })
89 |
90 | cbox_antialiasing=ComboBox({
91 | 'id' : 'cbox_antialiasing',
92 | 'builder' : Appearance.builder,
93 | 'schema' : 'org.gnome.settings-daemon.plugins.xsettings',
94 | 'path' : None,
95 | 'key' : 'antialiasing',
96 | 'type' : 'string',
97 | 'map' : {'none':0,'grayscale':1,'rgba':2}
98 | })
99 |
100 | cbox_hinting=ComboBox({
101 | 'id' : 'cbox_hinting',
102 | 'builder' : Appearance.builder,
103 | 'schema' : 'org.gnome.settings-daemon.plugins.xsettings',
104 | 'path' : None,
105 | 'key' : 'hinting',
106 | 'type' : 'string',
107 | 'map' : {'none':0,'slight':1,'medium':2,'full':3}
108 | })
109 |
110 | spin_textscaling=SpinButton({
111 | 'id' : 'spin_textscaling',
112 | 'builder': Appearance.builder,
113 | 'schema' : 'org.gnome.desktop.interface',
114 | 'path' : None,
115 | 'key' : 'text-scaling-factor',
116 | 'type' : 'double',
117 | 'min' : 0.50,
118 | 'max' : 3.00
119 | })
120 |
121 | Fonts=Tab([font_default,
122 | font_document,
123 | font_monospace,
124 | font_window_title,
125 | cbox_antialiasing,
126 | cbox_hinting,
127 | spin_textscaling])
128 |
129 | #========== WINDOW CONTROLS =====================
130 |
131 | radio_left=Radio({
132 | 'id' : 'radio_left',
133 | 'builder' : Appearance.builder,
134 | 'schema' : 'org.gnome.desktop.wm.preferences',
135 | 'path' : None,
136 | 'key' : 'button-layout',
137 | 'type' : 'string',
138 | 'group' : 'radio_left',
139 | 'value' : 'close,minimize,maximize:',
140 | 'dependants': []
141 | })
142 |
143 | radio_right=Radio({
144 | 'id' : 'radio_right',
145 | 'builder' : Appearance.builder,
146 | 'schema' : 'org.gnome.desktop.wm.preferences',
147 | 'path' : None,
148 | 'key' : 'button-layout',
149 | 'type' : 'string',
150 | 'group' : 'radio_right',
151 | 'value' : ':minimize,maximize,close',
152 | 'dependants': []
153 | })
154 |
155 |
156 | WindowControls=Tab([radio_left,
157 | radio_right])
158 |
159 | # Pass in the id of restore defaults button to enable it.
160 | Fonts.enable_restore('b_theme_font_reset')
161 | WindowControls.enable_restore('b_window_control_reset')
162 |
163 | # Each page must be added using add_page
164 | Appearance.add_page(Fonts)
165 | # XXX : Disabled since the implementation is inadequate
166 | # Appearance.add_page(WindowControls)
167 |
168 | themesettings=HandlerObject(SpaghettiThemeSettings(Appearance.builder))
169 | Appearance.add_page(themesettings)
170 |
171 | # After all pages are added, the section needs to be registered to start listening for events
172 | Appearance.register()
173 |
--------------------------------------------------------------------------------
/UnityTweakTool/utils/unityreset.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # Authors:
5 | # J Phani Mahesh
6 | # Barneedhar (jokerdino)
7 | # Amith KK
8 | #
9 | # Description:
10 | # Python wrapper to reset unity.
11 | # Born at http://chat.stackexchange.com/rooms/6118/unity-reconfiguration
12 | #
13 | # Legal Stuff:
14 | #
15 | # This program is free software; you can redistribute it and/or modify it under
16 | # the terms of the GNU General Public License as published by the Free Software
17 | # Foundation; version 3.
18 | #
19 | # This program is distributed in the hope that it will be useful, but WITHOUTa
20 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 | # details.
23 | #
24 | # You should have received a copy of the GNU General Public License along with
25 | # this program; if not, write to the Free Software Foundation, Inc.,
26 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 |
28 | import subprocess
29 | from gi.repository import Gio
30 | import re
31 |
32 | import gettext
33 | gettext.bindtextdomain('unity-tweak-tool')
34 | _=gettext.gettext
35 |
36 | class UnityReset():
37 | allSchemas=Gio.Settings.list_schemas()
38 | allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
39 |
40 | def __init__(self,refresh=True):
41 | print(_("Initialising Unity reset"))
42 | print(_("Killing Unity and Compiz"))
43 | subprocess.call(["killall","unity-panel-service"])
44 | subprocess.call(["pkill","-9","compiz"])
45 | print(_("Resetting compiz plugins"))
46 | self.resetPlugins()
47 | print(_("Resetting more compiz plugins"))
48 | self.resetCompizChildren()
49 | print(_("Resetting Unity settings"))
50 | self.resetUnityChildren()
51 | print(_("Reset complete. Reloading unity"))
52 | if refresh:
53 | subprocess.call("unity")
54 |
55 | def resetAllKeys(self,schema,path=None,check=False):
56 | """Reset all keys in given Schema."""
57 | if check and (schema not in self.allSchemas) and (schema not in self.allRelocatableSchemas):
58 | print("Ignoring missing Schema %s"%schema)
59 | return
60 | gsettings=Gio.Settings(schema=schema,path=path)
61 | for key in gsettings.list_keys():
62 | gsettings.reset(key)
63 | if gsettings.get_has_unapplied():
64 | gsettings.apply()
65 | #gsettings.sync()
66 | print("Schema %s successfully reset"%schema)
67 |
68 | def resetPlugins(self):
69 | """Reset Compiz Plugins"""
70 | compizPluginRe=re.compile(r'(?Porg.compiz.)')
71 | for schema in self.allRelocatableSchemas:
72 | if compizPluginRe.match(schema):
73 | plugin=compizPluginRe.sub('',schema)
74 | path="/org/compiz/profiles/unity/plugins/"+plugin+"/"
75 | self.resetAllKeys(schema=schema,path=path)
76 |
77 | def resetCompizChildren(self):
78 | """Reset keys in non-relocatable schemas of Compiz"""
79 | compizSchema='org.compiz'
80 | compizChildRe=re.compile(compizSchema)
81 | for schema in self.allSchemas:
82 | if compizChildRe.match(schema):
83 | self.resetAllKeys(schema)
84 |
85 | def resetUnityChildren(self):
86 | """Reset keys in child schemas of Unity"""
87 | unitySchema='com.canonical.Unity'
88 | blacklists=['com.canonical.Unity.Launcher','com.canonical.Unity.webapps','com.canonical.Unity.Lenses']
89 | unityChildRe=re.compile(unitySchema)
90 | for schema in self.allSchemas:
91 | if (schema not in blacklists) and (unityChildRe.match(schema)):
92 | self.resetAllKeys(schema)
93 |
94 | @staticmethod
95 | def getAllKeys(schema,path=None,check=False):
96 | """Snapshot current settings in a given schema"""
97 | if check and (schema not in UnityReset.allSchemas) and (schema not in UnityReset.allRelocatableSchemas):
98 | print("Ignoring missing Schema %s"%schema)
99 | return
100 | snapshot=dict()
101 | gsettings=Gio.Settings(schema=schema,path=path)
102 | for key in gsettings.list_keys():
103 | snapshot[key]=gsettings.get_value(key)
104 | return snapshot
105 |
106 | @staticmethod
107 | def snapshotCompizPlugins():
108 | """Snapshot compiz plugins"""
109 | snapshot=dict()
110 | compizPluginRe=re.compile(r'(?Porg.compiz.)')
111 | for schema in UnityReset.allRelocatableSchemas:
112 | if compizPluginRe.match(schema):
113 | plugin=compizPluginRe.sub('',schema)
114 | schema='org.compiz.'+plugin
115 | path="/org/compiz/profiles/unity/plugins/"+plugin+"/"
116 | snapshot[schema]=UnityReset.getAllKeys(schema=schema,path=path)
117 | return snapshot
118 |
119 | @staticmethod
120 | def snapshotCompizChildren():
121 | """Snapshot keys in child schemas of Compiz"""
122 | snapshot=dict()
123 | compizSchema='org.compiz'
124 | compizChildRe=re.compile(compizSchema)
125 | for schema in UnityReset.allSchemas:
126 | if compizChildRe.match(schema):
127 | snapshot[schema]=UnityReset.getAllKeys(schema)
128 | return snapshot
129 |
130 |
131 | @staticmethod
132 | def snapshotUnityChildren():
133 | """Snapshot keys in child schemas of Unity"""
134 | snapshot=dict()
135 | unitySchema='com.canonical.Unity'
136 | blacklists=['com.canonical.Unity.Launcher','com.canonical.Unity.webapps','com.canonical.Unity.Lenses']
137 | unityChildRe=re.compile(unitySchema)
138 | for schema in UnityReset.allSchemas:
139 | if (schema not in blacklists) and (unityChildRe.match(schema)):
140 | snapshot[schema]=UnityReset.getAllKeys(schema)
141 | return snapshot
142 |
143 |
144 | if __name__=='__main__':
145 | UnityReset()
146 |
147 |
--------------------------------------------------------------------------------
/data/media/scalable/unity-tweak-tool-overview-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
122 |
--------------------------------------------------------------------------------
/debian/changelog:
--------------------------------------------------------------------------------
1 | unity-tweak-tool (0.0.7ubuntu4) artful; urgency=medium
2 |
3 | * Actually remove unity-webapps-common from the deps.
4 |
5 | -- Steve Langasek Thu, 24 Aug 2017 14:15:21 -0700
6 |
7 | unity-tweak-tool (0.0.7ubuntu3) artful; urgency=medium
8 |
9 | * Drop unity-webapps-common, which is being removed from artful.
10 | LP: #1712874.
11 |
12 | -- Steve Langasek Thu, 24 Aug 2017 11:29:43 -0700
13 |
14 | unity-tweak-tool (0.0.7ubuntu2) xenial; urgency=medium
15 |
16 | * po/fi.po: Update to latest from Launchpad as requested by
17 | Jiri Grönroos.
18 |
19 | -- Timo Jyrinki Tue, 12 Apr 2016 15:52:54 +0300
20 |
21 | unity-tweak-tool (0.0.7ubuntu1) xenial; urgency=low
22 |
23 | * Release 0.0.7 to Ubuntu. (LP: #1562049)
24 |
25 | -- Freyja Development Mon, 28 Mar 2016 04:36:38 +0000
26 |
27 | unity-tweak-tool (0.0.7) xenial; urgency=medium
28 |
29 | [ Andrew Starr-Bochicchio ]
30 | * debian/rules: Some minor style tweaks.
31 | * debian/control:
32 | - Bump Standards-Version to 3.9.5
33 | - Build depend on python3-all to fix FTBFS (LP: #1282274).
34 | [ J Phani Mahesh]
35 | * New upstream release
36 | - Update Translations from Launchpad
37 | * UnityTweakTool/section/spaghetti/compiz.py:
38 | - Fix crash on start (LP: #1281132).
39 |
40 | [ Barneedhar Vigneshwar]
41 | * UnityTweakTool/section/system.py
42 | - Fixed missing schema- org.gnome.settings-daemon.peripherals (LP: #1490154)
43 |
44 | [ Seth Johnson ]
45 | * UnityTweakTool/section/unity.py
46 | - Added support for moving the launcher to the bottom of the screen
47 | * UnityTweakTool/section/windowmanager.py
48 | - Add raise on click feature
49 | * Rebuilt pot files
50 | * setup.py
51 | - Fix missing header icons (LP: 1467211)
52 | * New upstream release (closes LP: #1562049)
53 |
54 | -- Seth Johnson Sun, 27 Mar 2016 21:22:06 -0700
55 |
56 | unity-tweak-tool (0.0.6ubuntu3) wily; urgency=medium
57 |
58 | * Fix the schema used for touchpad settings to match the current GNOME
59 | as present in Ubuntu 15.10. LP: #1490154.
60 |
61 | -- Steve Langasek Thu, 17 Sep 2015 14:55:21 -0700
62 |
63 | unity-tweak-tool (0.0.6ubuntu2) utopic; urgency=medium
64 |
65 | * Backport upstream commit adding support for minimizing
66 | single window applications when clicking their icon on
67 | the launcher (LP: #1298487).
68 |
69 | -- Andrew Starr-Bochicchio Thu, 27 Mar 2014 12:39:22 -0400
70 |
71 | unity-tweak-tool (0.0.6ubuntu1) trusty; urgency=medium
72 |
73 | * debian/patches/lp1281132.patch: Backport upstream commit
74 | that fixes crash (LP: #1281132). This patch is applied
75 | directly since this is a native package, but a copy was
76 | kept in debian/ to be clear about what has been applied.
77 | * debian/rules: Some minor style tweaks.
78 | * debian/control:
79 | - Bump Standards-Version to 3.9.5
80 | - Build depend on python3-all to fix FTBFS (LP: #1282274).
81 |
82 | -- Andrew Starr-Bochicchio Thu, 20 Feb 2014 23:41:09 -0500
83 |
84 | unity-tweak-tool (0.0.6) saucy; urgency=high
85 |
86 | [ Barneedhar Vigneshwar]
87 | * New upstream bug-fix only release (LP: #1235752)
88 | - Trigger new build of pot files
89 | * UnityTweakTool/section/spaghetti/unity.py
90 | - unity-tweak-tool crashed with signal 5 in g_settings_get_value() (LP: #1235432)
91 |
92 | [ J Phani Mahesh]
93 | * UnityTweakTool/__init__.py
94 | - Fix NameError: name '_formatter' is not defined (LP: #1232515)
95 |
96 | -- Barneedhar Vigneshwar Sat, 05 Oct 2013 22:45:24 +0530
97 |
98 | unity-tweak-tool (0.0.5) saucy; urgency=low
99 |
100 | [ J Phani Mahesh ]
101 | * New upstream release (LP: #1226059)
102 | - New application icon
103 | - Show error dialog when schemas are missing instead of crashing
104 | - Trigger new build of pot files
105 | * UnityTweakTool/section/unity.py
106 | - Fix Show recently used and more suggestions in dash search (LP: #1166294)
107 | - Fix Launcher reveal sensitivity scale update issues (LP: #1168863)
108 | * UnityTweakTool/elements/colorchooser.py
109 | - Fix TypeError in get_rgba() (LP: #1165627)
110 | - Fix segmentation fault on selecting custom launcher (LP: #1190398)
111 | * UnityTweakTool/elements/option.py
112 | - Fix "Restore defaults" button (LP: #1186634)
113 | * UnityTweakTool/__init__.py
114 | - Fix unity-tweak-tool crashed with dbus.exceptions.DBusException in
115 | call_blocking() (LP: #1168738)
116 | - Fix FileNotFoundError (LP: #1225463)
117 | - Fix dbus.exceptions.DBusException (LP: #1170571)
118 | * data/unity.ui
119 | - Remove Panel transparency switch (LP: #1168836)
120 | - Remove Launcher transparency switch (LP: #1168834)
121 |
122 | [ Barneedhar Vigneshwar ]
123 | * UnityTweakTool/section/unity.py
124 | - Fix 'Can't set background blur to static' (LP: #1167343)
125 | - Fix non-working Launcher only on primary desktop (LP: #1173977)
126 | * UnityTweakTool/section/sphagetti/compiz.py
127 | - Fix TypeError in color_to_hash() (LP: #1166884)
128 |
129 | -- Barneedhar Vigneshwar