#!/bin/bash SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" have_real=$(type -p realpath) [ "${have_real}" ] && SCRIPT_PATH="$(realpath "$SCRIPT_PATH")" REPO_URL="https://github.com/doctorfree/kitty-control" KCONF="${HOME}/.config/kitty" KCDIR="${KCONF}/kitty-control" FONT_URL="https://raw.githubusercontent.com/wiki/doctorfree/workspaces-images" export KCKITTEN="kc_read_config.py" # Use './install --force' to overwrite any existing neofetch/fastfetch configs force= [ "$1" == "--force" ] && force=1 install_kitty() { if [ "${darwin}" ]; then KTAPP="/Applications/kitty.app" LOCAL="${KTAPP}/Contents" KBIN="${LOCAL}/MacOS" KTINFO="${LOCAL}/Resources/kitty/terminfo/kitty.terminfo" KXTERM="${LOCAL}/Resources/kitty/terminfo/78/xterm-kitty" KSTERM="${LOCAL}/Resources/terminfo/78/xterm-kitty" else LOCAL="${HOME}/.local/kitty.app" KBIN="${LOCAL}/bin" KTINFO="${LOCAL}/lib/kitty/terminfo/kitty.terminfo" KXTERM="${LOCAL}/lib/kitty/terminfo/x/xterm-kitty" KSTERM="${LOCAL}/share/terminfo/x/xterm-kitty" fi printf "\n\tInstalling Kitty terminal emulator ..." installer_url="https://sw.kovidgoyal.net/kitty/installer.sh" if [ "${have_curl}" ]; then curl --silent --location ${installer_url} >/tmp/kitty-$$.sh [ $? -eq 0 ] || { rm -f /tmp/kitty-$$.sh curl --insecure --silent --location ${installer_url} >/tmp/kitty-$$.sh cat /tmp/kitty-$$.sh | sed -e "s/curl -/curl -k/" >/tmp/k$$ cp /tmp/k$$ /tmp/kitty-$$.sh rm -f /tmp/k$$ } else [ "${have_wget}" ] && wget --quiet -O /tmp/kitty-$$.sh ${installer_url} fi if [ -s /tmp/kitty-$$.sh ]; then sh /tmp/kitty-$$.sh launch=n >/dev/null 2>&1 rm -f /tmp/kitty-$$.sh # Create a symbolic link to add kitty to PATH [ -d ~/.local/bin ] || mkdir -p ~/.local/bin if [ -x ${KBIN}/kitty ]; then [ -x ~/.local/bin/kitty ] || { ln -s ${KBIN}/kitty ~/.local/bin/ } else printf "\nUnable to create Kitty link to ~/.local/bin/\n" fi if [ -x ${KBIN}/kitten ]; then [ -x ~/.local/bin/kitten ] || { ln -s ${KBIN}/kitten ~/.local/bin/ } else printf "\nUnable to create kitten link to ~/.local/bin/\n" fi # Link the kitty man pages somewhere it can be found by the man command if [ "${darwin}" ]; then LINMAN="/Applications/kitty.app/Contents/Resources/man" else LINMAN="${LOCAL}/share/man" fi [ -d ~/.local/share/man/man1 ] || mkdir -p ~/.local/share/man/man1 [ -f ~/.local/share/man/man1/kitty.1 ] || { [ -d ${HOME}/.local/share/man/man1 ] || { mkdir -p ${HOME}/.local/share/man/man1 } [ -f "${LINMAN}/man1/kitty.1" ] && { ln -s "${LINMAN}/man1/kitty.1" ~/.local/share/man/man1/ } } [ -d ~/.local/share/man/man5 ] || mkdir -p ~/.local/share/man/man5 [ -f ~/.local/share/man/man5/kitty.conf.5 ] || { [ -d ${HOME}/.local/share/man/man5 ] || { mkdir -p ${HOME}/.local/share/man/man5 } [ -f "${LINMAN}/man5/kitty.conf.5" ] && { ln -s "${LINMAN}/man5/kitty.conf.5" ~/.local/share/man/man5/ } } # Place the kitty.desktop file somewhere it can be found by the OS [ -d ~/.local/share/applications ] || mkdir -p ~/.local/share/applications [ -f "${LOCAL}/share/applications/kitty.desktop" ] && { [ -f ~/.local/share/applications/kitty.desktop ] || { cp ${LOCAL}/share/applications/kitty.desktop \ ~/.local/share/applications/ } } # If you want to open text files and images in kitty via your file manager # also add the kitty-open.desktop file [ -f "${LOCAL}/share/applications/kitty-open.desktop" ] && { [ -f ~/.local/share/applications/kitty-open.desktop ] || { cp ${LOCAL}/share/applications/kitty-open.desktop \ ~/.local/share/applications/ } } # Update the paths to the kitty and its icon in the kitty.desktop file(s) for desktop in "${HOME}"/.local/share/applications/kitty*.desktop do [ "${desktop}" == "${HOME}/.local/share/applications/kitty*.desktop" ] && continue [ -f ${LOCAL}/share/icons/hicolor/256x256/apps/kitty.png ] && { sed -i "s|Icon=kitty|Icon=${LOCAL}/share/icons/hicolor/256x256/apps/kitty.png|g" "${desktop}" } [ -x ${LOCAL}/bin/kitty ] && { sed -i "s|Exec=kitty|Exec=${LOCAL}/bin/kitty|g" "${desktop}" } done printf " done!\n" else printf "\n${BOLD}ERROR:${NORM} Download of kitty installation script failed" printf "\nSee https://sw.kovidgoyal.net/kitty/binary/#manually-installing" printf "\nto manually install the kitty terminal emulator\n" fi # Install the Kitty terminfo entry KITERM="${HOME}/.terminfo/x/xterm-kitty" MATERM="${HOME}/.terminfo/78/xterm-kitty" [ -f "${KITERM}" ] || [ -f "${MATERM}" ] || { [ -d ${HOME}/.terminfo ] || mkdir -p ${HOME}/.terminfo [ -d ${HOME}/.terminfo/x ] || mkdir -p ${HOME}/.terminfo/x [ -d ${HOME}/.terminfo/78 ] || mkdir -p ${HOME}/.terminfo/78 [ "${have_tic}" ] && { [ -f "${KTINFO}" ] && { tic -x -o ${HOME}/.terminfo "${KTINFO}" >/dev/null 2>&1 } } [ -f "${KITERM}" ] || [ -f "${MATERM}" ] || { if [ -f "${KXTERM}" ]; then cp "${KXTERM}" "${KITERM}" else if [ -f "${KSTERM}" ]; then cp "${KSTERM}" "${KITERM}" else printf "\nUnable to create Kitty terminfo entry ${KITERM}\n" fi fi } } [ "${darwin}" ] && { have_xattr=$(type -p xattr) [ "${have_xattr}" ] && { xattr -cr "${KTAPP}" [ $? -eq 0 ] || { printf "\nWARNING: attribute modification for ${KTAPP} failed" printf "\nPermission to modify this application may need to be granted" printf "\nSee 'Privacy & Security' -> 'App Management' in 'Settings'\n" } } } } fixup_conf_shell() { SFILE="$1" [ -f "${SFILE}" ] || return if [ -n "$($SHELL -c 'echo $ZSH_VERSION')" ]; then cat ${SFILE} | sed -e "s/^#map /map /" > /tmp/kc$$ cp /tmp/kc$$ ${SFILE} rm -f /tmp/kc$$ elif [ -n "$($SHELL -c 'echo $BASH_VERSION')" ]; then cat ${SFILE} | \ sed -e "s/^#map /map /" -e "s/tab zsh/tab bash/" > /tmp/kc$$ cp /tmp/kc$$ ${SFILE} rm -f /tmp/kc$$ fi } install_kconf() { [ -d ${KCONF} ] || mkdir -p ${KCONF} for py in "${SCRIPT_PATH}"/config/*.py do [ "${py}" == "${SCRIPT_PATH}/config/*.py" ] && continue cp "${py}" ${KCONF} done cp "${SCRIPT_PATH}"/config/kitty.conf ${KCONF} fixup_conf_shell "${KCONF}/kitty.conf" } install_kicon() { KICON="$1" if [ "${darwin}" ]; then [ -f "${SCRIPT_PATH}"/icons/kitty.app.icns ] && { cp "${SCRIPT_PATH}"/icons/kitty.app.icns "${KICON}" } else [ -f "${SCRIPT_PATH}"/icons/kitty-128.png ] && { cp "${SCRIPT_PATH}"/icons/kitty-128.png "${KICON}" } fi } install_config() { # We use $HOME/.config/kitty/kitty-control for kitty-control DEST="$1" [ -d "${DEST}" ] || mkdir -p "${DEST}" [ -d "${DEST}"/kitty-control ] || mkdir -p "${DEST}"/kitty-control find "${DEST}" -name ${KCKITTEN} -print0 | xargs -0 rm -f cp "${SCRIPT_PATH}"/kitten/${KCKITTEN} "${DEST}" chmod 644 "${DEST}"/${KCKITTEN} [ -f "${DEST}"/diff.conf ] || { cp "${SCRIPT_PATH}"/config/diff.conf "${DEST}"/diff.conf chmod 644 "${DEST}"/diff.conf } if [ -d "${DEST}"/kitty-control ]; then for ex in "${SCRIPT_PATH}"/config/* do [ "${ex}" == "${SCRIPT_PATH}/config/*" ] && continue b=$(basename "${ex}") if [ -d "${ex}" ]; then if [ -d "${DEST}"/kitty-control/$b ]; then cp "${ex}"/* "${DEST}"/kitty-control/$b else cp -a "${ex}" "${DEST}"/kitty-control/$b fi else cp "${ex}" "${DEST}"/kitty-control/$b fi done else cp -a "${SCRIPT_PATH}"/config "${DEST}"/kitty-control fi # Fix the shell in kitty-control session files [ -d "${DEST}"/kitty-control/sessions ] && { find "${DEST}"/kitty-control/sessions -type f | while read sfile do grep zsh "${sfile}" > /dev/null && { if [ -n "$($SHELL -c 'echo $BASH_VERSION')" ]; then cat "${sfile}" | sed -e "s/ zsh/ bash/" > /tmp/kc$$ cp /tmp/kc$$ "${sfile}" rm -f /tmp/kc$$ fi } done if [ -d "${DEST}"/sessions ]; then for sf in "${DEST}"/kitty-control/sessions/* do b=$(basename "${sf}") [ -f "${DEST}"/sessions/$b ] || cp ${sf} "${DEST}"/sessions/$b done else cp -a "${DEST}"/kitty-control/sessions "${DEST}"/sessions fi } # Link to the new location of the kitten [ -f "${DEST}"/${KCKITTEN} ] && { export DEST find "${DEST}" -name kitty.conf | while read kitty_conf do kcpath=$(dirname "${kitty_conf}") [ -f "${kcpath}"/${KCKITTEN} ] || { ln -s "${DEST}"/${KCKITTEN} ${kcpath}/${KCKITTEN} } [ "${kitty_conf}" == "${KCONF}/kitty.conf" ] || { fixup_conf_shell "${kitty_conf}" } done } } install_fonts() { printf "\nInstalling JetBrains Mono Nerd Font\n" if [ "${have_wget}" ]; then wget --quiet -O /tmp/fonts.tar.gz ${FONT_URL}/fonts/JetBrainsMonoNerdFont.tar.gz else [ "${have_curl}" ] && { curl --silent --location \ ${FONT_URL}/fonts/JetBrainsMonoNerdFont.tar.gz >/tmp/fonts.tar.gz } fi [ -f /tmp/fonts.tar.gz ] && { [ -d ${usr_font_dir} ] || mkdir -p ${usr_font_dir} tar xzf /tmp/fonts.tar.gz -C ${usr_font_dir} rm -f /tmp/fonts.tar.gz have_fc=$(type -p fc-cache) [ "${have_fc}" ] && fc-cache -f } } pathadd() { if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then PATH="$1${PATH:+":$PATH"}" fi } pathadd "${HOME}/.local/bin" pathadd "${HOME}/.fzf/bin" export PATH have_git=$(type -p git) [ "${have_git}" ] || { printf "\nERROR: cannot locate required git command" printf "\nInstall git and re-run this install script\n\n" exit 1 } printf "\nInstalling kitty-control\n" darwin= icon_name= icon_size="512" fast_type="kitty-direct" platform=$(uname -s) if [ "${platform}" == "Darwin" ]; then darwin=1 icon_name="apple-logo" icon_size="384" fast_type="kitty" else [ -f /etc/os-release ] && { . /etc/os-release icon_name="${ID}" } fi [ "${icon_name}" ] || { icon_size="256" icon_name="kitty" } have_curl=$(type -p curl) have_fzf=$(type -p fzf) have_rich=$(type -p rich) have_python=$(type -p python3) have_tic=$(type -p tic) have_wget=$(type -p wget) have_kitty=$(type -p kitty) [ "${have_kitty}" ] || install_kitty [ -f "${KCONF}/kitty.conf" ] || install_kconf if [ "${darwin}" ]; then [ -f "${KCONF}/kitty.app.icns" ] || { install_kicon "${KCONF}"/kitty.app.icns rm /var/folders/*/*/*/com.apple.dock.iconcache killall Dock } else [ -f "${KCONF}"/kitty.app.png ] || install_kicon "${KCONF}"/kitty.app.png fi # If standalone install, clone the repository, run the install script, exit [ -f "${SCRIPT_PATH}"/bin/kitty-control ] || { printf "\nCloning kitty-control repository\n" git clone ${REPO_URL} /tmp/kc$$ >/dev/null 2>&1 [ -x /tmp/kc$$/install ] || { [ -f /tmp/kc$$/install ] || { printf "\nERROR: installation failure, missing files.\n\n" exit 1 } chmod 755 /tmp/kc$$/install } /tmp/kc$$/install rm -rf /tmp/kc$$ exit 0 } # Copy kitty-control, kc_read_config.py, man pages [ -d ${HOME}/.local/bin ] || mkdir -p ${HOME}/.local/bin cp "${SCRIPT_PATH}"/bin/kitty-control ${HOME}/.local/bin/kitty-control chmod 755 ${HOME}/.local/bin/kitty-control # Fixup and copy nfetch script [ -f "${SCRIPT_PATH}"/bin/nfetch ] && { cat "${SCRIPT_PATH}"/bin/nfetch | \ sed -e "s/__SIZE__/${icon_size}/g" \ -e "s/__PLATFORM__/${icon_name}/" > ${HOME}/.local/bin/nfetch chmod 755 ${HOME}/.local/bin/nfetch rm -f ${HOME}/.local/bin/ffetch ln -s ${HOME}/.local/bin/nfetch ${HOME}/.local/bin/ffetch } install_config "${HOME}/.config/kitty" [ "${KITTY_CONFIG_DIRECTORY}" ] && { [ "${KITTY_CONFIG_DIRECTORY}" == "${HOME}/.config/kitty" ] || { install_config "${KITTY_CONFIG_DIRECTORY}" if [ "${darwin}" ]; then [ -f "${KITTY_CONFIG_DIRECTORY}/kitty.app.icns" ] || { install_kicon "${KITTY_CONFIG_DIRECTORY}"/kitty.app.icns } else [ -f "${KITTY_CONFIG_DIRECTORY}"/kitty.app.png ] || { install_kicon "${KITTY_CONFIG_DIRECTORY}"/kitty.app.png } fi } } [ -d ${HOME}/.local/share ] || mkdir -p ${HOME}/.local/share [ -d ${HOME}/.local/share/man ] || mkdir -p ${HOME}/.local/share/man [ -d ${HOME}/.local/share/man/man1 ] || mkdir -p ${HOME}/.local/share/man/man1 cp -p "${SCRIPT_PATH}"/man/man1/* ${HOME}/.local/share/man/man1 # Install Figlet Fonts used by kitty-control FDEST="${HOME}/.local/share/figlet-fonts" [ -d ${HOME}/.local/share ] || mkdir -p ${HOME}/.local/share [ -d ${FDEST} ] || mkdir -p ${FDEST} for ff in "${SCRIPT_PATH}"/figlet-fonts/* do [ "${ff}" == "${SCRIPT_PATH}/figlet-fonts/*" ] && continue bn=$(basename "${ff}") [ -f "${FDEST}/${bn}" ] && continue cp "${ff}" ${FDEST} chmod 644 "${FDEST}/${bn}" done chmod 755 ${FDEST}/*.sh # Install fzf fuzzy finder [ -f ${HOME}/.local/bin/fzf ] && { mv ${HOME}/.local/bin/fzf ${HOME}/.local/bin/fzf-bak$$ } [ "${have_fzf}" ] || { printf "\nInstalling fzf fuzzy finder\n" [ -d ${HOME}/.fzf ] && mv ${HOME}/.fzf ${HOME}/.fzf$$ git clone --depth 1 https://github.com/junegunn/fzf.git \ ${HOME}/.fzf >/dev/null 2>&1 [ -f ${HOME}/.fzf/install ] && chmod 755 ${HOME}/.fzf/install [ -x ${HOME}/.fzf/install ] && ${HOME}/.fzf/install --all >/dev/null 2>&1 } if [ -f ${HOME}/.fzf/bin/fzf ]; then ln -s ${HOME}/.fzf/bin/fzf ${HOME}/.local/bin/fzf rm -f ${HOME}/.local/bin/fzf-bak$$ else [ -f ${HOME}/.local/bin/fzf-bak$$ ] && { mv ${HOME}/.local/bin/fzf-bak$$ ${HOME}/.local/bin/fzf } fi # Install rich cli [ "${have_rich}" ] || { [ "${have_python}" ] && { printf "\nInstalling rich-cli fancy output toolbox\n" [ -f ${HOME}/.venv/bin/activate ] || { python3 -m venv ${HOME}/.venv >/dev/null 2>&1 } [ -f ${HOME}/.venv/bin/activate ] && source ${HOME}/.venv/bin/activate [ -x ${HOME}/.venv/bin/python ] && { ${HOME}/.venv/bin/python -m pip install rich-cli >/dev/null 2>&1 [ -x ${HOME}/.venv/bin/rich ] && { ln -s ${HOME}/.venv/bin/rich ${HOME}/.local/bin/rich } } } } # Use a nicer Kitty icon printf "\nInstalling nicer Kitty icons\n" if [ "${darwin}" ]; then APP="/Applications/kitty.app/Contents/Resources/kitty/logo" icon="${APP}"/kitty.png SUDO= [ -w "${APP}" ] || SUDO="sudo" [ -f "${SCRIPT_PATH}"/icons/kitty-256.png ] && { if [ -f ${icon} ]; then diff "${icon}" "${SCRIPT_PATH}"/icons/kitty-256.png >/dev/null || { ${SUDO} cp "${icon}" "${icon}.bak" ${SUDO} cp "${SCRIPT_PATH}"/icons/kitty-256.png "${icon}" } else APPDIR=$(dirname "${icon}") [ -d ${APPDIR} ] && ${SUDO} cp "${SCRIPT_PATH}"/icons/kitty-256.png "${icon}" fi } icon="${APP}/kitty-128.png" [ -f "${SCRIPT_PATH}"/icons/kitty-128.png ] && { if [ -f ${icon} ]; then diff "${icon}" "${SCRIPT_PATH}"/icons/kitty-128.png >/dev/null || { ${SUDO} cp "${icon}" "${icon}.bak" ${SUDO} cp "${SCRIPT_PATH}"/icons/kitty-128.png "${icon}" } else APPDIR=$(dirname "${icon}") [ -d ${APPDIR} ] && ${SUDO} cp "${SCRIPT_PATH}"/icons/kitty-128.png "${icon}" fi } else APP="${HOME}/.local/kitty.app" for icon in ${APP}/lib/kitty/logo/kitty.png \ ${APP}/share/icons/hicolor/256x256/apps/kitty.png do [ -f "${SCRIPT_PATH}"/icons/kitty-256.png ] && { if [ -f ${icon} ]; then diff "${icon}" "${SCRIPT_PATH}"/icons/kitty-256.png >/dev/null || { cp "${icon}" "${icon}.bak" cp "${SCRIPT_PATH}"/icons/kitty-256.png "${icon}" } else APPDIR=$(dirname "${icon}") [ -d ${APPDIR} ] && cp "${SCRIPT_PATH}"/icons/kitty-256.png "${icon}" fi } done icon="${APP}/lib/kitty/logo/kitty-128.png" [ -f "${SCRIPT_PATH}"/icons/kitty-128.png ] && { if [ -f ${icon} ]; then diff "${icon}" "${SCRIPT_PATH}"/icons/kitty-128.png >/dev/null || { cp "${icon}" "${icon}.bak" cp "${SCRIPT_PATH}"/icons/kitty-128.png "${icon}" } else APPDIR=$(dirname "${icon}") [ -d ${APPDIR} ] && cp "${SCRIPT_PATH}"/icons/kitty-128.png "${icon}" fi } fi # Kitty session desktop file icon ICON_DIR="${HOME}/.local/share/icons/hicolor/256x256/apps" [ -d "${ICON_DIR}" ] || mkdir -p "${ICON_DIR}" [ -f "${SCRIPT_PATH}"/icons/kitty-256.png ] && { [ -f "${ICON_DIR}"/kitty.png ] || { cp "${SCRIPT_PATH}"/icons/kitty-256.png "${ICON_DIR}"/kitty.png } } # Kitty session desktop file APP_DIR="${HOME}/.local/share/applications" [ -d "${APP_DIR}" ] || mkdir -p "${APP_DIR}" [ -f "${SCRIPT_PATH}"/kitty-session.desktop ] && { [ -f "${APP_DIR}"/kitty-session.desktop ] || { cp "${SCRIPT_PATH}"/kitty-session.desktop "${APP_DIR}"/kitty-session.desktop } } # Kitty session startup file SES_DIR="${HOME}/.config/kitty/sessions" [ -d "${SES_DIR}" ] || mkdir -p "${SES_DIR}" for start in startup startup-bash; do [ -f "${SCRIPT_PATH}"/config/sessions/${start} ] && { [ -f "${SES_DIR}"/${start} ] || { cp "${SCRIPT_PATH}"/config/sessions/${start} "${SES_DIR}"/${start} } } done # Additional icons ICON_DIR="${HOME}/.local/share/icons/hicolor/512x512/apps" [ -d "${ICON_DIR}" ] || mkdir -p "${ICON_DIR}" [ -f "${SCRIPT_PATH}"/icons/kitty-512.png ] && { [ -f "${ICON_DIR}"/kitty.png ] || { cp "${SCRIPT_PATH}"/icons/kitty-512.png "${ICON_DIR}"/kitty.png } } for icon in alpine.png apple-logo.png arch.png centos.png debian.png \ fedora.png opensuse.png rocky.png tux.png ubuntu.png void.png do [ -f "${SCRIPT_PATH}"/icons/${icon} ] && { cp "${SCRIPT_PATH}"/icons/${icon} "${ICON_DIR}"/${icon} } done for size in "256" "384" do ICON_DIR="${HOME}/.local/share/icons/hicolor/${size}x${size}/apps" [ -d "${ICON_DIR}" ] || mkdir -p "${ICON_DIR}" for icon in alpine apple-logo arch centos debian \ fedora opensuse rocky tux ubuntu void do [ -f "${SCRIPT_PATH}"/icons/${icon}-${size}.png ] && { cp "${SCRIPT_PATH}"/icons/${icon}-${size}.png "${ICON_DIR}"/${icon}.png } done done # Install JetBrains Mono font if [ "${darwin}" ]; then usr_font_dir="${HOME}/Library/Fonts" else usr_font_dir="${HOME}/.local/share/fonts" fi JB_FONT="NerdFonts/JetBrains Mono Bold Nerd Font Complete.ttf" [ -f "${usr_font_dir}/${JB_FONT}" ] || install_fonts # Fastfetch configuration FAST_DIR="${HOME}/.config/fastfetch" [ -d "${FAST_DIR}" ] || mkdir -p "${FAST_DIR}" for cfg in ${SCRIPT_PATH}/fastfetch/config* do [ "${cfg}" == "${SCRIPT_PATH}/fastfetch/config*" ] && continue ncfg=$(basename "${cfg}") if [ -f "${FAST_DIR}"/${ncfg} ]; then [ "${force}" ] && { cat "${SCRIPT_PATH}"/fastfetch/${ncfg} | \ sed -e "s/__KITTY__/${fast_type}/" \ -e "s/__SIZE__/${icon_size}/g" \ -e "s/__PLATFORM__/${icon_name}/" > "${FAST_DIR}"/${ncfg} } else cat "${SCRIPT_PATH}"/fastfetch/${ncfg} | \ sed -e "s/__KITTY__/${fast_type}/" \ -e "s/__SIZE__/${icon_size}/g" \ -e "s/__PLATFORM__/${icon_name}/" > "${FAST_DIR}"/${ncfg} fi done # Neofetch configuration NEOF_DIR="${HOME}/.config/neofetch" [ -d "${NEOF_DIR}" ] || mkdir -p "${NEOF_DIR}" for cfg in ${SCRIPT_PATH}/neofetch/config* do [ "${cfg}" == "${SCRIPT_PATH}/neofetch/config*" ] && continue ncfg=$(basename "${cfg}") if [ -f "${NEOF_DIR}"/${ncfg} ]; then [ "${force}" ] && { cp "${SCRIPT_PATH}"/neofetch/${ncfg} "${NEOF_DIR}"/${ncfg} } else cp "${SCRIPT_PATH}"/neofetch/${ncfg} "${NEOF_DIR}"/${ncfg} fi done printf "\nInstallation of kitty-control complete ✨ 🌟 ✨\n" printf "\nSee ${REPO_URL}#readme\n\n"