#!/bin/sh
#240401 sfs
pidof xss-lock && killall xss-lock
#p="$HOME/.config/power-man.conf"
p="/home/`w -h | awk '{print $1}'`/.config/power-man.conf"
[ -f "$p" ] || exit 0
. "$p"
SET(){
xset s $1 $1
xset dpms $1 $1 $1 
}

if [ "$1" = "--start" ] ;then
    SET $dpms
    [ "$dpms" = "0" ] && exit 0
    if [ "$pdpms" = "true" ] || [ "$psus" = "true" ] ;then
	e="$ssaver"
	[ "$ss" = "true" ] && e=suspend.sh
	xss-lock "$e" & 
    fi
fi

if [ "$1" = "--lock" ] ;then
    [ "$psus" = "true" ] && $ssaver 
    exit 0
fi
