-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
I sleuthed this from my Bluefin install. This is also the same as this reported issue: #365. The difference between that issue and this one is that I'm providing a fix to create an easy PR.
Basically, because the wrapper script at /usr/bin/ublue-fastfetch is run as a bash script and not the user's shell, fastfetch will still report bash as the shell. This is because, since there is a bash script being used as a wrapper, it's using bash to execute fastfetch. Fastfetch itself doesn't have a way to override what it sees the user's shell as. The fastfetch code looks at the shell that invoked it, and will use that as the shell. The fix for this is simple, just put exec in front of the fastfetch calls.
The full fixed script:
#!/usr/bin/bash
get_config() {
FASTFETCH_CONFIG_FILE="${FASTFETCH_CONFIG_FILE:-/etc/ublue-os/fastfetch.json}"
QUERY="$1"
FALLBACK="$2"
shift
shift
OUTPUT="$(jq -r "${QUERY}" "${FASTFETCH_CONFIG_FILE}" 2>/dev/null || echo "${FALLBACK}")"
if [ "${OUTPUT}" == "null" ] ; then
echo "${FALLBACK}"
return
fi
echo "${OUTPUT}"
}
FASTFETCH_CONFIG="$(get_config '."fastfetch-config"' "/usr/share/ublue-os/fastfetch.jsonc")"
SHUFFLE_LOGO="$(get_config '."shuffle-logo"' "false")"
LOGO_DIRECTORY="$(get_config '."logo-directory"' "/usr/share/ublue-os/fastfetch")"
export DEFAULT_THEME # Gets passed to `ublue-bling-fastfetch`
DEFAULT_THEME="$(get_config '."default-theme"' "slate")"
if [ "$SHUFFLE_LOGO" == "true" ] ; then
FETCH_LOGO="$(find "$LOGO_DIRECTORY" -type f | shuf -n 1)"
exec fastfetch --logo "$FETCH_LOGO" --color "$(ublue-bling-fastfetch)" --config "${FASTFETCH_CONFIG}" "${@}"
else
exec fastfetch --color "$(ublue-bling-fastfetch)" --config "${FASTFETCH_CONFIG}" "${@}"
fiBelow is the diff:
25c25
< fastfetch --logo "$FETCH_LOGO" --color "$(ublue-bling-fastfetch)" --config "${FASTFETCH_CONFIG}" "${@}"
---
> exec fastfetch --logo "$FETCH_LOGO" --color "$(ublue-bling-fastfetch)" --config "${FASTFETCH_CONFIG}" "${@}"
27c27
< fastfetch --color "$(ublue-bling-fastfetch)" --config "${FASTFETCH_CONFIG}" "${@}"
---
> exec fastfetch --color "$(ublue-bling-fastfetch)" --config "${FASTFETCH_CONFIG}" "${@}"
29,30d28
<
< Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels