Printing a loop process to a dialog window

186 views
Skip to first unread message

Upgreyed

unread,
Nov 19, 2021, 8:45:24 PM11/19/21
to yad-common
Hello,
Can yad loop and print to a dialog window as my example here I want the frequency MHz to print and change in the dialog every second or two. I can only do it in a progress --pulse window at the moment. The frequency MHz will only will change if I refresh the window.
Screenshot at 2021-11-19 19-50-27.png

Upgreyed

unread,
Nov 19, 2021, 8:53:06 PM11/19/21
to yad-common
Example video of what I want but in the main window.

Милош Павловић

unread,
Nov 22, 2021, 10:13:41 PM11/22/21
to yad-common
#!/bin/bash

i=0
for c in  /sys/devices/system/cpu/cpu*/cpufreq; do
  CPU+=(--field "cpu$((i++))" )
done

while read $(eval echo cpu{1..${i}}) \
  <<<$(paste /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq)
 do
   for f in $(eval echo "\$cpu{1..${i}}")
     do
        echo "${f%???}.${f#"${f%???}"} MHz"
   done
 sleep 1
done \
| yad --form --text="cpu cores ${i}" \
      ${CPU[*]} --width=500 --height=400 --cycle-read

Ken

unread,
Nov 25, 2021, 4:49:21 PM11/25/21
to yad-c...@googlegroups.com
Милош,
That does work for my project I was working on. I don't know how you came up with the solution
but glad you did! Thank you!

--
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 on the web visit https://groups.google.com/d/msgid/yad-common/d6f5e302-9263-4c1d-85b1-50c8a4f88e4en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages