Created
September 8, 2020 09:54
-
-
Save derjohn/4e588bcc3ac734241d9130cee6f550ff to your computer and use it in GitHub Desktop.
rdp connect script with smart resizing and scaling (using xfreerdp v2 !)
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/sh | |
# Example usage RDPHOST=127.0.0.1 RDPPASS=foobar RDPUSER=admin rdp-connect.sh | |
if ! xfreerdp --version | grep -q 'version 2\.'; then echo "Please apt install freerdp2-x11"; exit 1; fi | |
RDPHOST=${1:-""} | |
RDPPASS=${RDPPASS:-""} | |
RDPUSER=${RDPUSER:-""} | |
RDPTITLE=${RDPTITLE:-"${RDPHOST}"} | |
RDPDRIVE=${RDPDRIVE:-'/tmp/'} | |
RDPPRINTER1=${RDPPRINTER1:-''} | |
RDPPRINTER2=${RDPPRINTER2:-''} | |
RDPSIZEREMOTE=${RDPSIZEREMOTE:-"1280x1024"} | |
RDPSIZELOCAL=${RDPSIZELOCAL:-"2560x2048"} | |
ADDARGS=${ADDARGS:-''} | |
xfreerdp +clipboard -wallpaper \ | |
/t:"${RDPTITLE}" \ | |
/size:"${RDPSIZEREMOTE}" /smart-sizing:"${RDPSIZELOCAL}" \ | |
/u:"${RDPUSER}" /p:"${RDPPASS}" /v:"${RDPHOST}" \ | |
/printer:"${RDPPRINTER1}" \ | |
/printer:"${RDPPRINTER2}" \ | |
/drive:"${RDPDRIVE}" ${ADDARGS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment