3 [ -x ./xowner ] || make
7 OWNER_ID=$(./xowner $1)
8 if [ $OWNER_ID != "0x0" ];
11 xwininfo -id $OWNER_ID > /dev/null 2>&1;
14 OWNER_NAME=$(xprop -id $OWNER_ID | grep "^WM_NAME" | cut -d ' ' -f 3-)
15 if [ -n "$OWNER_NAME" ];
17 OWNER="$OWNER $OWNER_NAME"
19 PARENT_ID=$(xwininfo -children -id $OWNER_ID | sed -n -e '/Parent window id:/s/.*window id: \([^ ]*\) .*$/\1/p')
20 if [ -n "$PARENT_ID" ];
22 OWNER="$OWNER children of $PARENT_ID"
24 PARENT_NAME=$(xprop -id $PARENT_ID | grep "^WM_NAME" | cut -d ' ' -f 3-)
25 if [ -n "$PARENT_NAME" ];
27 OWNER="$OWNER $PARENT_NAME"
31 echo -n " owned by $OWNER"
40 xclip -out -selection primary 2> /dev/null
45 xclip -out -selection secondary 2> /dev/null
50 xclip -out -selection clipboard 2> /dev/null
54 get_owner "CUT_BUFFER0"