1
0
mirror of https://github.com/Mayccoll/Gogh.git synced 2023-08-10 21:12:46 +03:00

adding support for foot terminal (https://codeberg.org/dnkl/foot)

This commit is contained in:
pfuender 2021-08-05 22:02:31 +02:00 committed by Raphael Hoegger
parent e40138dfea
commit b7739b8ee8

View File

@ -110,6 +110,14 @@ case "${TERMINAL}" in
fi fi
;; ;;
foot )
CFGFILE="${HOME}/.config/foot/foot.ini"
if [[ ! -f "${CFGFILE}" ]]; then
printf '\n%s\n' "Error: Couldn't find an existing configuration file."
exit 1
fi
;;
esac esac
@ -170,6 +178,14 @@ updateMinttyConfig () {
sed -i -r -e "s/^${name}=.+/$(createMinttyEntry "${name}" "${color}")/g" "${config}" sed -i -r -e "s/^${name}=.+/$(createMinttyEntry "${name}" "${color}")/g" "${config}"
} }
updateFootConfig () {
local config="${1}"
local color="${2}"
local name="${3}"
sed -i -r -e "s/^${name}=.+/${name}=${color/\#/}/g" "${config}"
}
convertNameAndRGBtoITerm() { convertNameAndRGBtoITerm() {
local name="${1}" local name="${1}"
local color="${2}" local color="${2}"
@ -428,6 +444,38 @@ apply_alacritty() {
} }
apply_foot() {
# |
# | Applying values on foot
# | ===========================================
echo "Patching foot configuration file (${CFGFILE}) with new colors..."
updateFootConfig "$CFGFILE" "$COLOR_01" "regular0"
updateFootConfig "$CFGFILE" "$COLOR_02" "regular1"
updateFootConfig "$CFGFILE" "$COLOR_03" "regular2"
updateFootConfig "$CFGFILE" "$COLOR_04" "regular3"
updateFootConfig "$CFGFILE" "$COLOR_05" "regular4"
updateFootConfig "$CFGFILE" "$COLOR_06" "regular5"
updateFootConfig "$CFGFILE" "$COLOR_07" "regular6"
updateFootConfig "$CFGFILE" "$COLOR_08" "regular7"
updateFootConfig "$CFGFILE" "$COLOR_09" "bright0"
updateFootConfig "$CFGFILE" "$COLOR_10" "bright1"
updateFootConfig "$CFGFILE" "$COLOR_11" "bright2"
updateFootConfig "$CFGFILE" "$COLOR_12" "bright3"
updateFootConfig "$CFGFILE" "$COLOR_13" "bright4"
updateFootConfig "$CFGFILE" "$COLOR_14" "bright5"
updateFootConfig "$CFGFILE" "$COLOR_15" "bright6"
updateFootConfig "$CFGFILE" "$COLOR_16" "bright7"
updateFootConfig "$CFGFILE" "$BACKGROUND_COLOR" "background"
updateFootConfig "$CFGFILE" "$FOREGROUND_COLOR" "foreground"
echo "Done - please reopen your foot terminal to see the changes"
}
apply_darwin() { apply_darwin() {
# | # |
# | Applying values on iTerm2 # | Applying values on iTerm2
@ -778,6 +826,10 @@ case "${TERMINAL}" in
apply_alacritty apply_alacritty
;; ;;
foot )
apply_foot
;;
* ) * )
printf '%s\n' \ printf '%s\n' \
"Unsupported terminal!" \ "Unsupported terminal!" \
@ -791,6 +843,7 @@ case "${TERMINAL}" in
" gnome-terminal" \ " gnome-terminal" \
" tilix" \ " tilix" \
" xfce4-terminal" \ " xfce4-terminal" \
" foot" \
"" \ "" \
"If you believe you have recieved this message in error," \ "If you believe you have recieved this message in error," \
"try manually setting \`TERMINAL', hint: ps -h -o comm -p \$PPID" "try manually setting \`TERMINAL', hint: ps -h -o comm -p \$PPID"