Make open support specifying program

This commit is contained in:
Sam A. 2022-07-18 16:04:45 +02:00
parent f9f9d2ade2
commit c5636a081c
Signed by: samsapti
GPG Key ID: CBBBE7371E81C4EA
1 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,11 @@ http() {
}
open() {
(( ${+commands[xdg-open]} )) || return 2
nohup xdg-open "$@" &> /dev/null & disown
if [[ $# -gt 1 ]] && (( ${+commands[$1]} )); then
nohup "$@" &> /dev/null & disown
else
(( ${+commands[xdg-open]} )) || return 2
nohup xdg-open "$@" &> /dev/null & disown
fi
}