tazpanel rev 555

index.cgi: fix non root user file_selection
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 25 10:29:26 2015 +0100 (2015-11-25)
parents 9860696beace
children 694b20d6963c
files index.cgi
line diff
     1.1 --- a/index.cgi	Mon Nov 23 12:08:42 2015 +0100
     1.2 +++ b/index.cgi	Wed Nov 25 10:29:26 2015 +0100
     1.3 @@ -88,11 +88,20 @@
     1.4  preview		--add-preview
     1.5  EOT
     1.6  			header
     1.7 -			cat <<EOT
     1.8 +			cd ${HOME:-/}
     1.9 +			if [ -r $HOME/.Xauthority ]; then
    1.10 +				cat <<EOT
    1.11 +<input type="text" name="$(GET name)" value="$(DISPLAY=':0.0' \
    1.12 +yad --file-selection --on-top --mouse $extra \
    1.13 +--width=500 --height=350 --title="$title")" />
    1.14 +EOT
    1.15 +			else
    1.16 +				cat <<EOT
    1.17  <input type="text" name="$(GET name)" value="$(DISPLAY=':0.0' \
    1.18  XAUTHORITY='/var/run/slim.auth' yad --file-selection --on-top --mouse $extra \
    1.19  --width=500 --height=350 --title="$title")" />
    1.20  EOT
    1.21 +			fi
    1.22  			exit 0 ;;
    1.23  
    1.24  		esac