平时阅读或浏览网站,遇到好的句子我都会给保存下来,以方便有空时翻出来看看。
现在一共保存了将近 1600 条了,全在我的公众号里。如果你需要,只要关注公众号 logically,回复 0
或 o
,一句精美的话就出来了。
如果不想关注公众号,可以在你的**.bash_rc 或.zsh_rc**中加入以下函数,这样终端中也可以随机获取富有哲理性的小句子了:
function wx(){ local dot=~/.wx_logically [ ! -f $dot ] && openssl rand -base64 20 > $dot local user=`cat $dot` [ -z "$host" ] && local host="https://promise.rocks" if [ ! -t 0 ];then # read from stdin tput setaf 3;curl -s "${host}/logically/wx_web?user=${user}&msgId=${msgId}" --data-binary @-; else # read from args [ -z "$*" ] && echo Either a pipe or an arg is required. && return 1; tput setaf 3;curl -s "${host}/logically/wx_web?user=${user}&msgId=${msgId}" --data-binary "$*"; fi }
下面是终端效果图:
上述的 wx
函数还有一大功能,比如使用有道查词:
其它功能后续会再介绍,如果公众号关注的人多的话 😄
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于