From: Samir Benmendil Date: Sun, 24 Aug 2014 10:48:12 +0000 (+0100) Subject: zsh: fix wake and move files to XDG_CONFIG_HOME X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/ba962d145dc39b5f9639c9896aede4140520bc8d?ds=inline zsh: fix wake and move files to XDG_CONFIG_HOME --- diff --git a/zsh/functions/_wake b/zsh/functions/_wake index 4ab10d3..3361232 100644 --- a/zsh/functions/_wake +++ b/zsh/functions/_wake @@ -1,4 +1,4 @@ #compdef wake #autoload -_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0 +_arguments "1:device to wake:_files -W '$XDG_CONFIG_HOME/wakeonlan'" && return 0 diff --git a/zsh/functions/wake b/zsh/functions/wake index 07f4493..0ca0c1c 100644 --- a/zsh/functions/wake +++ b/zsh/functions/wake @@ -29,16 +29,16 @@ # wakeonlan man page. function wake() { - local config_file="$HOME/.wakeonlan/$1" + local config_file="$XDG_CONFIG_HOME/wakeonlan/$1" if [[ ! -f "$config_file" ]]; then echo "ERROR: There is no configuration file at \"$config_file\"." return 1 fi - if (( ! $+commands[wakeonlan] )); then - echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?" + if (( ! $+commands[wol] )); then + echo "ERROR: Can't find \"wol\". Are you sure it's installed?" return 1 fi - wakeonlan -f "$config_file" + wol -f "$config_file" }