Add support for kwin

This commit is contained in:
Dylan 2016-04-01 14:50:15 +11:00
parent 1ce7a904d1
commit c8e8cf5f99
1 changed files with 31 additions and 10 deletions

View File

@ -822,7 +822,7 @@ getwmtheme () {
'Cinnamon' | 'Muffin')
detheme="$(gsettings get org.cinnamon.theme name)"
wmtheme="$(gsettings get org.cinnamon.desktop.wm.preferences theme)"
wmtheme="${detheme} (${wmtheme})"
wmtheme="$detheme (${wmtheme})"
;;
'Compiz' | 'Mutter'* | 'GNOME Shell' | 'Gala')
@ -873,6 +873,18 @@ getwmtheme () {
wmtheme="$(xfconf-query -c xfwm4 -p /general/theme)"
;;
'KWin'*)
kdeconfigdir
kde_config_dir=${kde_config_dir%/}
if [ -f "$kde_config_dir/share/config/kwinrc" ]; then
wmtheme="$(awk '/PluginLib=kwin3_/{gsub(/PluginLib=kwin3_/,"",$0); print $0; exit}' "$kde_config_dir/share/config/kwinrc")"
elif [ -f "$KDE_CONFIG_DIR/share/config/kdebugrc" ]; then
wmtheme="$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kde_config_dir/share/config/kdebugrc")"
fi
;;
'Quartz Compositor')
wmtheme=$(/usr/libexec/PlistBuddy -c "Print AppleAquaColorVariant" ~/Library/Preferences/.GlobalPreferences.plist)
if [ -z "$wmtheme" ] || [ "$wmtheme" == "1" ]; then
@ -1390,15 +1402,7 @@ getstyle () {
# Current DE
case "$XDG_CURRENT_DESKTOP" in
"KDE"*)
if type -p kde5-config >/dev/null 2>&1; then
kde_config_dir=$(kde5-config --localprefix)
elif type -p kde4-config >/dev/null 2>&1; then
kde_config_dir=$(kde4-config --localprefix)
elif type -p kde-config >/dev/null 2>&1; then
kde_config_dir=$(kde-config --localprefix)
fi
kdeconfigdir
if [ -f "${kde_config_dir}/share/config/kdeglobals" ]; then
kde_config_file="${kde_config_dir}/share/config/kdeglobals"
@ -2552,6 +2556,23 @@ cache () {
# }}}
# KDE Config directory {{{
kdeconfigdir () {
if type -p kde5-config >/dev/null 2>&1; then
kde_config_dir=$(kde5-config --localprefix)
elif type -p kde4-config >/dev/null 2>&1; then
kde_config_dir=$(kde4-config --localprefix)
elif type -p kde-config >/dev/null 2>&1; then
kde_config_dir=$(kde-config --localprefix)
fi
}
# }}}
# }}}