Skip to content

Commit

Permalink
getProp: rewrite with sed
Browse files Browse the repository at this point in the history
  • Loading branch information
falconindy committed Jul 31, 2010
1 parent c660f3b commit 769b4a1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions getProp
Original file line number Diff line number Diff line change
@@ -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.