#!/bin/sh
#241230 sfs
export TEXTDOMAIN=sfwbar-ext
m1="Bluetooth"
m2="$(gettext 'Timeout in seconds for non-interactive mode')"
#m2="Тайм-аут в секундах для \nнеинтерактивного режима"
ico=gtk-dialog-question
ini="$HOME/.config/sfwbar/sfwbar.ini"
[ "$blue" ] || blue=20

y="`yad  \
    --title "$m1" \
    --text "<b>$m1</b>\n$m2" \
    --form \
    --field=":NUM"  \
    --separator= --fixed \
    --height=140 --width=240 \
    --no-headers --image-on-top --image=$ico --window-icon=$ico --name=$ico \
  $blue `" 
  echo $y
[ "$y" ] || exit
[ "$y" = 0 ] && y=

if [ "`grep '^blue=' "$ini"`" ] ;then
    sed -i 's/^blue=.*/blue='$y'/' "$ini"  
else mkdir -p "`dirname "$ini"`" && echo "blue=$y" >> "$ini"
fi

killall -1 sfwbar