mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-09 12:27:50 -04:00
18 lines
334 B
Bash
18 lines
334 B
Bash
#!/bin/sh
|
|
|
|
SED="/usr/bin/sed"
|
|
CAT="/bin/cat"
|
|
|
|
dispnum=0
|
|
if [ ! -z "${DISPLAY}" ]; then
|
|
dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
|
|
fi
|
|
|
|
if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
|
|
echo "ERROR: Failed to find X lock file for display ${dispnum}"
|
|
exit 1
|
|
fi
|
|
pid=$(${CAT} "/tmp/.X${dispnum}-lock")
|
|
|
|
echo ${pid}
|