A simple tool to enable disable Unity LowGFX mode.
Inspired whist reading this and a blatent copy of this
As i don't have access to the required Unity version this is compleatly untested
#! /usr/bin/python | |
from gi.repository import Gtk, Gio | |
class Example(Gtk.Window): | |
def __init__(self): | |
# Setup the window with title and border width. | |
Gtk.Window.__init__(self, type=Gtk.WindowType.TOPLEVEL, | |
title="Unity LowGFX", | |
resizable=False, | |
border_width=10) | |
# Create and bind the Gtk Switch with the gsettings schema and its key. | |
switch = Gtk.Switch() | |
setting = Gio.Settings.new("com.canonical.Unity") | |
setting.bind("lowgfx", switch, "active", Gio.SettingsBindFlags.DEFAULT) | |
# Create the label for the switch | |
label = Gtk.Label("Use low GFX mode") | |
# Position the Switch and its Label inside a Horizontal child box. | |
box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 40) | |
box.pack_start(label, False, False, 10) | |
box.pack_end(switch, False, False, 10) | |
# Add the child box to the window | |
self.add(box) | |
self.connect("destroy", Gtk.main_quit) | |
self.show_all() | |
Gtk.main() | |
if __name__ == "__main__": | |
Example() |