Countdown to Action - GUI timer
Countdown to Action - GUI timer
[Admin note: the posts in this thread were moved from this thread.]
Hi L18L,
Sorry for not replying sooner
I got side tracked with another little yad project 'Countdown to Action' (circumstance permitting your input would be greatly appreciated)
No biggie with the font selection - your original fc-list update has been working ok for me. - i think urxvtset has turned out pretty sweet considering it was only a few input boxes to start with.
thanks for help.
Hi L18L,
Sorry for not replying sooner
I got side tracked with another little yad project 'Countdown to Action' (circumstance permitting your input would be greatly appreciated)
No biggie with the font selection - your original fc-list update has been working ok for me. - i think urxvtset has turned out pretty sweet considering it was only a few input boxes to start with.
thanks for help.
- Attachments
-
- countdown.gz
- (770 Bytes) Downloaded 618 times
Last edited by stu90 on Mon 20 Jun 2011, 16:37, edited 1 time in total.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Countdown to Action
Hi stu90
Having changed the font to Fixed Bold it was OK.
So I am thinking there is a bug with Dingbats.
Or why is it rxvt instead of urxvt???
What input are you expecting?
-Date?
-Drag and drop for Execute?
-Editable Combobox ?
-Passing the task to cronjob?
Everything seems to be possible.
Cheers
I have installed 'Countdown to Action' and at first run I had some problems.you wrote:I got side tracked with another little yad project 'Countdown to Action' (circumstance permitting your input would be greatly appreciated)
Code: Select all
# ./cou*
Countdown: 0,000000 minutes
Execute: urxvt
rxvt: unable to calculate font width for 'Dingbats:style=Regular:pixelsize=16:minspace=True', ignoring.
rxvt: unable to load base fontset, please specify a valid one using -fn, aborting.
#
So I am thinking there is a bug with Dingbats.
Or why is it rxvt instead of urxvt???
What input are you expecting?
-Date?
-Drag and drop for Execute?
-Editable Combobox ?
-Passing the task to cronjob?
Everything seems to be possible.
Cheers
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Countdown to Action
v 0.2
Code: Select all
#!/bin/bash
TITLE="Countdown To Action"
VERSION="0.2"
ICON="/usr/share/pixmaps/yad.png"
TEXT="<b>Enter Time \nto countdown\nbefore Action. </b> "
TIME=`date +%H:%M`
DATE=`date +%Y-%m-%d`
### GUI countdown - action ###
COUNTDOWN=$(yad --title="$TITLE $VERSION" --text="$TEXT" --image=/usr/share/pixmaps/away.png \
--form --separator=" " \
--field="Minutes":NUM "0!0..59" \
--field="Hours":NUM "0!0..23" \
--field="Action" "urxvt" )
echo $COUNTDOWN
if [ "$COUNTDOWN" = "" ];then
echo "Exiting" && exit
else
## get minutes ##
MINS=`echo $COUNTDOWN | cut -d" " -f1 | cut -d "." -f1 | cut -d "," -f1`
echo "Countdown: $MINS minutes"
## get hours ##
HOURS=`echo $COUNTDOWN | cut -d" " -f2 | cut -d "." -f1 | cut -d "," -f1`
echo "Countdown: $HOURS hours"
## get new action ##
# SETACTION=`echo $COUNTDOWN | cut -d" " -f2-`
SETACTION=`echo $COUNTDOWN | cut -d" " -f 3`
[[ ! "$SETACTION" ]] && yad --title="$TITLE Info" --text=" Make sure to add an Action to perform " && echo "Exiting" && exit
echo "Execute: $SETACTION "
TIMER=`echo $(($MINS*60))`
ASTART=`date | cut -d" " -f-4`
exec 3> >(yad --notification --image="$ICON" --listen)
echo tooltip: "Countdown action will be performed in $MINS minutes time from <b>$ASTART</b> " >&3
sleep $TIMER
exec 3>&-
### 10 seconds to cancel action ###
(
echo "99" ; sleep 1
echo "90" ; sleep 1
echo "80" ; sleep 1
echo "70" ; sleep 1
echo "60" ; sleep 1
echo "50" ; sleep 1
echo "40" ; sleep 1
echo "30" ; sleep 1
echo "20" ; sleep 1
echo "10" ; sleep 1 ) |
# yad --progress --title="$TITLE $VERSION" --text=" Your action will executed in 10 seconds.\n <b>To abort click cancel!</b> " \
# --percentage=0 --auto-close --auto-kill
yad --progress --title="$TITLE $VERSION" --text=" Your action will executed in 10 seconds.\n To abort click cancel! " \
--percentage=0 --auto-close --auto-kill
if [ "$?" = -1 ] ; then
yad --error --text=" Aborted by user! "
fi
### action to execute ###
echo $SETACTION startet.
time eval $SETACTION
fi
exit
- Attachments
-
- count_action.png
- -
- (9.29 KiB) Downloaded 1977 times
Re: Countdown to Action
Hi L18L,L18L wrote:v 0.2
Great update on Countdown to Action - perhaps we should start a new thread for this application?
My own need for it is to turn off my laptop when downloading torrents so as not to use up all my internet allowance.
I already though of another idea though as a PC/internet timer for parents - probably won't fool any of the older more savy kids who could kill its process but should work ok for younger kids with timedown progress window set to no buttons and borderless to stop them from canceling it.
thanks.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Countdown to Action
Hi stu90,
timer,
there is /usr/local/pschedule
parents,
kid should use wary112 (unprivileged user fido)
Sorry, I do not see a reason to reinvent these wheels at the moment.
why not justyou wrote:My own need for it is to turn off my laptop when downloading torrents so as not to use up all my internet allowance.
I already though of another idea though as a PC/internet timer for parents - probably won't fool any of the older more savy kids who could kill its process but should work ok for younger kids with timedown progress window set to no buttons and borderless to stop them from canceling it.
Code: Select all
wget http://....... && shutdown
there is /usr/local/pschedule
parents,
kid should use wary112 (unprivileged user fido)
Sorry, I do not see a reason to reinvent these wheels at the moment.
Re: Countdown to Action
You can use wget to download torrent files - i was unaware of thisL18L wrote:Hi stu90,why not justyou wrote:My own need for it is to turn off my laptop when downloading torrents so as not to use up all my internet allowance.
I already though of another idea though as a PC/internet timer for parents - probably won't fool any of the older more savy kids who could kill its process but should work ok for younger kids with timedown progress window set to no buttons and borderless to stop them from canceling it.timer,Code: Select all
wget http://....... && shutdown
there is /usr/local/pschedule
parents,
kid should use wary112 (unprivileged user fido)
Sorry, I do not see a reason to reinvent these wheels at the moment.
Yes running as fido would be best to stop any mishaps but Lucid puppy and most all the earlier puppies do not have this option
Sure most things have been done before - but i don't see it as reinventing the wheel - merely more choice, with the added bonus of of having some fun and hopefully learning something along the way
cheers.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Countdown to Action
Bingostu90 wrote: added bonus of of having some fun and hopefully learning something along the way .
If you start a new thread I will join
Countdown to Action
Dear L18L,
Countdown to Action is a great little utility. I would only make one slight change to line 32. As written, the input field does not accept arguments. In order for parameters to be passed, line 32 should look like this:
I just added a "-" after 'cut -d" " -f ', which means cut takes all fields starting with f3. Thanks for the utility.
With kind regards,
vovchik
Countdown to Action is a great little utility. I would only make one slight change to line 32. As written, the input field does not accept arguments. In order for parameters to be passed, line 32 should look like this:
Code: Select all
SETACTION=`echo $COUNTDOWN | cut -d" " -f 3-`
With kind regards,
vovchik
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Countdown to Action
Learning from each other is fun.vovchik wrote:...
I just added a "-" after 'cut -d" " -f ', which means cut takes all fields starting with f3. Thanks for the utility.
...
Thank you very much for the - (Minus)
The credits go to stu90.
I have just added the field HOUR and ranges for the numeric fields.
Code: Select all
man yad
This is a little Yad application to perform a simple countdown for x minutes or hours then perform a user defined action or string of actions, such as shutdown puppy (wmpoweroff) or play a media file etc.
When you set a countdown action there will be an icon in the system tray as a reminder - 10 second before the countdown action is performed a little gui window will open alerting you an action is to be performed in 10 seconds and giving the option to cancel the action if you wish.
urxvt in the action field is not needed to run an action, it is just there as an example.
Dependencies:
Countdown to Action requires Yad-0.12.2 to be installed - download is available on this link:
http://www.murga-linux.com/puppy/viewto ... 533#536533
Tested on Lucid Puppy.
Thanks.
When you set a countdown action there will be an icon in the system tray as a reminder - 10 second before the countdown action is performed a little gui window will open alerting you an action is to be performed in 10 seconds and giving the option to cancel the action if you wish.
urxvt in the action field is not needed to run an action, it is just there as an example.
Dependencies:
Countdown to Action requires Yad-0.12.2 to be installed - download is available on this link:
http://www.murga-linux.com/puppy/viewto ... 533#536533
Tested on Lucid Puppy.
Thanks.
- Attachments
-
- countdown-0.3.pet
- (5.28 KiB) Downloaded 576 times
c2a
Sorry Stu,
I guess my thanks should have been addressed mainly to you In any case, the utility is useful, and collaboration is always nice to see. To make this app even more complete, you might consider adding a launch at hh:mm and a file select button for the action that would update the input box.
With kind regards,
vovchik
PS. I use this icon for the GUI. It's a bit big, but I like it.
I guess my thanks should have been addressed mainly to you In any case, the utility is useful, and collaboration is always nice to see. To make this app even more complete, you might consider adding a launch at hh:mm and a file select button for the action that would update the input box.
With kind regards,
vovchik
PS. I use this icon for the GUI. It's a bit big, but I like it.
- Attachments
-
- clock4.png
- (61.46 KiB) Downloaded 1972 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Countdown
An additional combobox for choosing from /usr/share/applications.
The checkbox decides where to take the action from.
The input field which I have renamed to "Command" has to be at last position because it can contain more than 1 string.
Writing this down I have got the idea taking another separator than blank that this condition would exist no more.
The checkbox decides where to take the action from.
The input field which I have renamed to "Command" has to be at last position because it can contain more than 1 string.
Writing this down I have got the idea taking another separator than blank that this condition would exist no more.
Code: Select all
#!/bin/bash
## Stu90 ## L18L ##
## Countdown to Action ##
## editable command or combobox v3a
TITLE="Countdown To Action"
VERSION="0.3a"
ICON="/usr/share/pixmaps/c2a.png"
TEXT="<b>Enter Time to countdown \nbefore\nAction or Command. </b> "
TIME=`date +%H:%M.%P`
DATE=`date +%d-%m-%Y`
### GUI countdown - action ###
COUNTDOWN=$( yad --title="$TITLE $VERSION" --text="$TEXT" --form --separator=" " --image="$ICON" \
--field="Minutes":NUM "0!0..59" \
--field="Hours":NUM "0!0..23" \
--field="Action":CB "`ls /usr/share/applications | tr '\n' '!' | sed s/.desktop//g `" \
--field="Ignore Command":CHK TRUE \
--field="Command" "urxvt" \
)
echo $COUNTDOWN
if [ "$COUNTDOWN" = "" ];then
echo "Exiting" && exit
else
## get minutes ##
MINS=`echo $COUNTDOWN | cut -d" " -f1 | cut -d "." -f1 | cut -d "," -f1`
echo "Countdown: $MINS minutes"
## countdown minutes ##
TIMERM=`echo $(($MINS))`'m'
## get hours ##
HOURS=`echo $COUNTDOWN | cut -d" " -f2 | cut -d "." -f1 | cut -d "," -f1`
echo "Countdown: $HOURS hours"
## coundown hours ##
TIMERH=`echo $(($HOURS))`'h'
## get new action ##
IGNORE_COMMAND=`echo $COUNTDOWN | cut -d" " -f4`
if [ "$IGNORE_COMMAND" = "TRUE" ] ; then
SETACTION=`echo $COUNTDOWN | cut -d" " -f 3`
SETACTION=`cat /usr/share/applications/${SETACTION}.desktop | grep Exec= | cut -d "=" -f 2 `
else
# must be the last input because number of parameters is unknown
SETACTION=`echo $COUNTDOWN | cut -d" " -f 5-`
[[ ! "$SETACTION" ]] && yad --title="$TITLE Info" --text=" Make sure to add an Action to perform " && echo "Exiting" && exit
fi
echo "Execute: $SETACTION "
## tray notification ##
exec 3> >(yad --notification --image="$ICON" --listen)
echo tooltip: "Countdown action will be performed \n in <b>$HOURS</b> hours and <b>$MINS</b> minutes time from \n <b>$TIME $DATE</b> " >&3
## sleep for x hours + x minutes ##
sleep $TIMERH | sleep $TIMERM
exec 3>&-
### 10 seconds / cancel notification ###
(
echo "99" ; sleep 1
echo "90" ; sleep 1
echo "80" ; sleep 1
echo "70" ; sleep 1
echo "60" ; sleep 1
echo "50" ; sleep 1
echo "40" ; sleep 1
echo "30" ; sleep 1
echo "20" ; sleep 1
echo "10" ; sleep 1 ) |
yad --progress --title="$TITLE $VERSION" --text=" Your action will be executed in 10 seconds. " \
--percentage=0 --auto-close --auto-kill
if [ "$?" = -1 ] ; then
yad --error --text=" Aborted by user! "
fi
### action to execute ###
echo $SETACTION startet.
time eval $SETACTION
fi
exit
- Attachments
-
- countdown3a.png
- (9.03 KiB) Downloaded 2029 times
Hello,
i have downloaded and installed the pet, but it won't run.
Error Message:
What does it mean and what can i do, to get this tool running? I'm using Puppy Studio 3.3 and Lucid 525 (528).
RSH
Edit:
Sorry, but i must have been blind. Found the yadxxx.pet, downloaded it, and now it works.
i have downloaded and installed the pet, but it won't run.
Error Message:
Code: Select all
sh-3.00# /root/my-applications/bin/countdown
/root/my-applications/bin/countdown: line 17: yad: command not found
Exiting
sh-3.00#
RSH
Edit:
Sorry, but i must have been blind. Found the yadxxx.pet, downloaded it, and now it works.
You are missing yad
http://www.murga-linux.com/puppy/viewtopic.php?p=438811
you can find it in the first post of the above link
http://www.murga-linux.com/puppy/viewtopic.php?p=438811
you can find it in the first post of the above link
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]
wtf thats weird, anyway you need yad which can be found here
http://www.murga-linux.com/puppy/viewtopic.php?p=438811
http://www.murga-linux.com/puppy/viewtopic.php?p=438811
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]