Refactor stuff
This commit is contained in:
parent
9fa15a26a5
commit
70af263278
|
@ -2,9 +2,13 @@ bt() {
|
|||
(( ${+commands[bluetoothctl]} )) || return 1
|
||||
|
||||
if [[ $1 == on ]]; then
|
||||
connmanctl enable bluetooth
|
||||
(( ${+commands[connmanctl]} )) \
|
||||
&& connmanctl enable bluetooth \
|
||||
|| bluetoothctl power on
|
||||
elif [[ $1 == off ]]; then
|
||||
connmanctl disable bluetooth
|
||||
(( ${+commands[connmanctl]} )) \
|
||||
&& connmanctl disable bluetooth \
|
||||
|| bluetoothctl power off
|
||||
else
|
||||
bluetoothctl "$@"
|
||||
fi
|
||||
|
@ -30,14 +34,14 @@ doasedit() {
|
|||
get_ip() {
|
||||
(( ${+commands[jq]} )) && local JQ="| jq"
|
||||
local IP=""
|
||||
local ARGS=""
|
||||
local ARGS=()
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
[[ $1 == --ip ]] && IP="?ip=$2" && shift || ARGS="$ARGS $1"
|
||||
[[ $1 == --ip ]] && IP="?ip=$2" && shift || ARGS+=("$1")
|
||||
shift
|
||||
done
|
||||
|
||||
eval "curl $ARGS -fsSL 'https://ifconfig.co/json$IP' $JQ"
|
||||
eval "curl ${ARGS[*]} -fsSL 'https://ifconfig.co/json$IP' $JQ"
|
||||
}
|
||||
|
||||
http() {
|
||||
|
|
Loading…
Reference in a new issue