wok diff xorg-xset/stuff/xset-screensaver.sh @ rev 18927

Add lz5 (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Feb 25 15:56:04 2016 +0100 (2016-02-25)
parents 11bd286c39d2
children
line diff
     1.1 --- a/xorg-xset/stuff/xset-screensaver.sh	Sat Oct 24 23:56:53 2015 +0200
     1.2 +++ b/xorg-xset/stuff/xset-screensaver.sh	Thu Feb 25 15:56:04 2016 +0100
     1.3 @@ -1,8 +1,12 @@
     1.4  #!/bin/sh
     1.5  #
     1.6 +[ -z $(which yad) ] && exec yad && exit 0
     1.7 +
     1.8  case $(id -u) in
     1.9  	0) path=/etc/xdg ;;
    1.10 -	*) path=${XDG_CONFIG_HOME:-$HOME/.config} ;;
    1.11 +	*) path=${XDG_CONFIG_HOME:-$HOME/.config}
    1.12 +		[ -f "$path/autostart" ] && mv $path/autostart $path/autostart.bak
    1.13 +		[ -d "$path/autostart" ] || mkdir -p $path/autostart ;;
    1.14  esac
    1.15  
    1.16  AutostartFile="$path/autostart/xset-screensaver.desktop"
    1.17 @@ -17,12 +21,15 @@
    1.18  
    1.19  case $LC_ALL in
    1.20  	C|POSIX|en*) lang='=' ;;
    1.21 -	*) lang='\['${LC_ALL%_*} ;;
    1.22 +	*) lang='\['${LC_ALL%_*}
    1.23 +	grep -q '\['${LC_ALL%_*} $launcher || lang='=' ;;
    1.24  esac
    1.25  
    1.26 -val=$(yad --title="$(cat $launcher | grep Name$lang | cut -d= -f2)" \
    1.27 -	--scale --max-value=18000 --mark=1h.:3600 \
    1.28 -	--mark="$(cat $launcher | grep Comment$lang | cut -d= -f2)":0 \
    1.29 +
    1.30 +
    1.31 +val=$(yad --title="$(cat $launcher | grep Name$lang | cut -d'=' -f2)" \
    1.32 +	--scale --max-value=18000 --mark="1h.":3600 --buttons-layout=spread \
    1.33 +	--mark="$(cat $launcher | grep Comment$lang | cut -d'=' -f2 | cut -d',' -f1)":0 \
    1.34  	--mark="120min.(2h.)":7200 --mark="180min.(3h.)":10800 \
    1.35  	--mark="240min.(4h.)":14400 --mark="300min.(5h.)":18000 \
    1.36  	--page=1800 --step=60 --geometry=630x42+10+100 \
    1.37 @@ -39,4 +46,4 @@
    1.38  exec_d
    1.39  
    1.40  # Notes: 'xset s' max val is 32767, 'xset dpms' limit is unknown
    1.41 -exit 0
    1.42 \ No newline at end of file
    1.43 +exit 0