diff --git a/dmenu_path b/dmenu_path index 48b56d1..9d53b37 100755 --- a/dmenu_path +++ b/dmenu_path @@ -1,7 +1,7 @@ #!/usr/bin/env bash config_file="$HOME/.config/dmenu/aliases" -[[ -e "$config_file" ]] && source "$config_file" +[ -e "$config_file" ] && source "$config_file" cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}" cache="$cachedir/dmenu_run" diff --git a/dmenu_run b/dmenu_run index a6af871..9c7a65e 100755 --- a/dmenu_run +++ b/dmenu_run @@ -1,8 +1,14 @@ #!/usr/bin/env bash -# dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} & -config_file="$HOME/.config/dmenu/aliases" +cmd="$(dmenu_path | dmenu "$@")" -[[ -e "$config_file" ]] && flags="--rcfile $config_file" +[ $? -ne 0 ] && exit 1 -dmenu_path | dmenu "$@" | echo "unset HISTFILE; $(cat)" | /usr/bin/env bash $flags -i >/dev/null 2>&1 +config_file="${XDG_CONFIG_HOME:-"${HOME}/.config"}/dmenu/aliases" +[ -f "$config_file" ] && source_cmd="source '$config_file'" +exec bash <