vasa1
January 4th, 2014, 06:41 AM
I have this script, ~/bin/inter-alarm:
#!/usr/bin/env bash
# My first attempt at an interactive alarm
echo "Type in after how many minutes or seconds you want the alarm to sound"
read my_time
sleep "$my_time";
COUNTER=0
while [ $COUNTER -lt 5 ]; do
mplayer -really-quiet /usr/share/sounds/freedesktop/stereo/complete.oga
let COUNTER=COUNTER+1
done
To run it, I need to
open a terminal
specify the time, for example, 15s
press enter and
leave the terminal open till the script completes.
What I want, but don't know how to do, is this: I want the script to open the terminal by itself (when I double-click the script in my file manager), accept the time I specify and then close the terminal but leave the script running. Is that possible?
#!/usr/bin/env bash
# My first attempt at an interactive alarm
echo "Type in after how many minutes or seconds you want the alarm to sound"
read my_time
sleep "$my_time";
COUNTER=0
while [ $COUNTER -lt 5 ]; do
mplayer -really-quiet /usr/share/sounds/freedesktop/stereo/complete.oga
let COUNTER=COUNTER+1
done
To run it, I need to
open a terminal
specify the time, for example, 15s
press enter and
leave the terminal open till the script completes.
What I want, but don't know how to do, is this: I want the script to open the terminal by itself (when I double-click the script in my file manager), accept the time I specify and then close the terminal but leave the script running. Is that possible?