Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-10-16 19:34:33

BNeo
Member
Registered: 2024-07-03
Posts: 14
LinuxChrome 129.0

[SOLVED] yad to make notifications!formatting w/text/image not working

Using yad  (yet another dialog)
url: https://github.com/v1cont/yad  ,  https://yad-guide.ingk.se/

I have been trying to post notifications to myself using a combination of  text and images
I also want this to work in my user's crontab.
I tried many different variations of yad options and I cannot get my text to appear either
above or below my image.
The text ALWAYS appears to the right hand side of the image no matter which variation/options I try (see below).
This leads me to suspect that something more fundamental is wrong with my sytem.
This error occurs BOTH when I enter the command directly in the terminal and through crontab.
The same problem, namely the text appears on the right hand side of the image and NOT above or below.

Can anyone suggest a solution ? Please see below for various options I tried:

Example 1: Using cat EOF

#!/bin/bash
export DISPLAY=:0

yad --image-on-top --on-top --title "My Dream World!" \
    --timeout=30 --no-buttons --sticky --center \
    --image=/usr/local/bin/text2.dream.world.image.Thirteenth.Floor.png \
    --text "$(cat <<EOF
Welcome to my dream world!
Enjoy your stay!
Feel free to explore.
EOF
)"

Example 2:Using text align center

#!/bin/bash
TEXT="Welcome to my dream world!\nEnjoy your stay!\nFeel free to explore."
yad --image-on-top --on-top --title "My Dream World!" \
    --timeout=30 --no-buttons --sticky --center \
    --image=/usr/local/bin/text2.dream.world.image.Thirteenth.Floor.png \
    --text "$TEXT" \
    --text-align=center

Example 3: Using form

#!/bin/bash
TEXT="Welcome to my dream world!\nEnjoy your stay!\nFeel free to explore."

yad --title "My Dream World!" --on-top --timeout=30 --no-buttons --sticky --center \
    --form \
    --item-separator="" \
    --text="$TEXT" \
    --image=/usr/local/bin/text2.dream.world.image.Thirteenth.Floor.png

Example 5: using Grid

#!/bin/bash
export DISPLAY=:0
TEXT="Welcome to my dream world!"

yad --title "My Dream World!" --on-top --timeout=30 --no-buttons --sticky --center \
    --grid \
    --image=/usr/local/bin/text2.dream.world.image.Thirteenth.Floor.png 1 1 \
    --text "$TEXT" 2 1

Example 6: using width height, export DISPLAY variable

#!/bin/bash

# Ensure the correct display
export DISPLAY=:0.0

TEXT="Welcome to my dream world!\nEnjoy your stay!\nFeel free to explore."

yad --title "My Dream World!" --on-top --timeout=30 --no-buttons --sticky --center \
    --image=/usr/local/bin/text2.dream.world.image.Thirteenth.Floor.png \
    --text "$TEXT" \
    --text-align=center \
    --height=200 --width=400

Example 7: using GTK

#!/bin/bash

export DISPLAY=:0
TEXT="Welcome to my dream world!\nEnjoy your stay!\nFeel free to explore."

yad --title "My Dream World!" --on-top --timeout=30 --no-buttons --sticky --center \
    --image=/usr/local/bin/text2.dream.world.image.Thirteenth.Floor.png \
    --text "$TEXT" \
    --button="gtk-ok:0" \
    --width=300 --height=200

===================================
For a temporary solution I simply added my text to the image itself and didn't use a text option tag.
See below: This works but not best...

#!/bin/bash
export DISPLAY=:0

yad --image-on-top --on-top --title "My Dream World!" \
--timeout=120 --no-buttons \
--sticky --center \
--image=/usr/local/bin/text3.dream.world.image.Thirteenth.Floor.png \

Thanks in advance !

===================================
System:
Kernel: 6.1.0-25-amd64 [6.1.106-3]
arch: x86_64
bits: 64
compiler: gcc v: 12.2.0
parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-25-amd64 root=UUID=<filter> ro quiet
init=/lib/systemd/systemd
Desktop:
Xfce v: 4.18.1
tk: Gtk
v: 3.24.36
info: xfce4-panel
wm: xfwm
v: 4.18.0
vt: 7
dm: LightDM
v: 1.26.0 Distro: MX-23.4_x64 Libretto May 19  2024 base: Debian GNU/Linux 12 (bookworm)

$ yad --version
0.40.0 (GTK+ 3.24.38)

P.S. I note that the  Gtk i use is  3.24.36  but above it reports it as 3.24.38. Does this matter ?

Last edited by BNeo (2024-11-04 00:56:52)

Offline

#2 2024-10-31 21:46:39

BNeo
Member
Registered: 2024-07-03
Posts: 14
LinuxChrome 130.0

Re: [SOLVED] yad to make notifications!formatting w/text/image not working

Is there anybody out there?
Is there anybody out there?
Is there anybody out there?
Ah, is there anybody out there?
https://genius.com/Pink-floyd-is-there- … ere-lyrics

Offline

#3 2024-10-31 23:34:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485
LinuxFirefox 132.0

Re: [SOLVED] yad to make notifications!formatting w/text/image not working

This might be the better place to ask. Yad is not an Xfce tool.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#4 2024-11-01 20:58:33

BNeo
Member
Registered: 2024-07-03
Posts: 14
LinuxChrome 130.0

Re: [SOLVED] yad to make notifications!formatting w/text/image not working

ToZ wrote:

This might be the better place to ask. Yad is not an Xfce tool.


Thanks dude.

Offline

#5 2024-11-02 21:49:17

BNeo
Member
Registered: 2024-07-03
Posts: 14
LinuxChrome 130.0

Re: [SOLVED] yad to make notifications!formatting w/text/image not working

yad cannot be used to position text above/below an image.
The image can ONLY be positioned to the left side of the dialog's text.

How do I mark this SOLVED ?
Thanks.

Last edited by BNeo (2024-11-02 21:54:17)

Offline

#6 2024-11-02 23:24:14

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485
LinuxFirefox 132.0

Re: [SOLVED] yad to make notifications!formatting w/text/image not working

Edit your initial post in this thread and you'll be able to edit your subject line. Prepend "[SOLVED]" to the description.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 548.87 KiB (Peak: 566.15 KiB) ]