3 PATH=/bin:/usr/bin:/sbin:/usr/sbin
5 if [ "$XDG_RUNTIME_DIR" = "" ]; then
6 export XDG_RUNTIME_DIR=/run
9 WINFO_RUN_DIR="$XDG_RUNTIME_DIR/pepper"
11 if [ ! -d "$WINFO_RUN_DIR" ]; then
12 echo "Error: no ${WINFO_RUN_DIR} directory exist."
20 echo "Usage> # winfo {command}"
22 echo " Supported commands:"
24 echo " protocol_trace_on (turn on wayland protocol trace)"
25 echo " protocol_trace_off (turn off wayland protocol trace)"
26 echo " stdout (redirect STDOUT to a file : /run/pepper/stdout.txt)"
27 echo " stderr (redirect STDERR to a file : /run/pepper/stderr.txt)"
28 echo " keygrab_status"
31 echo " connected_clients (display connected clients info : pid, uid, gid, socket fd)"
32 echo " reslist (display resources info of the connected clients"
33 echo " help (display this help message)"
35 echo " To execute commands, just create/remove/update a file with the commands above."
36 echo " Please refer to the following examples."
38 echo " # winfo protocol_trace_on : enable event trace"
39 echo " # winfo protocol_trace_off : disable event trace"
40 echo " # winfo stdout : redirect STDOUT"
41 echo " # winfo stderr : redirect STDERR"
42 echo " # winfo keygrab_status : display keygrab status"
43 echo " # winfo keymap : display keymap"
44 echo " # winfo topvwins : display top/visible window stack"
45 echo " # winfo connected_clients : display connected clients information"
46 echo " # winfo reslist : display each resources information of connected clients"
47 echo " # winfo help : display this help message"
51 if [ "$1" = "" ]; then
58 rm -f ${CMD} ; touch ${CMD}