Port the tweaks flag from Fluent theme to Orchis

Now this flag allows you to set compact and/or solid panel if you want.
It's mostly the same code from the Fluent theme but I adapted a few lines
to work with Orchis.
pull/110/head
Aaron-Uriel 5 years ago
parent 679de4f369
commit 9635c412b5

@ -1,5 +1,5 @@
#!/bin/bash
set -ueo pipefail
set -eo pipefail
#set -x
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
@ -15,6 +15,8 @@ else
DEST_DIR="$HOME/.themes"
fi
SASSC_OPT="-M -t expanded"
THEME_NAME=Orchis
THEME_VARIANTS=('' '-purple' '-pink' '-red' '-orange' '-yellow' '-green' '-grey')
COLOR_VARIANTS=('' '-light' '-dark')
@ -42,6 +44,7 @@ OPTIONS:
-t, --theme VARIANT Specify theme color variant(s) [default|purple|pink|red|orange|yellow|green|grey|all] (Default: blue)
-c, --color VARIANT... Specify color variant(s) [standard|light|dark] (Default: All variants)s)
-s, --size VARIANT Specify size variant [standard|compact] (Default: All variants)
--tweaks Specify versions for tweaks [solid|compact] (solid: no transparency variant, compact: no floating panel)
--radio-color Change radio button checked color to default primary color (Default is Green)
-h, --help Show help
@ -90,10 +93,18 @@ install() {
mkdir -p "$THEME_DIR/gnome-shell"
cp -r "$SRC_DIR/gnome-shell/pad-osd.css" "$THEME_DIR/gnome-shell"
if [[ "${GS_VERSION:-}" == 'new' ]]; then
cp -r "$SRC_DIR/gnome-shell/shell-40-0/gnome-shell$theme${ELSE_DARK:-}$size.css" "$THEME_DIR/gnome-shell/gnome-shell.css"
if [[ "$panel" == 'compact' || "$opacity" == 'solid' ]]; then
if [[ "${GS_VERSION:-}" == 'new' ]]; then
sassc $SASSC_OPT "$SRC_DIR/gnome-shell/shell-40-0/gnome-shell$theme${ELSE_DARK:-}$size.scss" "$THEME_DIR/gnome-shell/gnome-shell.css"
else
sassc $SASSC_OPT "$SRC_DIR/gnome-shell/shell-3-28/gnome-shell$theme${ELSE_DARK:-}$size.scss" "$THEME_DIR/gnome-shell/gnome-shell.css"
fi
else
cp -r "$SRC_DIR/gnome-shell/shell-3-28/gnome-shell$theme${ELSE_DARK:-}$size.css" "$THEME_DIR/gnome-shell/gnome-shell.css"
if [[ "${GS_VERSION:-}" == 'new' ]]; then
cp -r "$SRC_DIR/gnome-shell/shell-40-0/gnome-shell$theme${ELSE_DARK:-}$size.css" "$THEME_DIR/gnome-shell/gnome-shell.css"
else
cp -r "$SRC_DIR/gnome-shell/shell-3-28/gnome-shell$theme${ELSE_DARK:-}$size.css" "$THEME_DIR/gnome-shell/gnome-shell.css"
fi
fi
cp -r "$SRC_DIR/gnome-shell/common-assets" "$THEME_DIR/gnome-shell/assets"
@ -115,17 +126,31 @@ install() {
mkdir -p "$THEME_DIR/gtk-3.0"
cp -r "$SRC_DIR/gtk/assets$theme" "$THEME_DIR/gtk-3.0/assets"
cp -r "$SRC_DIR/gtk/scalable" "$THEME_DIR/gtk-3.0/assets"
cp -r "$SRC_DIR/gtk/3.0/gtk$theme$color$size.css" "$THEME_DIR/gtk-3.0/gtk.css"
[[ "$color" != '-dark' ]] && \
cp -r "$SRC_DIR/gtk/3.0/gtk$theme-dark$size.css" "$THEME_DIR/gtk-3.0/gtk-dark.css"
cp -r "$SRC_DIR/gtk/thumbnail${ELSE_DARK:-}.png" "$THEME_DIR/gtk-3.0/thumbnail.png"
if [[ "$opacity" == 'solid' ]]; then
sassc $SASSC_OPT "$SRC_DIR/gtk/3.0/gtk$theme$color$size.scss" "$THEME_DIR/gtk-3.0/gtk.css"
[[ "$color" != '-dark' ]] && \
sassc $SASSC_OPT "$SRC_DIR/gtk/3.0/gtk$theme-dark$size.scss" "$THEME_DIR/gtk-3.0/gtk-dark.css"
else
cp -r "$SRC_DIR/gtk/3.0/gtk$theme$color$size.css" "$THEME_DIR/gtk-3.0/gtk.css"
[[ "$color" != '-dark' ]] && \
cp -r "$SRC_DIR/gtk/3.0/gtk$theme-dark$size.css" "$THEME_DIR/gtk-3.0/gtk-dark.css"
fi
mkdir -p "$THEME_DIR/gtk-4.0"
cp -r "$SRC_DIR/gtk/assets$theme" "$THEME_DIR/gtk-4.0/assets"
cp -r "$SRC_DIR/gtk/scalable" "$THEME_DIR/gtk-4.0/assets"
cp -r "$SRC_DIR/gtk/4.0/gtk$theme$color$size.css" "$THEME_DIR/gtk-4.0/gtk.css"
[[ "$color" != '-dark' ]] && \
cp -r "$SRC_DIR/gtk/4.0/gtk$theme-dark$size.css" "$THEME_DIR/gtk-4.0/gtk-dark.css"
if [[ "$opacity" == 'solid' ]]; then
sassc $SASSC_OPT "$SRC_DIR/gtk/4.0/gtk$theme$color$size.scss" "$THEME_DIR/gtk-4.0/gtk.css"
[[ "$color" != '-dark' ]] && \
sassc $SASSC_OPT "$SRC_DIR/gtk/4.0/gtk$theme-dark$size.scss" "$THEME_DIR/gtk-4.0/gtk-dark.css"
else
cp -r "$SRC_DIR/gtk/4.0/gtk$theme$color$size.css" "$THEME_DIR/gtk-4.0/gtk.css"
[[ "$color" != '-dark' ]] && \
cp -r "$SRC_DIR/gtk/4.0/gtk$theme-dark$size.css" "$THEME_DIR/gtk-4.0/gtk-dark.css"
fi
mkdir -p "$THEME_DIR/xfwm4"
cp -r "$SRC_DIR/xfwm4/assets${ELSE_LIGHT:-}/"*.png "$THEME_DIR/xfwm4"
@ -163,6 +188,29 @@ while [[ "$#" -gt 0 ]]; do
_name="$2"
shift 2
;;
--tweaks)
shift
for tweaks in $@; do
case "$tweaks" in
solid)
opacity="solid"
shift
;;
compact)
panel="compact"
shift
;;
-*)
break
;;
*)
echo "ERROR: Unrecognized panel variant '$1'."
echo "Try '$0 --help' for more information."
exit 1
;;
esac
done
;;
--radio-color)
radio="true"
shift
@ -294,6 +342,49 @@ change_radio_color() {
fi
}
# Install needed packages
install_package() {
if [ ! "$(which sassc 2> /dev/null)" ]; then
echo sassc needs to be installed to generate the css.
if has_command zypper; then
sudo zypper in sassc
elif has_command apt-get; then
sudo apt-get install sassc
elif has_command dnf; then
sudo dnf install sassc
elif has_command dnf; then
sudo dnf install sassc
elif has_command pacman; then
sudo pacman -S --noconfirm sassc
fi
fi
}
install_compact_panel() {
cd ${SRC_DIR}/gnome-shell/sass
cp -an _tweaks.scss _tweaks.scss.bak
sed -i "/\$panel_style:/s/float/compact/" _tweaks.scss
echo -e "Install compact panel version ..."
}
install_solid() {
cd ${SRC_DIR}/gnome-shell/sass
cp -an _tweaks.scss _tweaks.scss.bak
sed -i "/\$opacity:/s/default/solid/" _tweaks.scss
cd ${SRC_DIR}/_sass
cp -an _tweaks.scss _tweaks.scss.bak
sed -i "/\$opacity:/s/default/solid/" _tweaks.scss
echo -e "Install solid version ..."
}
restore_tweaks() {
cd ${SRC_DIR}/gnome-shell/sass
[[ -f _tweaks.scss.bak ]] && rm -rf _tweaks.scss && mv _tweaks.scss.bak _tweaks.scss
cd ${SRC_DIR}/_sass
[[ -f _tweaks.scss.bak ]] && rm -rf _tweaks.scss && mv _tweaks.scss.bak _tweaks.scss
echo -e "Restore _tweaks.scss file ..."
}
restore_files() {
if [[ -f $SRC_DIR/_sass/gtk/_common-3.20.scss.bak ]]; then
cd $SRC_DIR/_sass/gtk
@ -326,7 +417,15 @@ if [[ "${#sizes[@]}" -eq 0 ]] ; then
sizes=("${SIZE_VARIANTS[@]}")
fi
change_radio_color && install_theme && restore_files
if [[ "$panel" = "compact" ]] ; then
install_package && install_compact_panel
fi
if [[ "$opacity" = "solid" ]] ; then
install_package && install_solid
fi
change_radio_color && install_theme && restore_files && restore_tweaks
echo
echo "Done."

@ -0,0 +1,5 @@
// Gnome-shell panel style
$panel_style: 'float';
// transparent opacity
$opacity: 'default';

@ -1,3 +1,5 @@
@import 'tweaks';
$asset-suffix: if($variant == 'dark', '-dark', '');
$theme-asset-suffix: if($topbar == 'dark', if($variant == 'dark', '-dark', ''), '-light');

@ -0,0 +1,5 @@
// Gnome-shell panel style
$panel_style: 'float';
// transparent opacity
$opacity: 'default';

@ -1,3 +1,6 @@
@import 'tweaks';
$asset_suffix: if($variant == 'dark', '-dark', '');
$extra_background_clip: if($variant == 'light', padding-box, border-box);

@ -4,15 +4,26 @@
$panel_transition_duration: 250ms; // same as the overview transition duration
#panel {
background-color: $panel_bg_color;
font-weight: bold;
height: $medium_size + 2px;
font-feature-settings: "tnum";
border-radius: $circular_radius;
margin: $container_padding / 2;
padding: 0 $container_padding / 2 !important;
transition-duration: $panel_transition_duration;
@if $opacity == 'solid' {
background-color: $panel_bg;
} @else {
background-color: $panel_bg_color;
}
@if $panel_style == 'compact' {
margin: 0;
border-radius: 0;
height: $medium_size - 2px;
} @else {
margin: $container_padding / 2;
border-radius: $circular_radius;
height: $medium_size + 2px;
}
// transparent panel on lock & login screens
&.unlock-screen,
&.login-screen,

Loading…
Cancel
Save