X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Faxzshctl;h=32dd61a17577e83fd33f79faf33f235263eac478;hb=1b3bf551cb606722ebd80a8693e377d4caaf2107;hp=a75ebb3db750e0d483c1de6047bd4fd07d6ba3e4;hpb=15f0cf1b5813fb6b9159d71edcfcba952d57eecb;p=ax-zsh.git diff --git a/bin/axzshctl b/bin/axzshctl index a75ebb3..32dd61a 100755 --- a/bin/axzshctl +++ b/bin/axzshctl @@ -10,7 +10,7 @@ for dir ("$HOME/lib" "$HOME/.ax" /usr/local /opt/ax /usr); do ax_common="${dir}/lib/ax/ax-common.sh" [[ -r "$ax_common" ]] && source "$ax_common" done -if [[ -z "$ax_common_sourced" || axzsh_is_dumb_terminal ]]; then +if [[ -z "$ax_common_sourced" ]]; then function ax_msg { shift echo "$@" @@ -191,14 +191,8 @@ function EnableDefaultPlugins { function SetTheme { local link_name="$AXZSH/active_theme" - if [ $# -ne 1 ]; then - echo "Usage: axzsh_set_theme " - return 1 - fi - - rm -f "$link_name" || return 1 - if [ "$1" = "-" ]; then + rm -f "$link_name" || return 1 echo "Theme settings have been reset." return 0 fi @@ -212,6 +206,7 @@ function SetTheme { else # Look for theme inside of installed plugins: for dname ( + "$AXZSH/custom_themes" "$AXZSH/custom_plugins/"*(N) "$AXZSH/repos/"*(N) ); do @@ -228,7 +223,7 @@ function SetTheme { return 1 fi fi - ln -sv "$theme" "$link_name" || return 1 + ln -fsv "$theme" "$link_name" || return 1 return $? } @@ -377,8 +372,7 @@ case "$cmd" in ;; "enable-default-plugins") [[ $# -eq 0 ]] || Usage - EnableDefaultPlugins - UpdatePluginCache + EnableDefaultPlugins && UpdatePluginCache ;; "check-plugins") [[ $# -eq 0 ]] || Usage @@ -386,8 +380,7 @@ case "$cmd" in ;; "set-theme") [[ $# -eq 1 ]] || Usage - SetTheme "$1" - UpdatePluginCache + SetTheme "$1" && UpdatePluginCache ;; "upgrade") [[ $# -eq 0 ]] || Usage