make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / xwin-tools / xosd
blob2cc4618bd521f37b578f5370ec627afc7a967b25
1 #!/bin/bash
3 if [ -z "$DISPLAY" ]
4 then
5 exit 1
6 fi
8 install -d $HOME/.osd -m 0700
10 socket=$HOME/.osd/${DISPLAY//:/_}.sock
12 if ! lsof -n -Fp $socket >/dev/null 2>/dev/null
13 then
14 socat UNIX-RECV:$socket,unlink-early EXEC:"osd_cat -c green -s 1 -S gray -o 32 -l 3 -d 4",nofork &
17 while true
19 if [ -n "$1" ]
20 then
21 socat - UNIX-SENDTO:$socket <<<"$@"
22 else
23 socat - UNIX-SENDTO:$socket
25 if [ $? = 0 ]
26 then
27 break
29 sleep 0.25
30 done