You are not logged in.
Hello.
I've created a post transaction hook to clear the pacman cache using the paccache script as suggested here: https://wiki.archlinux.org/index.php/pa … kage_cache
When using the script directly it returns messages with color.
Is there anyway to keep the colored output when the script is used in a hook?
Thanks.
Last edited by unnilquadium (2017-09-04 13:16:30)
Offline
see --color in `man pacman`.
EDIT: oops, the section you linked to first had pacman commands, but you said you are using paccache - that likely has similar flags - (edit2) or maybe not. It seems this is hardcoded into the script starting on line 475. But it is just a script, you could readily edit that block (from 475-493).
Last edited by Trilby (2017-09-04 10:56:47)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
ok, it worked by editing that section and leaving it like this:
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
ALL_OFF="$(tput sgr0)"
BOLD="$(tput bold)"
BLUE="${BOLD}$(tput setaf 4)"
GREEN="${BOLD}$(tput setaf 2)"
RED="${BOLD}$(tput setaf 1)"
YELLOW="${BOLD}$(tput setaf 3)"
readonly ALL_OFF BOLD BLUE GREEN RED YELLOWThanks
Offline
You can always submit a patch to pacman-contrib to accept --color=[always|auto|never] or similar. ![]()
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline