tFetch screen size - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 410b952a54f95903999a4610240813e99f6c013b
(DIR) parent 751b9f94113497dcdace3e49b4ce86d792b3c944
(HTM) Author: z3bra <willy@mailoo.org>
Date: Fri, 4 Jul 2014 16:17:54 +0200
Fetch screen size
Diffstat:
A xscreen | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/xscreen b/xscreen
t@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# z3bra - (c) wtfpl 2014
+
+usage () {
+ cat <<EOF
+usage: $(basename $0) [-hptu]
+ -h : height of the screen
+ -w : width of the screen
+ -g : print full size (default)
+
+environment:
+ SCREEN : number of the screen to parse
+EOF
+}
+
+
+IFS='x' read w h <<< "$(xrandr | awk '/\*/ {print $1}' | sed -n ${SCREEN}p)"
+
+case $1 in
+ --help) usage ;;
+ -h) echo $h ;;
+ -w) echo $w ;;
+ *) echo ${w}x${h} ;;
+ esac