Skip to content

Commit

Permalink
feat: add qt6ct support
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed May 3, 2021
1 parent 45098c9 commit 82d5296
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
37 changes: 23 additions & 14 deletions change_color.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ PATHLIST=(
'Makefile'
'./src/index.theme'
'./src/qt5ct_palette.conf'
'./src/qt6ct_palette.conf'
'./src/cinnamon'
)
if [ -n "${CUSTOM_PATHLIST:-}" ] ; then
Expand All @@ -108,6 +109,8 @@ for FILEPATH in "${PATHLIST[@]}"; do
MAKE_GTK3=1
elif [[ ${FILEPATH} == *qt5ct* ]] ;then
EXPORT_QT5CT=1
elif [[ ${FILEPATH} == *qt6ct* ]] ;then
EXPORT_QT6CT=1
fi
done
MAKE_OPTS="${MAKE_OPTS-all}"
Expand Down Expand Up @@ -157,16 +160,16 @@ ROUNDNESS_GTK2_HIDPI=$(( ROUNDNESS * 2 ))
if [ "$(echo "$GRADIENT < 2" | bc)" ]; then
GTK2_GRAD=$(echo "scale=2; $GRADIENT/2" | bc)
else
GTK2_GRAD=1
GTK2_GRAD=1
fi
GTK2_GRAD_1=$(echo "1+$GTK2_GRAD" | bc)
GTK2_GRAD_2=$(echo "1-$GTK2_GRAD" | bc)
if expr "$GTK2_GRAD_1" : '-\?[0-9]\+$' >/dev/null; then
GTK2_GRAD_TOP="$GTK2_GRAD_1".0
GTK2_GRAD_BOTTOM="$GTK2_GRAD_2".0
GTK2_GRAD_TOP="$GTK2_GRAD_1".0
GTK2_GRAD_BOTTOM="$GTK2_GRAD_2".0
else
GTK2_GRAD_TOP=$GTK2_GRAD_1
GTK2_GRAD_BOTTOM=$GTK2_GRAD_2
GTK2_GRAD_TOP=$GTK2_GRAD_1
GTK2_GRAD_BOTTOM=$GTK2_GRAD_2
fi

OUTLINE_WIDTH=${OUTLINE_WIDTH-1}
Expand Down Expand Up @@ -273,15 +276,6 @@ fi
if [[ ${OPTION_GTK2_HIDPI} == "true" ]] ; then
mv ./gtk-2.0/gtkrc.hidpi ./gtk-2.0/gtkrc
fi
if [[ ${EXPORT_QT5CT} = 1 ]] ; then
config_home=${XDG_CONFIG_HOME:-}
if [[ -z "${config_home}" ]] ; then
config_home="${HOME}/.config"
fi
qt5ct_colors_dir="${config_home}/qt5ct/colors/"
test -d "${qt5ct_colors_dir}" || mkdir -p "${qt5ct_colors_dir}"
mv ./qt5ct_palette.conf "${qt5ct_colors_dir}/${OUTPUT_THEME_NAME}.conf"
fi
if [[ ${UNITY_DEFAULT_LAUNCHER_STYLE} == "true" ]] ; then
rm ./unity/launcher*.svg
fi
Expand All @@ -291,6 +285,21 @@ if [[ ${MAKE_GTK3} = 1 ]]; then
env MAKEFLAGS= make --jobs="$(nproc)" ${MAKE_OPTS}
fi

config_home=${XDG_CONFIG_HOME:-}
if [[ -z "${config_home}" ]] ; then
config_home="${HOME}/.config"
fi
if [[ ${EXPORT_QT5CT} = 1 ]] ; then
qt5ct_colors_dir="${config_home}/qt5ct/colors/"
test -d "${qt5ct_colors_dir}" || mkdir -p "${qt5ct_colors_dir}"
mv ./qt5ct_palette.conf "${qt5ct_colors_dir}/${OUTPUT_THEME_NAME}.conf"
fi
if [[ ${EXPORT_QT6CT} = 1 ]] ; then
qt6ct_colors_dir="${config_home}/qt6ct/colors/"
test -d "${qt6ct_colors_dir}" || mkdir -p "${qt6ct_colors_dir}"
mv ./qt6ct_palette.conf "${qt6ct_colors_dir}/${OUTPUT_THEME_NAME}.conf"
fi

rm -fr ./Makefile gtk-3.*/scss

for FILEPATH in "${SVG_PREVIEWS[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion oomox_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Plugin(OomoxThemePlugin):
name = 'oomox'
display_name = 'Oomox (Numix-Based)'
description = (
'GTK+2, GTK+3, Qt5ct\n'
'GTK+2, GTK+3, Qt5ct, Qt6ct\n'
'Cinnamon, Metacity, Openbox, Unity, Xfwm'
)
export_dialog = OomoxThemeExportDialog
Expand Down
2 changes: 1 addition & 1 deletion packaging/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pkgname="${_pkgname}-git"
pkgver=1.12.r2.g0db28619
pkgrel=1
pkgdesc="Oomox theme plugin
(GTK2, GTK3, Cinnamon, Metacity, Openbox, Qt5ct, Unity, Xfwm) for Themix GUI designer.
(GTK2, GTK3, Cinnamon, Metacity, Openbox, Qt5ct, Qt6ct, Unity, Xfwm) for Themix GUI designer.
Have a hack for HiDPI in GTK2."
arch=('x86_64' 'i686')
url="https://github.com/themix-project/oomox-gtk-theme"
Expand Down
5 changes: 5 additions & 0 deletions src/qt6ct_palette.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# FG BTN_BG bright less brdark less da txt fg br text btn fg txt bg bg shadow sel bg sel fg link visited alt bg default tooltip bg tooltip_fg placeholder_fg
[ColorScheme]
active_colors=#%FG%, #%BG%, #%BG%, #%BG%, #%HDR_BG%, #%HDR_BG%, #%TXT_FG%, #%TXT_FG%, #%FG%, #%TXT_BG%, #%BG%, #%HDR_BG%, #%SEL_BG%, #%SEL_FG%, #%SEL_BG%, #%FG%, #%BG%, #%FG%, %HDR_BG%, #%HDR_FG%, #%INACTIVE_FG%
disabled_colors=#%INACTIVE_FG%, #%BG%, #%BG%, #%BG%, #%HDR_BG%, #%HDR_BG%, #%INACTIVE_TXT_FG%, #%INACTIVE_TXT_FG%, #%INACTIVE_FG%, #%TXT_BG%, #%BG%, #%HDR_BG%, #%SEL_BG%, #%SEL_FG%, #%SEL_BG%, #%INACTIVE_FG%, #%BG%, #%INACTIVE_FG%, #%HDR_BG%, #%INACTIVE_HDR_FG%, #%INACTIVE_FG%
inactive_colors=#%FG%, #%BG%, #%BG%, #%BG%, #%HDR_BG%, #%HDR_BG%, #%TXT_FG%, #%TXT_FG%, #%FG%, #%TXT_BG%, #%BG%, #%HDR_BG%, #%SEL_BG%, #%SEL_FG%, #%SEL_BG%, #%FG%, #%BG%, #%FG%, #%HDR_BG%, #%HDR_FG%, #%INACTIVE_FG%

0 comments on commit 82d5296

Please sign in to comment.