Implement --fontset (#2307)

This commit is contained in:
clsty
2025-10-29 17:23:26 +08:00
parent 41cf490681
commit f95165185c
2 changed files with 20 additions and 9 deletions
+11 -2
View File
@@ -104,11 +104,11 @@ fi
# original dotfiles and new ones in the SAME DIRECTORY
# (eg. in ~/.config/hypr) won't be mixed together
# MISC (For dots/.config/* but not quickshell, not fish, not Hyprland)
# MISC (For dots/.config/* but not quickshell, not fish, not Hyprland, not fontconfig)
case $SKIP_MISCCONF in
true) sleep 0;;
*)
for i in $(find dots/.config/ -mindepth 1 -maxdepth 1 ! -name 'quickshell' ! -name 'fish' ! -name 'hypr' -exec basename {} \;); do
for i in $(find dots/.config/ -mindepth 1 -maxdepth 1 ! -name 'quickshell' ! -name 'fish' ! -name 'hypr' ! -name 'fontconfig' -exec basename {} \;); do
# i="dots/.config/$i"
echo "[$0]: Found target: dots/.config/$i"
if [ -d "dots/.config/$i" ];then warning_rsync; v rsync -av --delete "dots/.config/$i/" "$XDG_CONFIG_HOME/$i/"
@@ -134,6 +134,15 @@ case $SKIP_FISH in
;;
esac
case $SKIP_FONTCONFIG in
true) sleep 0;;
*)
case "$II_FONTSET_NAME" in
"") warning_rsync; v rsync -av --delete dots/.config/fontconfig/ "$XDG_CONFIG_HOME"/fontconfig/ ;;
*) warning_rsync; v rsync -av --delete dots-extra/fontsets/$II_FONTSET_NAME/ "$XDG_CONFIG_HOME"/fontconfig/ ;;
esac;;
esac
# For Hyprland
declare -a arg_excludes=()
arg_excludes+=(--exclude '/custom')
+9 -7
View File
@@ -19,9 +19,10 @@ Options for install:
--skip-quickshell Skip installing the config for Quickshell
--skip-hyprland Skip installing the config for Hyprland
--skip-fish Skip installing the config for Fish
--skip-fontconfig Skip installing the config for fontconfig
--skip-miscconf Skip copying the dirs and files to \".configs\" except for
Quickshell, Fish and Hyprland
--core Alias of --skip-{plasmaintg,fish,miscconf}
--core Alias of --skip-{plasmaintg,fish,miscconf,fontconfig}
--exp-files Use experimental script for the third step copying files
--fontset <set> (Unavailable yet) Use a set of pre-defined font and config
--via-nix (Unavailable yet) Use Nix to install dependencies
@@ -35,7 +36,7 @@ cleancache(){
# `man getopt` to see more
para=$(getopt \
-o hfk:cs \
-l help,force,fontset:,clean,skip-allgreeting,skip-alldeps,skip-allsetups,skip-allfiles,skip-sysupdate,skip-plasmaintg,skip-backup,skip-quickshell,skip-fish,skip-hyprland,skip-miscconf,core,exp-files,via-nix \
-l help,force,fontset:,clean,skip-allgreeting,skip-alldeps,skip-allsetups,skip-allfiles,skip-sysupdate,skip-plasmaintg,skip-backup,skip-quickshell,skip-fish,skip-hyprland,skip-fontconfig,skip-miscconf,core,exp-files,via-nix \
-n "$0" -- "$@")
[ $? != 0 ] && echo "$0: Error when getopt, please recheck parameters." && exit 1
#####################################################################################
@@ -70,17 +71,18 @@ while true ; do
--skip-hyprland) SKIP_HYPRLAND=true;shift;;
--skip-fish) SKIP_FISH=true;shift;;
--skip-quickshell) SKIP_QUICKSHELL=true;shift;;
--skip-fontconfig) SKIP_FONTCONFIG=true;shift;;
--skip-miscconf) SKIP_MISCCONF=true;shift;;
--core) SKIP_PLASMAINTG=true;SKIP_FISH=true;SKIP_MISCCONF=true;shift;;
--core) SKIP_PLASMAINTG=true;SKIP_FISH=true;SKIP_FONTCONFIG=true;SKIP_MISCCONF=true;shift;;
--exp-files) EXPERIMENTAL_FILES_SCRIPT=true;shift;;
--via-nix) INSTALL_VIA_NIX=true;shift;;
## Ones with parameter
--fontset)
case $2 in
"default"|"zh-CN"|"vi") fontset="$2";;
*) echo -e "Wrong argument for $1.";exit 1;;
esac;echo "The fontset is ${fontset}.";shift 2;;
if [[ -d "${REPO_ROOT}/dots-extra/fontsets/$2" ]];
then echo "Using fontset \"$2\".";II_FONTSET_NAME="$2";shift 2
else echo "Wrong argument for $1.";exit 1
fi;;
## Ending
--) break ;;