Make open a function
This commit is contained in:
parent
464ee6086a
commit
092a9d897d
|
@ -82,5 +82,4 @@ elif [[ $(uname -o) == "GNU/Linux" ]]; then
|
|||
alias mount="udisksctl mount -b"
|
||||
alias unlock="udisksctl unlock -b"
|
||||
alias unmount="udisksctl unmount -b"
|
||||
alias open="xdg-open"
|
||||
fi
|
||||
|
|
|
@ -32,11 +32,12 @@ doasedit() {
|
|||
}
|
||||
|
||||
get_ip() {
|
||||
local IP=""
|
||||
local ARGS=()
|
||||
(( ${+commands[curl]} )) || return 2
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
[[ $1 == --ip ]] && IP="?ip=$2" && shift || ARGS+=("$1")
|
||||
[[ $1 == --ip ]] \
|
||||
&& local IP="?ip=$2" && shift \
|
||||
|| local ARGS+=("$1")
|
||||
shift
|
||||
done
|
||||
|
||||
|
@ -46,7 +47,12 @@ get_ip() {
|
|||
|
||||
http() {
|
||||
(( ${+commands[python]} )) || return 2
|
||||
|
||||
eval "python -m http.server 8080 --bind 127.0.0.1 \
|
||||
$( [[ $# -gt 0 ]] && echo "--directory $1" )"
|
||||
}
|
||||
|
||||
open() {
|
||||
(( ${+commands[xdg-open]} )) || return 2
|
||||
nohup xdg-open $1 &> /dev/null &
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue