Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A naive wrapper for xfreerdp v2.0.0 (with an example usage)
#!/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
#!/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
You can’t perform that action at this time.