[gnome-tweak-tool] Find a theme from XDG base directory spec
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Find a theme from XDG base directory spec
- Date: Sat, 10 Nov 2012 09:25:39 +0000 (UTC)
commit 0e971fc1c5c0fa785524e4f64afc20c852e576bc
Author: Jihyun Cho <jihyun jo gmail com>
Date: Fri Nov 9 17:08:07 2012 +0900
Find a theme from XDG base directory spec
https://bugzilla.gnome.org/show_bug.cgi?id=688028
gtweak/tweaks/tweak_interface.py | 5 +++++
gtweak/tweaks/tweak_windows.py | 3 +++
2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_interface.py b/gtweak/tweaks/tweak_interface.py
index 65d197b..b20a41c 100644
--- a/gtweak/tweaks/tweak_interface.py
+++ b/gtweak/tweaks/tweak_interface.py
@@ -18,6 +18,7 @@
import os.path
from gi.repository import Gtk
+from gi.repository import GLib
import gtweak
from gtweak.utils import walk_directories, make_combo_list_with_default
@@ -35,6 +36,7 @@ class GtkThemeSwitcher(GSettingsComboTweak):
def _get_valid_themes(self):
""" Only shows themes that have variations for gtk+-3 and gtk+-2 """
dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
+ os.path.join(GLib.get_user_data_dir(), "themes"),
os.path.join(os.path.expanduser("~"), ".themes"))
valid = walk_directories(dirs, lambda d:
os.path.exists(os.path.join(d, "gtk-2.0")) and \
@@ -51,6 +53,7 @@ class IconThemeSwitcher(GSettingsComboTweak):
def _get_valid_icon_themes(self):
dirs = ( os.path.join(gtweak.DATA_DIR, "icons"),
+ os.path.join(GLib.get_user_data_dir(), "icons"),
os.path.join(os.path.expanduser("~"), ".icons"))
valid = walk_directories(dirs, lambda d:
os.path.isdir(d) and \
@@ -67,6 +70,7 @@ class CursorThemeSwitcher(GSettingsComboTweak):
def _get_valid_cursor_themes(self):
dirs = ( os.path.join(gtweak.DATA_DIR, "icons"),
+ os.path.join(GLib.get_user_data_dir(), "icons"),
os.path.join(os.path.expanduser("~"), ".icons"))
valid = walk_directories(dirs, lambda d:
os.path.isdir(d) and \
@@ -86,6 +90,7 @@ class KeyThemeSwitcher(GSettingsComboTweak):
def _get_valid_key_themes(self):
dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
+ os.path.join(GLib.get_user_data_dir(), "themes"),
os.path.join(os.path.expanduser("~"), ".themes"))
valid = walk_directories(dirs, lambda d:
os.path.isfile(os.path.join(d, "gtk-3.0", "gtk-keys.css")) and \
diff --git a/gtweak/tweaks/tweak_windows.py b/gtweak/tweaks/tweak_windows.py
index ad9397e..feb6f79 100644
--- a/gtweak/tweaks/tweak_windows.py
+++ b/gtweak/tweaks/tweak_windows.py
@@ -17,6 +17,8 @@
import os.path
+from gi.repository import GLib
+
import gtweak
from gtweak.utils import walk_directories, make_combo_list_with_default
from gtweak.tweakmodel import TWEAK_GROUP_WINDOWS, TWEAK_GROUP_THEME
@@ -32,6 +34,7 @@ class WindowThemeSwitcher(GSettingsComboTweak):
def _get_valid_themes(self):
dirs = ( os.path.join(gtweak.DATA_DIR, "themes"),
+ os.path.join(GLib.get_user_data_dir(), "themes"),
os.path.join(os.path.expanduser("~"), ".themes"))
valid = walk_directories(dirs, lambda d:
os.path.exists(os.path.join(d, "metacity-1")))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]