Fix dmenu_run

This commit is contained in:
Alexander Rosenberg 2023-09-02 23:08:54 -07:00
parent d3c91e81bd
commit 3c0a4e549f
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 11 additions and 5 deletions

View File

@ -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"

View File

@ -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 <<EOF
shopt -s expand_aliases
$source_cmd
alias exec='exec '
exec $cmd
EOF