很多时候,rdesktop缺乏一个好用的远程管理连接,不用每次输入ip地址、密码,bitbar正好满足了这个需求。
~/Documents/rdesktop.txt样式如下:
Host JSWP风力发电网 rdesktop -g 1024x768 -u administrator -p mypassword -r clipboard:CLIPBOARD 210.2.2.2
bitbar调用rdesktop进行远程连接
#!/usr/bin/env bash
#
# Quickly rdesktop to your favorite hosts
# The list of hosts are extracted from ~/Documents/rdesktop.txt
#
# <bitbar.title>rdesktop</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Jianhui</bitbar.author>
# <bitbar.author.github>zhangyc</bitbar.author.github>
# <bitbar.desc>Quickly rdesktop to your favorite hosts listed in your ~/Documents/rdesktop.txt file</bitbar.desc>
#
echo "微软远程"
echo "---"
awk '/^Host / && !/\*/ {print " echo \"rdesktop -g 1024x768 -r clipboard:CLIPBOARD -u administrator -p "$9,$12" \">/tmp/rdesktop_"$12 }' ~/Documents/rdesktop.txt | bash
chmod +x /tmp/rdesktop_*
awk '/^Host / && !/\*/ {print $2" | bash=/tmp/rdesktop_"$12" | terminal=true | refresh=true" }' ~/Documents/rdesktop.txt