Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-10-14 18:25:17

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

How to post notifications to myself using XFCE and Linux? Font size?

I want to send notifications to myself from my OS using my user's crontab.
I have two working solutions but I cannot increase the font size of the notifications.
That is the main problem.

Posting notificaitons:

(1)

notify-send "hello"   

this works but it is very limited, cannot increase font-size.

(2)

zenity --info --text="I am living inside of my own dream world." --width=300 --height=200 --timeout=5

this works, but i cannot increase the font-size.

For the crontab solution, I had to add an extra line because the crontab environment is slightly different from my user environment (or so I read).
I had to add this to my script:

script filename: dream.world.sh

#!/bin/bash
export DISPLAY=:0
zenity --warning --text="I am living inside of my own dream world." --width=300 --height=200 --timeout=25

-----

crontab line entry (runs every hour):

0 * * * * /usr/local/bin/./dream.world.sh >> dream.world.log 2>&1

-----

The above (2)method  with the crontab entry works fine.
But I cannot increase the font size.
I tried adding a *.css file but that didn't work.

Can anyone tell me how I can change this script or use another command, so that the font size can be enlarged to something like 30 point to 60 point ?
Thanks.
===============
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)

Last edited by BNeo (2024-10-14 23:23:40)

Offline

#2 2024-10-14 20:11:09

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,481
LinuxFirefox 128.0

Re: How to post notifications to myself using XFCE and Linux? Font size?

BNeo wrote:

I tried adding a *.css file but that didn't work.

What was in your gtk.css file?

The following css will work:
both summary and body

#XfceNotifyWindow label { font-size: 48pt; }

summary only

#XfceNotifyWindow label#summary { font-size: 48pt; }

body only

#XfceNotifyWindow label#body { font-size: 48pt; }

Note: you'll need to restart the xfce4-notifyd daemon for the change to take effect. Test it first using:

notify-send test test

...and then test it through crontab (you may need to make this change to root's gtk.css file as well).


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

#3 2024-10-14 21:16:37

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

Re: How to post notifications to myself using XFCE and Linux? Font size?

ToZ wrote:
BNeo wrote:

I tried adding a *.css file but that didn't work.

What was in your gtk.css file?

The following css will work:
both summary and body

#XfceNotifyWindow label { font-size: 48pt; }

summary only

#XfceNotifyWindow label#summary { font-size: 48pt; }

body only

#XfceNotifyWindow label#body { font-size: 48pt; }

Note: you'll need to restart the xfce4-notifyd daemon for the change to take effect. Test it first using:

notify-send test test

...and then test it through crontab (you may need to make this change to root's gtk.css file as well).

I'm not familiar with css files .
What I wrote in my css file is given below:

* {
    font-size: 60px !important;  /* Use !important to override any other styles */
}

And then in my script I had the following:

#!/bin/bash
export DISPLAY=:0
GTK3_RC_FILES=/usr/local/bin/dream.world.css zenity --warning --text="I am living inside of my own dream world." --width=300 --height=200 --timeout=25

None of the above worked for me, so I took out the css stuff.
I'm not sure what you wrote regarding summary/body, since my knowledge of css is very limited to say the least.
Can you please be more simple in your assistance ? Thanks.

Offline

#4 2024-10-14 22:33:29

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 527
LinuxFirefox 131.0

Re: How to post notifications to myself using XFCE and Linux? Font size?

Although Toz's suggestion is likely best another suggestion would be Yad. Zenity is limited in functionality and Yad further expanded it much further. You can adjust the font size in Yad with tags:

yad --title "Notification!" --text "\n\n\n<span foreground='blue'><big><big>This is your Reminder</big></big></span>" --text-align=center --geometry=500x200+200+700

Siduction
Debian Sid
Xfce 4.18

Offline

#5 2024-10-14 23:08:37

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

Re: How to post notifications to myself using XFCE and Linux? Font size?

eriefisher wrote:

Although Toz's suggestion is likely best another suggestion would be Yad. Zenity is limited in functionality and Yad further expanded it much further. You can adjust the font size in Yad with tags:

yad --title "Notification!" --text "\n\n\n<span foreground='blue'><big><big>This is your Reminder</big></big></span>" --text-align=center --geometry=500x200+200+700

Excellent . This works fine even in the crontab !
One question if you will:

https://yad-guide.ingk.se/general-optio … tions.html

Can I use the --center  option together with the following:  geometry=500x200+200+700      (here the 200 , 700 you entered presumably are x,y co-ordinates)  ?
If not do I have to remove the  200+700 ? to use the  --center option ?

Thanks again.
Should I mark this as solved ?
If so, how do I do that ?

Offline

#6 2024-10-15 11:38:20

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 527
LinuxFirefox 131.0

Re: How to post notifications to myself using XFCE and Linux? Font size?

The geometry is both window placement and window size. You will have to play with it to fit your needs. My initial point was the tags to increase the font size.

Added later 1 h 09 min 07 s:
Just looking at the options --center will place the window in the center of the screen.


Siduction
Debian Sid
Xfce 4.18

Offline

#7 2024-10-15 20:34:50

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

Re: How to post notifications to myself using XFCE and Linux? Font size?

eriefisher wrote:

The geometry is both window placement and window size. You will have to play with it to fit your needs. My initial point was the tags to increase the font size.

Added later 1 h 09 min 07 s:
Just looking at the options --center will place the window in the center of the screen.

Thanks very much.

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 559.16 KiB (Peak: 576 KiB) ]