Skip to content

Instantly share code, notes, and snippets.

@eugrus
Created April 20, 2026 10:42
Show Gist options
  • Select an option

  • Save eugrus/4c7c167459a9555359eec7c02a5759e2 to your computer and use it in GitHub Desktop.

Select an option

Save eugrus/4c7c167459a9555359eec7c02a5759e2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Prompt for inputs
read -rp "Server: " server
read -rp "Domain (leave empty if none): " domain
read -rp "Username: " user
read -rsp "Password: " password
echo
# Base command
cmd=(xfreerdp3 /f /dynamic-resolution)
# Add arguments
cmd+=("/v:$server")
cmd+=("/u:$user")
cmd+=("/p:$password")
cmd+=("/clipboard")
# Add domain only if provided
if [[ -n "$domain" ]]; then
cmd+=("/d:$domain")
fi
# Execute command
"${cmd[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment