Page 41 of 42

Posted: Wed 04 Dec 2019, 18:29
by fredx181
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

Posted: Wed 04 Dec 2019, 18:44
by dancytron
fredx181 wrote:A L A R M !! :lol: :lol:
Image

Hi, no need to be alarmed :wink: it's just about a new alarm script (attached) with changes and improvements.
/snip

Fred
Thank God. Finally a decent alarm clock that doesn't take 100 meg of dependencies.

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.

Posted: Thu 05 Dec 2019, 03:21
by slavvo67
Well, you didn't report back so I guess you overslept and the alarm didn't work. LOL

Posted: Thu 05 Dec 2019, 03:27
by dancytron
slavvo67 wrote:Well, you didn't report back so I guess you overslept and the alarm didn't work. LOL
The big test is tomorrow morning. :D

Posted: Thu 05 Dec 2019, 10:07
by fredx181
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!
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.

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

Posted: Sat 07 Dec 2019, 11:40
by Argolance
Bonjour,
:arrow: [EDIT]: yalrm 0.5.1

Cordialement.

Posted: Sat 07 Dec 2019, 16:46
by dancytron
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
This is working great for me.

Is a snooze button (ideally the space bar but choosing from the task bar would be okay too) with a settable duration possible?

Posted: Sat 07 Dec 2019, 22:39
by stemsee
Thanks Argolance

yalrm works well on dpupbuster64_8.0.0

yalrm-gettex

Posted: Sat 07 Dec 2019, 23:19
by josejp2424
Argolance wrote:Bonjour,
Here is yalrm 0.2 which incorporates the latest changes made by fredx181 without the countdown since other programs :arrow: 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.
hi Argolance.

It is very good.
there would be the possibility of adding gettex?.

Posted: Sun 08 Dec 2019, 13:24
by Argolance
Bonjour,
josejp2424 wrote:there would be the possibility of adding gettex?.
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) :oops: .
Thanks.

Additional note regarding the countdown option: I forgot to mention the excellent :arrow: pTiming by zigbert for "relative" time alarm.

Cordialement.

Posted: Mon 09 Dec 2019, 12:12
by Argolance
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, :arrow: I found this...

Image
Cordialement.

Re: Alarm script

Posted: Fri 13 Dec 2019, 23:15
by fredx181
dancytron wrote:
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
This is working great for me.

Is a snooze button (ideally the space bar but choosing from the task bar would be okay too) with a settable duration possible?
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.

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

Manpages with yad

Posted: Sat 14 Dec 2019, 19:02
by achim
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

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

Re: Alarm script

Posted: Sat 14 Dec 2019, 19:58
by dancytron
fredx181 wrote:
dancytron wrote:
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
This is working great for me.

Is a snooze button (ideally the space bar but choosing from the task bar would be okay too) with a settable duration possible?
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.

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
Great. I'll test it out soon.

Posted: Thu 19 Dec 2019, 16:34
by fredx181
dancytron wrote:Great. I'll test it out soon.
And...? You didn't sleep all those days, I guess :lol:

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

Posted: Thu 19 Dec 2019, 16:56
by dancytron
Sorry, it worked fine.

Will install the new version.

Posted: Fri 20 Dec 2019, 09:18
by Argolance
Bonjour,
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
at line 147 to get the text of the popup window...

Cheers!

Posted: Fri 20 Dec 2019, 16:41
by Argolance
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.

Posted: Sat 21 Dec 2019, 14:55
by Mike Walsh
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:-

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
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. :wink:

Posted: Sat 21 Dec 2019, 16:05
by fredx181
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)

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 
To make more menu entries it would be something like:

Code: Select all

echo menu:"Quit!bash -c quit_tray!gtk-quit| \
NAME!COMMAND!ICON| \
NAME!COMMAND!ICON" >$PIPE &
EDIT: Just thought that it can be much more simple with --menu option, so then as a one-liner only:

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"
Fred