diff --git a/budgie-welcome b/budgie-welcome index 27cd4c28..a6eff931 100755 --- a/budgie-welcome +++ b/budgie-welcome @@ -415,42 +415,19 @@ class AppView(WebKit2.WebView): code = uri[6:] panelstyle = os.path.expanduser('~') + "/.config/gtk-3.0/gtk.css" - if code == "undo": - theme = localdir + '/style-backup.json' - else: - theme = app._data_path + "/config/" + code + "-style.json" + theme = app._data_path + "/config/" + code + "-style.json" def applyStyle(): with open(theme) as file: config = json.load(file) - # Create backup file if it does not exist - backup = localdir + '/style-backup.json' - if code != "undo" and not os.path.isfile(backup): - data = [] - for item in config: - schema = item["SCHEMA"] - values = item["VALUES"] - - gsettings = Gio.Settings.new(schema) - - coll = {} - vals = {} - - for key in values: - vals[key] = gsettings.get_value(key).unpack() - - coll["SCHEMA"] = schema - coll["VALUES"] = vals - data.append(coll) - - with open(backup, "w") as file: - file.write(json.dumps(data)) - - if os.path.isfile(panelstyle): - shutil.move(panelstyle, localdir + '/gtk.css') - + attrib = None + for item in config: + if "panel-attrib" in item: + attrib = item["panel-attrib"] + continue + schema = item["SCHEMA"] values = item["VALUES"] @@ -462,58 +439,15 @@ class AppView(WebKit2.WebView): else: gsettings.set_string(key, value) - if code == "undo": - # Delete backup file - if os.path.isfile(localdir + '/gtk.css'): - shutil.move(localdir + '/gtk.css', panelstyle) - - os.remove(theme) - - if code == "material": - self._set_panel_key('enable-shadow', False) - self._set_panel_key('size', 37) - - if code == "vertex": - self._set_panel_key('enable-shadow', False) - self._set_panel_key('size', 51) - - if code == "ceti-2": - self._set_panel_key('enable-shadow', False) - self._set_panel_key('size', 40) - - if code == 'material-flat-plat': - self._set_panel_key('size', 47) - - if code == 'evopop': - self._set_panel_key('enable-shadow', False) - self._set_panel_key('size', 39) - - def removepanelstyle(): - # Don't allow theme over writing - try: - os.remove(panelstyle) - except: - pass - - if code == "material-vimix": - self._set_panel_key('enable-shadow', False) - self._set_panel_key('size', 37) - - removepanelstyle() - - if code in ["arc", "pocillo"]: + if attrib: + self._set_panel_key('enable-shadow', attrib['enable-shadow']) + self._set_panel_key('size', attrib['size']) + self._set_panel_key('transparency', attrib['transparency']) + else: + # sane defaults self._set_panel_key('enable-shadow', True) - self._set_panel_key('size', 39) - - removepanelstyle() - - if code == "pop": - self._set_panel_key('enable-shadow', False) self._set_panel_key('size', 37) - - if code == "ant": - self._set_panel_key('enable-shadow', True) - self._set_panel_key('size', 39) + self._set_panel_key('transparency', None) subprocess.Popen(['budgie-panel', '--replace', '&']) diff --git a/data/config/ant-style.json b/data/config/ant-style.json index 36aa4a56..3d750e85 100644 --- a/data/config/ant-style.json +++ b/data/config/ant-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 39, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/arc-style.json b/data/config/arc-style.json index 45280e73..001b3d4f 100644 --- a/data/config/arc-style.json +++ b/data/config/arc-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 39, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/ceti-2-style.json b/data/config/ceti-2-style.json index b6854f66..9b644bb1 100644 --- a/data/config/ceti-2-style.json +++ b/data/config/ceti-2-style.json @@ -1,4 +1,18 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 39, + "transparency": "none" + } + }, + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 40, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/evopop-style.json b/data/config/evopop-style.json index ce008900..154e5dd8 100644 --- a/data/config/evopop-style.json +++ b/data/config/evopop-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": false, + "size" : 39, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/material-materia-style.json b/data/config/material-materia-style.json index 2fe4ff5e..e5002fb5 100644 --- a/data/config/material-materia-style.json +++ b/data/config/material-materia-style.json @@ -1,4 +1,18 @@ [ + { + "panel-attrib" : { + "enable-shadow": false, + "size" : 47, + "transparency": "none" + } + }, + { + "panel-attrib" : { + "enable-shadow": false, + "size" : 37, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/material-materia2-style.json b/data/config/material-materia2-style.json index 2fe4ff5e..4a5c8215 100644 --- a/data/config/material-materia2-style.json +++ b/data/config/material-materia2-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": false, + "size" : 37, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/material-style.json b/data/config/material-style.json index 1f0d81b0..4efc4f5c 100644 --- a/data/config/material-style.json +++ b/data/config/material-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": false, + "size" : 37, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/material-vimix-style.json b/data/config/material-vimix-style.json index cea143dc..e3be6b2c 100644 --- a/data/config/material-vimix-style.json +++ b/data/config/material-vimix-style.json @@ -1,9 +1,16 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 39, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { "cursor-theme": "Paper", - "gtk-theme": "VimixDark", + "gtk-theme": "Vimix", "icon-theme": "Paper", "monospace-font-name": "Noto Mono 11", "font-name": "Noto Sans UI 11", diff --git a/data/config/pocillo-style.json b/data/config/pocillo-style.json index 59d261e5..85034ce5 100644 --- a/data/config/pocillo-style.json +++ b/data/config/pocillo-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 39, + "transparency": "dynamic" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/pop-style.json b/data/config/pop-style.json index 9f56c7ed..8471a56a 100644 --- a/data/config/pop-style.json +++ b/data/config/pop-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 39, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": { diff --git a/data/config/vertex-style.json b/data/config/vertex-style.json index cb4fc2e6..619f76bb 100644 --- a/data/config/vertex-style.json +++ b/data/config/vertex-style.json @@ -1,4 +1,11 @@ [ + { + "panel-attrib" : { + "enable-shadow": true, + "size" : 51, + "transparency": "none" + } + }, { "SCHEMA": "org.gnome.desktop.interface", "VALUES": {