I'm looking for a very simple applet which checks the system clock and plays a given sound every full hour, and another sound every half hour (with an option to deactivate it when not needed).
I didn't find anything doing this, but it's so simple I think I might (potentially) be able to make it myself. Except I have no clue how Cinnamon Applets are made...
Would somebody be so kind to help me please?
I'm no programmer, though I have done some prototyping in VB and dabbled in (web) JavaScript a couple dozen years ago... And from what I've seen they might be baked out of some flavor of JavaScript. Is that true?
Need an Applet - How do you make them?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Need an Applet - How do you make them?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Need an Applet - How do you make them?
You could just use the crontab to schedule the sound to be played? If the sounds are mp3 files you can install something like mpg123 to play mp3 files from the terminal and then use the command
Replace with correct path for your files.
crontab -e
(do not add sudo!) to edit your personal crontab and add these two lines to the end of the file:
Code: Select all
0 * * * * mpg123 /path/to/whole-hour-sound.mp3 >/dev/null 2>&1
30 * * * * mpg123 /path/to/half-hour-sound.mp3 >/dev/null 2>&1
Re: Need an Applet - How do you make them?
Wow, that's even easier! Thanks a lot!
Where do I find my user crontab file?
Going through crontab -e created a file, but I can't find it. I thought it would appear inside /etc/cron.d, but it's not there.
(I just added some comment lines, to create the file and also be sure I'm looking at the right one, so doing a crontab -l I see it does indeed exist, somewhere.)
Why am I looking for it? Well, I want to be able to switch this "feature" on and off easily, and commenting in/out those lines in VI isn't the most user-friendly way I can think of. So I thought I might move my user crontab file around (or rename it), it's empty besides those lines.
Would that work?
--Edit
Found it. Stupid Nemo can't tell me it hasn't permission to display stuff, it just pretends there is nothing there... So okay, the file is in /var/spool/cron/crontabs, which my user can't access, this means my idea of moving the file around won't work easily. Vi it is, then.
Where do I find my user crontab file?
Going through crontab -e created a file, but I can't find it. I thought it would appear inside /etc/cron.d, but it's not there.
(I just added some comment lines, to create the file and also be sure I'm looking at the right one, so doing a crontab -l I see it does indeed exist, somewhere.)
Why am I looking for it? Well, I want to be able to switch this "feature" on and off easily, and commenting in/out those lines in VI isn't the most user-friendly way I can think of. So I thought I might move my user crontab file around (or rename it), it's empty besides those lines.
Would that work?
--Edit
Found it. Stupid Nemo can't tell me it hasn't permission to display stuff, it just pretends there is nothing there... So okay, the file is in /var/spool/cron/crontabs, which my user can't access, this means my idea of moving the file around won't work easily. Vi it is, then.
Re: Need an Applet - How do you make them?
nano is friendlier (that is the default editor crontab recommends the first time you run it and it asks you which editor to use). But you can use your preferred graphical editor. If you are on Linux Mint 18.x Cinnamon/MATE/Xfce you do so with the command:
For Linux Mint 17.3 or earlier Cinnamon/Xfce replace "xed" with "gedit" and for MATE with "pluma".
If you're using KDE replace "xed" with "kate", regardless of your Linux Mint version.
EDITOR=/usr/bin/xed crontab -e
For Linux Mint 17.3 or earlier Cinnamon/Xfce replace "xed" with "gedit" and for MATE with "pluma".
If you're using KDE replace "xed" with "kate", regardless of your Linux Mint version.
Re: Need an Applet - How do you make them?
Great, that's much faster for me (and much less error-prone). Thank you!xenopeek wrote:If you are on Linux Mint 18.x Cinnamon/MATE/Xfce you do so with the command:
EDITOR=/usr/bin/xed crontab -e
Re: Need an Applet - How do you make them?
Thank you, bookmarked it. I'm happy though I don't need to use it...Habitual wrote:Writing applets
You see, I looked through that tutorial, and while I can clearly see what each line of code is doing, I'm afraid I would be totally unable to find those lines myself. I've never been a programmer, just a dabbler, and it's 20+ years since.