很多時候,rdesktop缺乏一個好用的遠程管理連接,不用每次輸入ip地址、密碼,bitbar正好滿足了這個需求。

image.png
~/Documents/rdesktop.txt樣式如下:
Host JSWP風力發(fā)電網(wǎng) rdesktop -g 1024x768 -u administrator -p mypassword -r clipboard:CLIPBOARD 210.2.2.2
bitbar調(diào)用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