Skip to content

Instantly share code, notes, and snippets.

@YellowApple
Last active March 21, 2019 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YellowApple/6e6134b7493485aa3e56f2556506b1d2 to your computer and use it in GitHub Desktop.
Save YellowApple/6e6134b7493485aa3e56f2556506b1d2 to your computer and use it in GitHub Desktop.
#!/bin/sh
width=$(window-size | awk '{print $3}')
height=$(window-size | awk '{print $4}')
server=$1; shift
xfreerdp /w:$width /h:$height /v:$server "$@"
#!/bin/bash
# Get the coordinates of the active window's
# top-left corner, and the window's size.
# This excludes the window decoration.
unset x y w h
eval $(xwininfo -id $(xdotool getactivewindow) |
sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
-e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
-e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
-e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" )
echo "$x $y $w $h"
#
# Stolen from https://unix.stackexchange.com/questions/14159/how-do-i-find-the-window-dimensions-and-position-accurately-including-decoration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment