Last active
March 29, 2019 03:35
-
-
Save rightson/2d60f41f81d9bedbf20be12d2f3a3006 to your computer and use it in GitHub Desktop.
A naive wrapper for xfreerdp v2.0.0 (with an example usage)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Assuming this script is put in the same folder with rdp.sh | |
host=<your-host-address> | |
user=<your-account> | |
password=<your-pwd> | |
cwd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
source $cwd/rdp.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $_ == $0 ]]; then | |
read -p "Host name: " host | |
read -p "User name: " user | |
read -sp "Password: " password | |
fi | |
if [ -z "$option_basic" ]; then | |
export option_basic="+clipboard" | |
else | |
export option_basic="+clipboard:$option_basic" | |
fi | |
if [ -z "$scale_ratio" ]; then | |
export scale_ratio=180 | |
fi | |
if [ -z "$option_display" ]; then | |
export option_display="/dynamic-resolution /scale:$scale_ratio /scale-desktop:$scale_ratio /scale-device:$scale_ratio +fonts" | |
export #option_display="/scale:$scale_ratio /scale-desktop:$scale_ratio /scale-device:$scale_ratio +fonts" | |
fi | |
if [ -z "$option_sound" ]; then | |
export option_sound="/sound" | |
fi | |
if [ -z "$option_async" ]; then | |
export #option_async="+async-input +async-update" | |
export #option_async="+async-update" | |
export option_async="" | |
fi | |
if [ -z "$option_lowbw" ]; then | |
export option_lowbw="$option_async -wallpaper -themes +compression /compression-level:2" | |
fi | |
export cmd="xfreerdp /v:$host /u:$user /p:$password $option_user $option_basic $option_display $option_lowbw $option_sound $*" | |
echo $cmd | sed "s/${password}/********/g" | |
$cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment