3 PATH=/sbin:/bin:/usr/bin
5 # Get the ID of the first active X11 session:
9 /^Session[0-9]+:$/ { uid = active = x11 = "" ; next }
10 { gsub(/'\''/, "", $3) }
11 $1 == "unix-user" { uid = $3 }
12 $1 == "active" { active = $3 }
13 $1 == "x11-display" { x11 = $3 }
14 active == "TRUE" && x11 != "" {
19 # Check that there is a power manager, otherwise shut down.
23 $1 == '$uid_session' &&
24 ($2 == "gnome-power-manager" || $2 == "kpowersave" || $2 == "xfce4-power-manager" || $2 ~ /dawati-power-icon/ ) \