Simple Counter not possible?

12 views
Skip to first unread message

dirkullri...@gmx.de

unread,
Aug 26, 2025, 5:11:21 PM (14 days ago) Aug 26
to yad-common
I want to create a simple bash-script with yad as a counter:

if a button is pressed, the number in a textfield (or similar) shall increment by 1(from zero).

but it shall only use  1 yad-window at all, which is not built new at any time i click the button.

no matter what i try - with files, file-descriptors, chatGPT -
i am not able to implement this! there must be a solution, pls help!

greetings

Ken

unread,
Aug 26, 2025, 6:23:37 PM (14 days ago) Aug 26
to yad-c...@googlegroups.com
#!/bin/bash
while true; do
if [ $1 ]
then
    date1=`date +%s`+$1;
else
    date1=`date +%s`;
fi
while true; do
echo "#$(date -u --date @$((`date +%s` - $date1)) +%M:%S) minutes"
sleep 1
done
done | yad --pulsate --progress --window-icon="" --image="" --hide \
--on-top --width=300 --height=100 --center --fixed --title="Sample" --text=$"Simple Counter"
--button=gtk-cancel  
 fi
  fi

--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/yad-common/d4184c00-d16f-46dd-b7ba-31bc8fbe8365n%40googlegroups.com.
Message has been deleted

Ananas

unread,
Aug 27, 2025, 2:38:14 AM (13 days ago) Aug 27
to yad-c...@googlegroups.com
#!/bin/bash

function inc_cnt {
CNT=$(($1 + 1))
echo "1:$CNT"
}
export -f inc_cnt

yad --button=yad-close --form --field=count:num 0 --field=pressme:btn
'@/bin/bash -c "inc_cnt %1"'

ср, 27 серп. 2025 р. о 00:11 'dirkullri...@gmx.de' via yad-common
<yad-c...@googlegroups.com> пише:
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/yad-common/d4184c00-d16f-46dd-b7ba-31bc8fbe8365n%40googlegroups.com.



--
wbr,

Victor "Ananas" Ananjevsky

dirkullri...@gmx.de

unread,
Aug 28, 2025, 2:19:09 AM (12 days ago) Aug 28
to yad-common
your script is nice, but - not what i wanted.

i don't need a timed counter, just a counter which increments a value in a textfield by pressing a button.

but, thx anyway xD
Reply all
Reply to author
Forward
0 new messages