YAD - Tips
A L A R M !!
Hi, no need to be alarmed it's just about a new alarm script (attached) with changes and improvements.
Mostly focused on being able to cancel and stop the alarm even in case of multiple alarms.
Also tried putting together the ideas and suggestions into it, e.g.
- Repeat can be set to 0, which means infinite
- Tray icon will change from "waiting" icon to "running" icon when the alarm sound starts playing.
- The alarm can be shut off (once running) by right-click the icon > Stop alarm and exit tray
- The GUI a little changed
@Argolance, would be nice if you change to your liking and share (the big alarm clock icon you showed is nice), if you want of course.
Note in case you will translate, there's one function depending on "Set to" phrase: Alarm is running in the background... Set to $hr:$mn Changing "Set to" may make canceling fail. (don't know if is important, just mentioning)
@misko, thanks for "at" recommendation, maybe comes in handy for later.
@vovchik, I initially wanted to use your .svg icon setup with the "Argolance" icons, but found that on one of my systems, they show as empty (transparent) image, any idea why ?
EDIT: Few minutes later, re-attached, made small change on the GUI.
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
Hi, no need to be alarmed it's just about a new alarm script (attached) with changes and improvements.
Mostly focused on being able to cancel and stop the alarm even in case of multiple alarms.
Also tried putting together the ideas and suggestions into it, e.g.
- Repeat can be set to 0, which means infinite
- Tray icon will change from "waiting" icon to "running" icon when the alarm sound starts playing.
- The alarm can be shut off (once running) by right-click the icon > Stop alarm and exit tray
- The GUI a little changed
@Argolance, would be nice if you change to your liking and share (the big alarm clock icon you showed is nice), if you want of course.
Note in case you will translate, there's one function depending on "Set to" phrase: Alarm is running in the background... Set to $hr:$mn Changing "Set to" may make canceling fail. (don't know if is important, just mentioning)
@misko, thanks for "at" recommendation, maybe comes in handy for later.
@vovchik, I initially wanted to use your .svg icon setup with the "Argolance" icons, but found that on one of my systems, they show as empty (transparent) image, any idea why ?
EDIT: Few minutes later, re-attached, made small change on the GUI.
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
- Attachments
-
- yalarm.tar.gz
- yad alarm updated 2019-12-05 , extract and run yalarm
- (2.73 KiB) Downloaded 175 times
-
- 2019-12-02-184318_680x179_scrot.png
- yalarm
- (31.5 KiB) Downloaded 835 times
Last edited by fredx181 on Thu 05 Dec 2019, 10:37, edited 1 time in total.
Dear Fred,
Good question why the argolance SVGs show up blank on that machine. Is in a compositing "feature" or alpha-channel problem with the Xorg? I've not experienced it before, but it could be that the gdk_pixbuf_loader (which normally handles icon loading within gtk progs) on that system only partially supports svgs, or the yad there was compiled without cairo? I am just speculating.... Weird.
With kind regards,
vovchik
Good question why the argolance SVGs show up blank on that machine. Is in a compositing "feature" or alpha-channel problem with the Xorg? I've not experienced it before, but it could be that the gdk_pixbuf_loader (which normally handles icon loading within gtk progs) on that system only partially supports svgs, or the yad there was compiled without cairo? I am just speculating.... Weird.
With kind regards,
vovchik
Hi vovchik, just for info, it's on the same computer, same yad version, but diiferent Debian version (Buster, on Stretch it works fine), it's not only with yad, btw, with viewnior (image viewer) its shows empty too.
All the other "pre-made" .svg's from you are showing correctly on Buster, btw. Weird indeed... Not a complaint or big problem, just like to understand why. I'll test some more later.
Fred
All the other "pre-made" .svg's from you are showing correctly on Buster, btw. Weird indeed... Not a complaint or big problem, just like to understand why. I'll test some more later.
Fred
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Hello,
Thank you fredx181!
Sorry I didn't answer earlier, but I wasn't home.
I saw somewhere on the web that this warning is a result of wrong command line which must be escaped in a bash fashion.
When I cancel tray and exit from the right click menu, the systray icon is closed but the process not... and the bells ring!
As for internationalization, this time I'll wait a little while for the script to be fully finalized.
[EDIT] Additional question:
Now, to understand how YAD works (for me it is still largely mysterious because the logic is very "special"...), how to move the Set command to a usual "OK" button placed down the window, close to a "Cancel" one?
Thanks.
Cordialement.
Cordialement.
Thank you fredx181!
Sorry I didn't answer earlier, but I wasn't home.
Code: Select all
(yad:12506): GLib-WARNING **: g_strcompress: trailing \
When I cancel tray and exit from the right click menu, the systray icon is closed but the process not... and the bells ring!
As for internationalization, this time I'll wait a little while for the script to be fully finalized.
[EDIT] Additional question:
Now, to understand how YAD works (for me it is still largely mysterious because the logic is very "special"...), how to move the Set command
Code: Select all
'bash -c "alrm %1 %2 %3 %4 %5 %6 %7 %8 %9"'
Thanks.
Cordialement.
Cordialement.
Hi Argolance,
(without extra \ after \t\t\t\t\t\t)
But it's just a warning, as far as I know it doesn't affect how things work.
I tested just now in Xenialpup also and works well for me.
Could be that you edited things in script (e.g. for translation) ?
EDIT:
Fred
Yes, thats because of a small mistake I made in the yad code, part of the GUI code at the bottom should be this:(yad:12506): GLib-WARNING **: g_strcompress: trailing \
Code: Select all
yad --plug="$$" --tabnum=1 --form --cycle-read --columns=2 --field="\t\t\t\t\Current Time:\t\t: " --field=" \t\t\t\t\t\t:lbl" &
But it's just a warning, as far as I know it doesn't affect how things work.
Strange... works ok for me, I guess you mean right-click on the "waiting" icon and "Cancel Alarm and Exit tray"When I cancel tray and exit from the right click menu, the systray icon is closed but the process not... and the bells ring!
I tested just now in Xenialpup also and works well for me.
Could be that you edited things in script (e.g. for translation) ?
Yeah, sure,"special", it should be possible to move the Set button to a usual "OK" button placed down the window, but then it will close the dialog (which I prefer not to) and also requires a completely different setup AFAIK to get all the variables from the fields.Now, to understand how YAD works (for me it is still largely mysterious because the logic is very "special"...), how to move the Set command
Code:
'bash -c "alrm %1 %2 %3 %4 %5 %6 %7 %8 %9"
to a usual "OK" button placed down the window, close to a "Cancel" one?
EDIT:
that may be wrongbut then it will close the dialog
Fred
Last edited by fredx181 on Wed 04 Dec 2019, 19:10, edited 1 time in total.
Hi all, another change to the alarm script, included now the earlier suggestion for setting "relative" time (thanks vovchik), attached yalarm2
(the config file is different: ~/.yalrm2, so not compatible with earlier versions).
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
(the config file is different: ~/.yalrm2, so not compatible with earlier versions).
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
- Attachments
-
- yalarm2.tar.gz
- yad alarm updated 2019-12-05, extract and run yalarm2
- (3.01 KiB) Downloaded 174 times
-
- 2019-12-04-191247_686x218_scrot.png
- yalarm2 with relative time option
- (46.08 KiB) Downloaded 655 times
Last edited by fredx181 on Thu 05 Dec 2019, 10:40, edited 1 time in total.
Thank God. Finally a decent alarm clock that doesn't take 100 meg of dependencies.fredx181 wrote:A L A R M !!
Hi, no need to be alarmed it's just about a new alarm script (attached) with changes and improvements.
/snip
Fred
I've literally been using a 7 hour long countdown video I downloaded off of youtube that plays music after 7 hours.
I will install immediately and report back.
Now I could reproduce that, but it's only sometimes that the canceling doesn't work, can't understand why yet, will look for a fix.Argolance wrote:When I cancel tray and exit from the right click menu, the systray icon is closed but the process not... and the bells ring!
EDIT: The solution was actually quite simple, previously the code for cancelling was too complicated and therefore fragile, should be OK now, re-attached here:
http://murga-linux.com/puppy/viewtopic. ... 15#1043415
and here (v2):
http://murga-linux.com/puppy/viewtopic. ... 29#1043629
Fred
This is working great for me.fredx181 wrote:Hi all, another change to the alarm script, included now the earlier suggestion for setting "relative" time (thanks vovchik), attached yalarm2
(the config file is different: ~/.yalrm2, so not compatible with earlier versions).
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
Is a snooze button (ideally the space bar but choosing from the task bar would be okay too) with a settable duration possible?
- josejp2424
- Posts: 556
- Joined: Sun 01 Aug 2010, 22:35
- Contact:
yalrm-gettex
hi Argolance.Argolance wrote:Bonjour,
Here is yalrm 0.2 which incorporates the latest changes made by fredx181 without the countdown since other programs like this one for example already exist.
I added the "Frequency" option which allows you to set the blinking (from 0.1 to 2 seconds) according to the type of icons you choose: 5 themes are available.
Internationalized: fr
[EDIT]: if already existing, the hidden /root/.yalrm file must be deleted for the script to run properly because it creates a directory with the same name at startup.
Cordialement.
It is very good.
there would be the possibility of adding gettex?.
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
Thanks.
Additional note regarding the countdown option: I forgot to mention the excellent pTiming by zigbert for "relative" time alarm.
Cordialement.
Yes obviously: the script is internationalized using gettext and the pot file is /usr/share/doc/2PDE/yalrm/yalrm.pot (I note I should have put it to /usr/share/doc/nls/yalrm) .josejp2424 wrote:there would be the possibility of adding gettex?.
Thanks.
Additional note regarding the countdown option: I forgot to mention the excellent pTiming by zigbert for "relative" time alarm.
Cordialement.
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
Does anyone know how to have the standard yad buttons labels (ok, cancel, yes, no, close, quit, etc...) in the user's language? The old versions of yad did it right!
___________________________________________________
Something else, for those who would be interested in a way of customizing yad windows and widgets, I found this...
Cordialement.
Does anyone know how to have the standard yad buttons labels (ok, cancel, yes, no, close, quit, etc...) in the user's language? The old versions of yad did it right!
___________________________________________________
Something else, for those who would be interested in a way of customizing yad windows and widgets, I found this...
Cordialement.
Re: Alarm script
I'm not sure if it's what you're looking for, but I added some sort of pause options to the "alarm running" icon menu.dancytron wrote:This is working great for me.fredx181 wrote:Hi all, another change to the alarm script, included now the earlier suggestion for setting "relative" time (thanks vovchik), attached yalarm2
(the config file is different: ~/.yalrm2, so not compatible with earlier versions).
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
Is a snooze button (ideally the space bar but choosing from the task bar would be okay too) with a settable duration possible?
Also made other improvements:
Now in any case when choosing Stop... from menu, the sound will stop immediately, also when selecting pause (but named "Stop alarm and restart after ... min", to avoid confusion)
Added 'Info' to "waiting" tray-icon menu with some explanation about duration interval etc..
Fixed that everytime when the function "alrm" (inside script) runs, that the process hangs, even when it seems to be finished (resulted in many zombie processes if you ran the script several times)
Fred
- Attachments
-
- 2019-12-14-001220_771x460_scrot_671x400.jpg
- (56.77 KiB) Downloaded 737 times
-
- yalarm3.tar.gz
- yalarm3
- (3.86 KiB) Downloaded 155 times
Manpages with yad
Hello experts,
the following script for displaying the man page via YAD works quite well so far. However, I would like to color the background of the browser page (something like this: # fef1e0). So far I have no working idea. So I want to ask if any of you have a suggestion.
Thank you in advance.
achim
the following script for displaying the man page via YAD works quite well so far. However, I would like to color the background of the browser page (something like this: # fef1e0). So far I have no working idea. So I want to ask if any of you have a suggestion.
Thank you in advance.
achim
Code: Select all
#! /bin/bash
#
function close_exit () {
echo "close and exit"
kill -s SIGUSR1 $YAD_PID
}
#
cd /usr/bin
brows="x-www-browser -new-tab"
asked="$1"
help="
Enter a command here for help on the function and options:"
m_del="/tmp/mpage"
if [[ -f "${m_del}" ]]; then
rm -f /tmp/mpage
fi
#
function y_brow () {
/usr/bin/man $asked > /tmp/mpage
$brows /tmp/mpage
}
export -f y_brow
while [ ! -n "$asked" ]
do asked=$(yad --text=" $help" --entry --title=" Linux instructions" --width=500 --height=250 \
--borders=10 --image=gtk-help --image-on-top --center --window-icon="gtk-help" --separator="\n")
if [ "$?" = "1" ]
then
exit 1
fi
done
man $asked | yad --text-info --title=" Help file too $asked" --width=950 --height=850 --button="break up":1 --button="Send to browser":0 \
--borders=10 --image=gtk-help --image-on-top --center --window-icon="gtk-help" --fore="black" --back="#fef1e0" --separator="\n"
acd=$(echo $?) # Exit-Code auswerten
if [[ $acd == 1 ]] || [[ $acd == 9 ]] || [[ $acd == 252 ]]; then # Taste Abbrechen gedrückt || Skript-Ende mit [X] || Skript-Ende mit [Esc]
bash -c close_exit &>/dev/null
exit
else
y_brow
bash -c close_exit &>/dev/null
exit
fi
Last edited by achim on Sat 14 Dec 2019, 21:26, edited 1 time in total.
Re: Alarm script
Great. I'll test it out soon.fredx181 wrote:I'm not sure if it's what you're looking for, but I added some sort of pause options to the "alarm running" icon menu.dancytron wrote:This is working great for me.fredx181 wrote:Hi all, another change to the alarm script, included now the earlier suggestion for setting "relative" time (thanks vovchik), attached yalarm2
(the config file is different: ~/.yalrm2, so not compatible with earlier versions).
EDIT 2019-12-05: Canceling from tray needed a fix, should work now, re-attached.
See also here:
http://murga-linux.com/puppy/viewtopic. ... 88#1043688
Fred
Is a snooze button (ideally the space bar but choosing from the task bar would be okay too) with a settable duration possible?
Also made other improvements:
Now in any case when choosing Stop... from menu, the sound will stop immediately, also when selecting pause (but named "Stop alarm and restart after ... min", to avoid confusion)
Added 'Info' to "waiting" tray-icon menu with some explanation about duration interval etc..
Fixed that everytime when the function "alrm" (inside script) runs, that the process hangs, even when it seems to be finished (resulted in many zombie processes if you ran the script several times)
Fred
And...? You didn't sleep all those days, I guessdancytron wrote:Great. I'll test it out soon.
Anyway here's a new yalarm, with some changes made to the yad dialog (thanks Argolance ! , for the digital time display setup ) and more.
Fred
- Attachments
-
- 2019-12-19-171733_765x404_scrot.png
- yalarm
- (82.98 KiB) Downloaded 633 times
-
- yalrm.tar.gz
- Extract and run yalarm inside "yalrm" folder
- (41.42 KiB) Downloaded 184 times