add dict
This commit is contained in:
+11
-2
@@ -1,4 +1,4 @@
|
|||||||
|
source bash_tools/helper.sh
|
||||||
# args:
|
# args:
|
||||||
# $1:
|
# $1:
|
||||||
# The IP address you want to query geo info for.
|
# The IP address you want to query geo info for.
|
||||||
@@ -24,6 +24,16 @@ function odict(){
|
|||||||
curl dict://dict.org/d:"${1}"
|
curl dict://dict.org/d:"${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# self host directory
|
||||||
|
function dict(){
|
||||||
|
local api_str="http://$SERVERIP:10008/$1"
|
||||||
|
if ! hash python; then
|
||||||
|
curl "$api_str"
|
||||||
|
else
|
||||||
|
curl -s "$api_str" | python -m json.tool
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Linux specific functions
|
# Linux specific functions
|
||||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
@@ -37,7 +47,6 @@ function set_wallpaper(){
|
|||||||
gsettings set org.gnome.desktop.background picture-uri file://$file
|
gsettings set org.gnome.desktop.background picture-uri file://$file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mac OSX specific functions
|
# Mac OSX specific functions
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
SERVERIP=x.useless.pw
|
||||||
|
ip=$(ifconfig | grep -Po 10.0.0.[01][0-9]+)
|
||||||
|
[ "$ip" != "" ] && SERVERIP=10.0.0.100
|
||||||
Reference in New Issue
Block a user