Questions about yad --progress

95 views
Skip to first unread message

Richard Quint

unread,
Feb 10, 2024, 7:53:24 PM2/10/24
to yad-common
I've been trying to use YAD to watch the CPU temperature and fan speed on my Raspberry Pi 5 by displaying them using progress bars for some quick visual feedback.  The basic applet works fine but I've run into some problems trying to fine tune it (really just making it pretty).  I suspect some of the problems have to do with RaspberryPiOS now using Wayland, but some are also evident when I use a simplified version of the script in a Ubuntu 23.10 installation on an Intel system using

rquint@ManticBox:~$ yad --version
12.1 (GTK+ 3.24.38)

Here's the script (with random values instead of the temperature and fan speed I use on the Pi).

#!/bin/bash
{
for ((;;))
  do
   T=$((RANDOM % 100))
   F=$((RANDOM % 100))
   echo "1:$T"
   echo "1:#$T           "
   echo "2:$F"
   echo "2:#$F rpm           "
   sleep 1
 done
} | yad --progress \
    --on‐top \
    --geometry 350x150+75+75 \
    --bar="      <span foreground='red'><b>Temperature</b></span>" \
    --bar="                 <span foreground='green' weight='bold' style='oblique'>Fan Speed</span>" \
    --vertical  \
    --title="CPU Temperature / Fan Speed" \
    --window-icon=/home/rquint/.icons/raspberry.png
   
Let me be specific now.

1)  The window-icon doesn't display.  The icon is in the given path and it is quite small.

rquint@ManticBox:~$ ls -la /home/rquint/.icons
total 32
drwxrwxr-x  3 rquint rquint  4096 Feb 10 13:31 .
drwxr-x--- 23 rquint rquint  4096 Feb 10 15:34 ..
drwxrwx--- 12 rquint rquint  4096 Jun 11  2020 GreyGnome
-rwxrwx---  1 rquint rquint  2279 Feb  9 17:24 raspberry.png
-rwxrwx---  1 rquint rquint 15053 Feb 10 10:49 window_berry.png

2)  The filling on the vertical bars is from the top.  There used to be an --invert option but that doesn't do anything now.

3)  On the Pi --posx and --posy  don't work nor does --geometry with the optional X and Y values.

4)  This isn't a bug, but can one do any styling of the piped values echo "1:#$T" and  echo "2:#$F rpm" including placing them without just stuffing blanks in the string.  I would be nice if I could increase the size and change the color.  I've tried using escape sequences, but if they can work I haven't figured out how to do it.  Also, can one change the thickness of the progress bars?

Victor Ananjevsky

unread,
Feb 12, 2024, 9:31:14 PM2/12/24
to yad-c...@googlegroups.com
hi

1) where it must be displayed? window icon is just a window icon - the only hint for
window manager how to mark window

2) set default direction from top to bottom in vertical progress bars - this is a
stupid^W standard GTK behavior. to change this, add :rtl type to bars

3) your example works fine for me in x11. sorry, i cannot check it under wayland

4) this is gtk limitations. i just set "text" property when i got a hash-prefixed strings
but you can try to add some customization with css tricks through --css argument

Wolfgang Stey

unread,
Feb 15, 2024, 7:01:06 AM2/15/24
to yad-common
Moin,
try 
GDK_BACKEND=x11,wayland ./your-script.sh
Gruß
Wolfgang

Richard Quint

unread,
Feb 15, 2024, 12:35:01 PM2/15/24
to yad-common
Thanks Wolfgang, it worked.  Interesting that it was only a problem with RaspiOS, not with Wayland on Ubuntu 23.10 on Intel hardware.
Reply all
Reply to author
Forward
0 new messages