Add options for panel size
This commit is contained in:
parent
94e19c90a5
commit
4f5a1ea8d0
8 changed files with 74 additions and 33 deletions
12
README.md
12
README.md
|
@ -65,9 +65,12 @@ Usage: `./install.sh [OPTIONS...]`
|
|||
-t, --theme [default|blue|purple|pink|red|orange|yellow|green|grey|all]
|
||||
Set theme accent color. Repeatable. Default is BigSur-like theme
|
||||
|
||||
-p, --panel [default|30|45|60|75]
|
||||
-p, --panel-opacity [default|30|45|60|75]
|
||||
Set panel transparency. Default is 15%
|
||||
|
||||
-P, --panel-size [default|smaller|bigger]
|
||||
Set Gnome shell panel height size. Default is 32px
|
||||
|
||||
-s, --size [default|180|220|240|260|280]
|
||||
Set Nautilus sidebar minimum width. Default is 200px
|
||||
|
||||
|
@ -209,10 +212,13 @@ Set 'WhiteSur' GDM and Dash to Dock theme color variants. Default is 'light'
|
|||
-t, --theme [default|blue|purple|pink|red|orange|yellow|green|grey]
|
||||
Set 'WhiteSur' GDM theme accent color. Default is BigSur-like theme
|
||||
|
||||
-p, --panel [default|30|45|60|75]
|
||||
-p, --panel-opacity [default|30|45|60|75]
|
||||
Set 'WhiteSur' GDM (GNOME Shell) theme panel transparency. Default is 15%
|
||||
|
||||
-i, --icon [standard|simple|gnome|ubuntu|arch|manjaro|fedora|debian|void]
|
||||
-P, --panel-size [default|smaller|bigger]
|
||||
Set 'WhiteSur' Gnome shell panel height size. Default is 32px
|
||||
|
||||
-i, --icon [standard|simple|gnome|ubuntu|arch|manjaro|fedora|debian|void|opensuse|popos|mxlinux|zorin]
|
||||
Set 'WhiteSur' GDM (GNOME Shell) 'Activities' icon. Default is 'standard'
|
||||
|
||||
-r, --remove, --revert
|
||||
|
|
|
@ -29,7 +29,8 @@ usage() {
|
|||
helpify "-c, --color" "[$(IFS='|'; echo "${COLOR_VARIANTS[*]}")]" "Set theme color variants" "Repeatable. Default is all variants"
|
||||
helpify "-a, --alt" "[$(IFS='|'; echo "${ALT_VARIANTS[*]}")|all]" "Set window control buttons variant" "Repeatable. Default is 'normal'"
|
||||
helpify "-t, --theme" "[$(IFS='|'; echo "${THEME_VARIANTS[*]}")|all]" "Set theme accent color" "Repeatable. Default is BigSur-like theme"
|
||||
helpify "-p, --panel" "[$(IFS='|'; echo "${PANEL_OPACITY_VARIANTS[*]}")]" "Set panel transparency" "Default is 15%"
|
||||
helpify "-p, --panel-opacity" "[$(IFS='|'; echo "${PANEL_OPACITY_VARIANTS[*]}")]" "Set panel transparency" "Default is 15%"
|
||||
helpify "-P, --panel-size" "[$(IFS='|'; echo "${PANEL_SIZE_VARIANTS[*]}")]" "Set Gnome shell panel height size" "Default is 32px"
|
||||
helpify "-s, --size" "[$(IFS='|'; echo "${SIDEBAR_SIZE_VARIANTS[*]}")]" "Set Nautilus sidebar minimum width" "Default is 200px"
|
||||
helpify "-i, --icon" "[$(IFS='|'; echo "${ICON_VARIANTS[*]}")]" "Set 'Activities' icon" "Default is 'standard'"
|
||||
helpify "-b, --background" "[default|blank|IMAGE_PATH]" "Set gnome-shell background image" "Default is BigSur-like wallpaper"
|
||||
|
@ -95,7 +96,9 @@ while [[ $# -gt 0 ]]; do
|
|||
check_param "${1}" "${1}" "${2}" "must" "must" "must" && shift 2 || shift ;;
|
||||
-s|--size)
|
||||
check_param "${1}" "${1}" "${2}" "optional" "optional" "optional" && shift 2 || shift ;;
|
||||
-p|--panel)
|
||||
-p|--panel-opacity)
|
||||
check_param "${1}" "${1}" "${2}" "optional" "optional" "optional" && shift 2 || shift ;;
|
||||
-P|--panel-size)
|
||||
check_param "${1}" "${1}" "${2}" "optional" "optional" "optional" && shift 2 || shift ;;
|
||||
-N|--nautilus-style)
|
||||
check_param "${1}" "${1}" "${2}" "optional" "optional" "optional" && shift 2 || shift ;;
|
||||
|
|
22
lib-core.sh
22
lib-core.sh
|
@ -86,6 +86,7 @@ THEME_VARIANTS=('default' 'blue' 'purple' 'pink' 'red' 'orange' 'yellow' 'green'
|
|||
ICON_VARIANTS=('standard' 'simple' 'gnome' 'ubuntu' 'arch' 'manjaro' 'fedora' 'debian' 'void' 'opensuse' 'popos' 'mxlinux' 'zorin')
|
||||
SIDEBAR_SIZE_VARIANTS=('default' '180' '220' '240' '260' '280')
|
||||
PANEL_OPACITY_VARIANTS=('default' '30' '45' '60' '75')
|
||||
PANEL_SIZE_VARIANTS=('default' 'smaller' 'bigger')
|
||||
NAUTILUS_STYLE_VARIANTS=('stable' 'normal' 'mojave' 'glassy')
|
||||
|
||||
#--------Customization, default values----------#
|
||||
|
@ -98,13 +99,14 @@ themes=("${THEME_VARIANTS[0]}")
|
|||
icon="${ICON_VARIANTS[0]}"
|
||||
sidebar_size="${SIDEBAR_SIZE_VARIANTS[0]}"
|
||||
panel_opacity="${PANEL_OPACITY_VARIANTS[0]}"
|
||||
panel_size="${PANEL_SIZE_VARIANTS[0]}"
|
||||
nautilus_style="${NAUTILUS_STYLE_VARIANTS[0]}"
|
||||
background="blank"
|
||||
compact="true"
|
||||
|
||||
#--Ambigous arguments checking and overriding default values--#
|
||||
declare -A has_set=([-b]="false" [-s]="false" [-p]="false" [-d]="false" [-n]="false" [-a]="false" [-o]="false" [-c]="false" [-i]="false" [-t]="false" [-N]="false")
|
||||
declare -A need_dialog=([-b]="false" [-s]="false" [-p]="false" [-d]="false" [-n]="false" [-a]="false" [-o]="false" [-c]="false" [-i]="false" [-t]="false" [-N]="false")
|
||||
declare -A has_set=([-b]="false" [-s]="false" [-p]="false" [-P]="false" [-d]="false" [-n]="false" [-a]="false" [-o]="false" [-c]="false" [-i]="false" [-t]="false" [-N]="false")
|
||||
declare -A need_dialog=([-b]="false" [-s]="false" [-p]="false" [-P]="false" [-d]="false" [-n]="false" [-a]="false" [-o]="false" [-c]="false" [-i]="false" [-t]="false" [-N]="false")
|
||||
|
||||
#------------Tweaks---------------#
|
||||
need_help="false"
|
||||
|
@ -391,15 +393,13 @@ destify() {
|
|||
|
||||
parsimplify() {
|
||||
case "${1}" in
|
||||
--size)
|
||||
echo "-s" ;;
|
||||
--panel)
|
||||
echo "-p" ;;
|
||||
--name|-n)
|
||||
# workaround for echo
|
||||
echo "~-n" | cut -c 2- ;;
|
||||
--dest)
|
||||
echo "-d" ;;
|
||||
--size)
|
||||
echo "-s" ;;
|
||||
--alt)
|
||||
echo "-a" ;;
|
||||
--opacity)
|
||||
|
@ -410,6 +410,10 @@ parsimplify() {
|
|||
echo "-i" ;;
|
||||
--theme)
|
||||
echo "-t" ;;
|
||||
--panel-opacity)
|
||||
echo "-p" ;;
|
||||
--panel-size)
|
||||
echo "-P" ;;
|
||||
--nautilus-style)
|
||||
echo "-N" ;;
|
||||
--background)
|
||||
|
@ -519,6 +523,12 @@ check_param() {
|
|||
panel_opacity="${value}"; variant_found="true"; break
|
||||
fi
|
||||
done ;;
|
||||
-P)
|
||||
for i in {0..2}; do
|
||||
if [[ "${value}" == "${PANEL_SIZE_VARIANTS[i]}" ]]; then
|
||||
panel_size="${value}"; variant_found="true"; break
|
||||
fi
|
||||
done ;;
|
||||
-a)
|
||||
if [[ "${value}" == "all" ]]; then
|
||||
for i in {0..2}; do
|
||||
|
|
|
@ -742,6 +742,12 @@ customize_theme() {
|
|||
sed $SED_OPT "/\$panel_opacity/s/0.15/0.${panel_opacity}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
|
||||
fi
|
||||
|
||||
# Change gnome-shell panel height size
|
||||
if [[ "${panel_size}" != 'default' ]]; then
|
||||
prompt -s "Changing panel height size to '${panel_size}'..."
|
||||
sed $SED_OPT "/\$panel_size/s/default/${panel_size}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
|
||||
fi
|
||||
|
||||
# Change gnome-shell show apps button style
|
||||
if [[ "${showapps_normal}" == 'true' ]]; then
|
||||
prompt -s "Changing gnome-shell show apps button style ..."
|
||||
|
|
|
@ -168,8 +168,8 @@ $panel_bg: if($variant == 'light', #f1f1f1, #2a2a2a);
|
|||
}
|
||||
|
||||
$panel_fg: if($trans == 'true' and $panel_font == 'white', $light_fg_color, $text_color);
|
||||
$panel_track: if($trans == 'false' or $panel_font == 'black' and $variant == 'light', rgba(black, 0.15), rgba(white, 0.28));
|
||||
$panel_divider: if($trans == 'false' or $panel_font == 'black' and $variant == 'light', rgba(black, 0.08), rgba(white, 0.15));
|
||||
$panel_track: if(($trans == 'false' or $panel_font == 'black') and $variant == 'light', rgba(black, 0.15), rgba(white, 0.28));
|
||||
$panel_divider: if(($trans == 'false' or $panel_font == 'black') and $variant == 'light', rgba(black, 0.08), rgba(white, 0.15));
|
||||
|
||||
$dash_bg: if($variant == 'light', rgba(#d1d1d1, $panel_opacity + 0.33), rgba(#222222, $panel_opacity/2 + 0.6));
|
||||
|
||||
|
|
|
@ -23,5 +23,8 @@ $max_window_style: 'square';
|
|||
// Panel font color
|
||||
$panel_font: 'white';
|
||||
|
||||
// Panel height size
|
||||
$panel_size: 'default';
|
||||
|
||||
// Monterey style
|
||||
$monterey: 'false';
|
||||
|
|
|
@ -1,10 +1,20 @@
|
|||
/* Top Bar */
|
||||
// a.k.a. the panel
|
||||
|
||||
$panel_height: $menuitem_size;
|
||||
|
||||
@if $panel_size == 'smaller' {
|
||||
$panel_height: $menuitem_size - 4px;
|
||||
}
|
||||
|
||||
@if $panel_size == 'bigger' {
|
||||
$panel_height: $menuitem_size + 4px;
|
||||
}
|
||||
|
||||
#panel {
|
||||
background-color: $panel_bg;
|
||||
font-weight: normal;
|
||||
height: $menuitem_size - 4px !important;
|
||||
height: $panel_height !important;
|
||||
box-shadow: 0 5px 16px rgba(black, 0.05);
|
||||
color: $panel_fg;
|
||||
font-feature-settings: "tnum";
|
||||
|
|
41
tweaks.sh
41
tweaks.sh
|
@ -19,23 +19,24 @@ usage() {
|
|||
# Please specify their default value manually, some of them are come from _variables.scss
|
||||
# You also have to check and update them regurally
|
||||
helpify_title
|
||||
helpify "-f, --firefox" "[default|monterey]" "Install '${THEME_NAME}|Monterey' theme for Firefox and connect it to the current Firefox profiles" "Default is ${THEME_NAME}"
|
||||
helpify "-e, --edit-firefox" "" "Edit '${THEME_NAME}' theme for Firefox settings and also connect the theme to the current Firefox profiles" ""
|
||||
helpify "-F, --flatpak" "" "Connect '${THEME_NAME}' theme to Flatpak" ""
|
||||
helpify "-s, --snap" "" "Connect '${THEME_NAME}' theme the currently installed snap apps" ""
|
||||
helpify "-g, --gdm" "" "Install '${THEME_NAME}' theme for GDM" "Requires to run this shell as root"
|
||||
helpify "-d, --dash-to-dock" "" "Install '${THEME_NAME}' theme for Dash to Dock and connect it to the current Dash to Dock installation(s)" ""
|
||||
helpify "-N, --no-darken" "" "Don't darken '${THEME_NAME}' GDM theme background image" ""
|
||||
helpify "-n, --no-blur" "" "Don't blur '${THEME_NAME}' GDM theme background image" ""
|
||||
helpify "-b, --background" "[default|blank|IMAGE_PATH]" "Set '${THEME_NAME}' GDM theme background image" "Default is BigSur-like wallpaper"
|
||||
helpify "-o, --opacity" "[$(IFS='|'; echo "${OPACITY_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM theme opacity variants" "Default is 'normal'"
|
||||
helpify "-c, --color" "[$(IFS='|'; echo "${COLOR_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM and Dash to Dock theme color variants" "Default is 'light'"
|
||||
helpify "-t, --theme" "[$(IFS='|'; echo "${THEME_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM theme accent color" "Default is BigSur-like theme"
|
||||
helpify "-p, --panel" "[$(IFS='|'; echo "${PANEL_OPACITY_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM (GNOME Shell) theme panel transparency" "Default is 15%"
|
||||
helpify "-i, --icon" "[$(IFS='|'; echo "${ICON_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM (GNOME Shell) 'Activities' icon" "Default is 'standard'"
|
||||
helpify "-r, --remove, --revert" "" "Revert to the original themes, do the opposite things of install and connect" ""
|
||||
helpify "--silent-mode" "" "Meant for developers: ignore any confirm prompt and params become more strict" ""
|
||||
helpify "-h, --help" "" "Show this help" ""
|
||||
helpify "-f, --firefox" "[default|monterey]" "Install '${THEME_NAME}|Monterey' theme for Firefox and connect it to the current Firefox profiles" "Default is ${THEME_NAME}"
|
||||
helpify "-e, --edit-firefox" "" "Edit '${THEME_NAME}' theme for Firefox settings and also connect the theme to the current Firefox profiles" ""
|
||||
helpify "-F, --flatpak" "" "Connect '${THEME_NAME}' theme to Flatpak" ""
|
||||
helpify "-s, --snap" "" "Connect '${THEME_NAME}' theme the currently installed snap apps" ""
|
||||
helpify "-g, --gdm" "" "Install '${THEME_NAME}' theme for GDM" "Requires to run this shell as root"
|
||||
helpify "-d, --dash-to-dock" "" "Install '${THEME_NAME}' theme for Dash to Dock and connect it to the current Dash to Dock installation(s)" ""
|
||||
helpify "-N, --no-darken" "" "Don't darken '${THEME_NAME}' GDM theme background image" ""
|
||||
helpify "-n, --no-blur" "" "Don't blur '${THEME_NAME}' GDM theme background image" ""
|
||||
helpify "-b, --background" "[default|blank|IMAGE_PATH]" "Set '${THEME_NAME}' GDM theme background image" "Default is BigSur-like wallpaper"
|
||||
helpify "-o, --opacity" "[$(IFS='|'; echo "${OPACITY_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM theme opacity variants" "Default is 'normal'"
|
||||
helpify "-c, --color" "[$(IFS='|'; echo "${COLOR_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM and Dash to Dock theme color variants" "Default is 'light'"
|
||||
helpify "-t, --theme" "[$(IFS='|'; echo "${THEME_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM theme accent color" "Default is BigSur-like theme"
|
||||
helpify "-p, --panel-opacity" "[$(IFS='|'; echo "${PANEL_OPACITY_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM (GNOME Shell) theme panel transparency" "Default is 15%"
|
||||
helpify "-P, --panel-size" "[$(IFS='|'; echo "${PANEL_SIZE_VARIANTS[*]}")]" "Set '${THEME_NAME}' Gnome shell panel height size" "Default is 32px"
|
||||
helpify "-i, --icon" "[$(IFS='|'; echo "${ICON_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM (GNOME Shell) 'Activities' icon" "Default is 'standard'"
|
||||
helpify "-r, --remove, --revert" "" "Revert to the original themes, do the opposite things of install and connect" ""
|
||||
helpify "--silent-mode" "" "Meant for developers: ignore any confirm prompt and params become more strict" ""
|
||||
helpify "-h, --help" "" "Show this help" ""
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
@ -138,8 +139,10 @@ while [[ $# -gt 0 ]]; do
|
|||
check_param "${1}" "${1}" "${2}" "must" "must" "must" "false" && shift 2 || shift ;;
|
||||
-i|--icon)
|
||||
check_param "${1}" "${1}" "${2}" "must" "must" "must" "false" && shift 2 || shift ;;
|
||||
-p|--panel)
|
||||
check_param "${1}" "${1}" "${2}" "must" "optional" "optional" "false" && shift 2 || shift ;;
|
||||
-p|--panel-opacity)
|
||||
check_param "${1}" "${1}" "${2}" "optional" "optional" "optional" && shift 2 || shift ;;
|
||||
-P|--panel-size)
|
||||
check_param "${1}" "${1}" "${2}" "optional" "optional" "optional" && shift 2 || shift ;;
|
||||
-o|--opacity)
|
||||
check_param "${1}" "${1}" "${2}" "must" "must" "must" "false" && shift 2 || shift ;;
|
||||
-c|--color)
|
||||
|
|
Loading…
Reference in a new issue