YAD - Tips
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 181 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 170 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 200 times
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
Here are the internationalized version of yalarm script above, the *.pot and the French *.mo files.
Translations welcome!
[EDIT]: Sorry, missing
at line 147 to get the text of the popup window...
Cheers!
Here are the internationalized version of yalarm script above, the *.pot and the French *.mo files.
Translations welcome!
[EDIT]: Sorry, missing
Code: Select all
. gettext.sh
Cheers!
- Attachments
-
- yalarm-script_pot_mo-fr.tar.gz
- Fixed
- (7.01 KiB) Downloaded 172 times
-
- 191220_100602_792x391_easyshot.jpg
- (37.45 KiB) Downloaded 573 times
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonsoir,
To understand and learn how some yad options work, I played with yalarm and made this version that fredx181 was kind enough to modify according to the latest improvements of its script.
Merci.
Cordialement.
To understand and learn how some yad options work, I played with yalarm and made this version that fredx181 was kind enough to modify according to the latest improvements of its script.
Merci.
Cordialement.
- Attachments
-
- 191212_225233_1064x611_easyshot.jpg
- (108.48 KiB) Downloaded 555 times
-
- yalrm-0.5.1.pet
- (119.97 KiB) Downloaded 185 times
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Afternoon, all.
Now then; I need a wee bit of instruction here, please.
I use variations on the following script to place icons in the 'system-tray' area, in order to have commonly-used items permanently available:-
Which works very well for what I want it for.
What I would like to know is:-
What would be the easiest way possible to add a simple right-click command to this? All I want to be able to do is to right-click the tray icon, have 'Quit' (or 'Leave', or 'Exit', or something along those lines come up), and click on it, so that the tray-icon will then disappear again.
I found this thread from Stu91 (from several years back):-
http://www.murga-linux.com/puppy/viewto ... 1604b53c46
.....but it's rather too much like overkill for my needs. I simply want a right-click 'Quit' function. I've been trawling the 'net for a couple of hours or more, and can't really find anything that'll help; most of the stuff I'm getting up seems to be all about adding commands to an existing right-click context menu in the various Linux file-managers.....
Any advice/assistance will, as always, be very much appreciated. TIA.
Mike.
Now then; I need a wee bit of instruction here, please.
I use variations on the following script to place icons in the 'system-tray' area, in order to have commonly-used items permanently available:-
Code: Select all
#!/bin/sh
#
#YAD 'one-liner' from musher0 / fredx181, to place executable tray icon in notification area
#
yad --notification --text="Brightness control" --command='./usr/local/bin/Bright' --image='/usr/local/lib/X11/pixmaps/Bright.png' 2>/dev/null
What I would like to know is:-
What would be the easiest way possible to add a simple right-click command to this? All I want to be able to do is to right-click the tray icon, have 'Quit' (or 'Leave', or 'Exit', or something along those lines come up), and click on it, so that the tray-icon will then disappear again.
I found this thread from Stu91 (from several years back):-
http://www.murga-linux.com/puppy/viewto ... 1604b53c46
.....but it's rather too much like overkill for my needs. I simply want a right-click 'Quit' function. I've been trawling the 'net for a couple of hours or more, and can't really find anything that'll help; most of the stuff I'm getting up seems to be all about adding commands to an existing right-click context menu in the various Linux file-managers.....
Any advice/assistance will, as always, be very much appreciated. TIA.
Mike.
Hi Mike, something like this ?
Using a named pipe and added --listen and --no-middle to the notification command.
(without --no-middle the icon quits by mouse middle click)
To make more menu entries it would be something like:
EDIT: Just thought that it can be much more simple with --menu option, so then as a one-liner only:
Fred
Using a named pipe and added --listen and --no-middle to the notification command.
(without --no-middle the icon quits by mouse middle click)
Code: Select all
#!/bin/sh
# function quit_tray
quit_tray () {
# quit tray
echo "quit" > $PIPE
# cleanup, remove $PIPE
rm -f $PIPE
}; export -f quit_tray
# create PIPE
export PIPE="/tmp/Y_NOTI_BRIGHT.$RANDOM"
mkfifo $PIPE
# attach a file descriptor to the file
exec 3<> $PIPE
# send menu to $PIPE
echo menu:"Quit!bash -c quit_tray!gtk-quit" >$PIPE &
yad --notification --listen --no-middle --text="Brightness control" --command='./usr/local/bin/Bright' --image='/usr/local/lib/X11/pixmaps/Bright.png' <&3
Code: Select all
echo menu:"Quit!bash -c quit_tray!gtk-quit| \
NAME!COMMAND!ICON| \
NAME!COMMAND!ICON" >$PIPE &
Code: Select all
yad --notification --item-separator=":" --no-middle --text="Brightness control" --command='./usr/local/bin/Bright' --image='/usr/local/lib/X11/pixmaps/Bright.png' --menu="Quit:quit:gtk-quit"