Permalink
Browse files

getProp: rewrite with sed

  • Loading branch information...
1 parent c660f3b commit 769b4a1d86eb8705782428eb25a307267c12bceb @falconindy committed Jul 31, 2010
Showing with 8 additions and 3 deletions.
  1. +8 −3 getProp
View
@@ -1,4 +1,9 @@
#!/bin/bash
-xprop |awk '
- /^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
- /^WM_NAME/{sub(/.* =/, "title:"); print}'
+
+#xprop |awk '
+# /^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print}
+# /^WM_NAME/{sub(/.* =/, "title:"); print}'
+
+xprop | sed -n '
+ /^WM_CLASS/s/.* = "\(.*\)", "\(.*\)"/instance: \1\nclass: \2/p;
+ /^WM_NAME/s/.* = "\(.*\)"/title: \1/p'

0 comments on commit 769b4a1

Please sign in to comment.