Created
August 6, 2013 15:03
-
-
Save MartinSeeler/6165281 to your computer and use it in GitHub Desktop.
some sed and grep games to extract screen dimensions
This file contains 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 | |
screen_dim=$(xdpyinfo | grep dimension | awk '{print $2}') | |
echo "screen size is $screen_dim" | |
screen_dim_x=$(echo ${screen_dim} | sed -e 's/x/\n/g' | sed -n '1p' ) | |
screen_dim_y=$(echo ${screen_dim} | sed -e 's/x/\n/g' | sed -n '2p' ) | |
echo "screen width is $screen_dim_x" | |
echo "screen height is $screen_dim_y" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment