You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
I wanted to override the colors used in pfetch with truecolor escape sequences. I tried doing so while not modifying pfetch's code so I used PF_SOURCE but the palette was being set AFTER sourcing my script.
One option is to move the sourcing of the script to after the colors have been set.
Another one is to add a check and skip setting colors that are already set:
The regex is wrong. It will count everything until the last m it finds, I think.
I fixed it by using
's/�\[[0-9;]*m//g'
Escape codes can use only numbers and semicolons, right? I think some other symbols can be used but those could be easily added into the regex, or someone with a little bit more knowledge could make it count only until the first 'm' it finds.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I wanted to override the colors used in pfetch with truecolor escape sequences. I tried doing so while not modifying pfetch's code so I used PF_SOURCE but the palette was being set AFTER sourcing my script.
One option is to move the sourcing of the script to after the colors have been set.
Another one is to add a check and skip setting colors that are already set:
However I am not sure if
${!_c}
is POSIX sh. Also, it's possible there's a better way to do it.It works with this on my PF_SOURCE script:
c4="${esc_c}[38;2;255;0;0m"
Although it also needs this change to https://github.com/dylanaraps/pfetch/blob/master/pfetch#L1827 so that it doesn't count the extra characters in the escape sequence:
$(printf %s "$ascii" | sed 's/�\[3.*m//g')
The text was updated successfully, but these errors were encountered: