Fix bash-completions dir
Add color to autostart-manage info
This commit is contained in:
parent
056b7fc89e
commit
ef3602167e
2 changed files with 21 additions and 4 deletions
|
@ -33,8 +33,11 @@ then
|
||||||
if [ -n "$completions" ]
|
if [ -n "$completions" ]
|
||||||
then
|
then
|
||||||
echo "Installing completions for $exe"
|
echo "Installing completions for $exe"
|
||||||
# shellcheck disable=SC2086
|
|
||||||
"$target" $completions > "$XDG_CONFIG_HOME/completionsrc.d/_$(basename "$exe")"
|
# path taken from "__load_completion" function
|
||||||
|
bash_completions_dir=${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions
|
||||||
|
mkdir -p "$bash_completions_dir"
|
||||||
|
eval "$target $completions" > "$bash_completions_dir/_$(basename "$exe")"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,24 @@ _autostart_run_graphical () {
|
||||||
_echo_table () {
|
_echo_table () {
|
||||||
for unit in "$@"
|
for unit in "$@"
|
||||||
do
|
do
|
||||||
|
if _systemctl "$unit" is-enabled --quiet
|
||||||
|
then
|
||||||
|
_enabled=$(green "enabled")
|
||||||
|
else
|
||||||
|
_enabled=$(red "disabled")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if _systemctl "$unit" is-active --quiet
|
||||||
|
then
|
||||||
|
_active=$(green "active")
|
||||||
|
else
|
||||||
|
_active=$(red "inactive")
|
||||||
|
fi
|
||||||
|
|
||||||
printf "%s\t%s\t%s\t%s\n" \
|
printf "%s\t%s\t%s\t%s\n" \
|
||||||
"$unit" \
|
"$unit" \
|
||||||
"$(_systemctl "$unit" is-enabled)" \
|
"$_enabled" \
|
||||||
"$(_systemctl "$unit" is-active)" \
|
"$_active" \
|
||||||
"$(_get_autostart_cmd "$unit")"
|
"$(_get_autostart_cmd "$unit")"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue