commit f65469a59ab64b7e030f5e4b785450de7f4f1092 Author: Stefan Tomanek Date: Tue Oct 26 16:15:57 2010 +0200 add basic awk scripts diff --git a/conf.awk b/conf.awk new file mode 100644 index 0000000..f7df401 --- /dev/null +++ b/conf.awk @@ -0,0 +1,18 @@ +#!/usr/bin/awk + +/^[^ ]+ disconnected / { + OUTPUT[$1] = "--off"; +} + +/^[^ ]+ connected / { + split($3, A, "+"); + OUTPUT[$1] = "--mode "A[1]" --pos "A[2]"x"A[3]; +} + +END { + printf "xrandr "; + for (O in OUTPUT) { + printf "--output " O " " OUTPUT[O] " "; + } + printf "\n"; +} diff --git a/fp.awk b/fp.awk new file mode 100644 index 0000000..5d0f497 --- /dev/null +++ b/fp.awk @@ -0,0 +1,15 @@ +#!/usr/bin/awk +/^[^ ]+ (dis)?connected / { + DEV=$1; + ID[DEV] = ""; +} + +$1 ~ /^[a-f0-9]+$/ { + ID[DEV] = ID[DEV] $1 +} + +END { + for (X in ID) { + print X " " ID[X]; + } +}