You are not logged in.

#21 2019-11-17 05:02:27

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Alarm clock scripts

(bl-mpv is a sort of substitute GUI app with some tweaked settings, that can replace VLC or... or... as a player with a window. A user who opens a player from a menu with no file expects a window they can do something with. bl-mpv gives the mpv pseudo-gui which at least allows drag & drop, and give a couple of controls.)

But it would be nice if we could make this script usable on all BL systems without forcing a new media player install. aplay comes with alsa-utils so most people will have it, but right it doesn't support many file types. Is that important for an alarm clock?

damo wrote:

If aplay is used, we can have --file-filter="sounds|*.wav" in the file chooser, to only display wav files

+1 As long as we can find some suitable wav files.

PS any chance of being able to set a clock time as an alternative to so-many-minutes-later?
Even a date?
(At supports a lot of time settings.)

Last edited by johnraff (2019-11-17 05:04:28)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#22 2019-11-17 05:29:26

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Alarm clock scripts

There are probably a gazillion suitable wav files out there, so I guess it depends how many we would want to supply. Wavs are a similar size to images AFAICS, so not too much overhead to provide half-a-dozen I guess. I'll search out a few and try aplay instead of mpv.

(Thinks.... you could pass script parameters to set the media player you want to use? Then set different file filters from arrays, depending on what the player can utilize. Ooops, bloat-creep is starting again! Let's just use aplay and wavs smile)

I have been working on getting this script together into a useable state for now (impossible without misko's work!). I haven't even started thinking about bronto's at approach yet  8o

And yes, setting a time instead of an interval is an aspiration of course wink


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#23 2019-11-17 05:48:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Alarm clock scripts

It all looks like a great addition to the tint2 clock, right-click isn't used atm. cool


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#24 2019-11-17 09:56:54

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

Gui stuff

I've added yad input for 'reason' in mine, it will popup when the thing is launched from gmrun/obmenu for example.

The reaction to right-click clock could be a menu with

~/bin/beepmein.txt.menu

beepmein ~ 1, beepmein 1
beepmein ~ 5, beepmein 5
beepmein ~ 15, beepmein 15
beepmein ~ 30, beepmein 30
beepmein ~ 60, beepmein 60
beepmein <time>, gmrun beepmein
beepmein --alarm <time>, gmrun 'beepmein --alarm '
killall beepmein noises, killall beepmein

Gmrun could/shall be replaced with something better for time input (what?).
Note: Tilda (~) is used for display to denote 'approximate'.

and in tint2rc

clock_rclick_command = cat ~/bin/beepmein.txt.menu | jgmenu --simple --icon-size=0

and in jgmenurc

position_mode = pointer

jgmenu --version

jgmenu v3.5

Yields
conceptc5b053c3a0f94163.th.png

And a dynamic version (jgmenu simple pipe) of menu
scrot12376.th.png
Mic Drop.

Last edited by brontosaurusrex (2019-11-17 20:37:46)

Offline

#25 2019-11-18 06:20:46

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Alarm clock scripts

I've got a bash yad time/date version working after a fashion, using at and aplay. It is proof-of-concept ATM. and not for public view  :8


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#26 2019-11-18 06:34:06

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Alarm clock scripts

Just throwing stuff in here, please ignore if you wish:

*) At alarm time, turn the volume up if it's down?

*) Alternative, extreme visual alert, like flash the whole screen on and off?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#27 2019-11-18 10:38:28

clusterF
Member
Registered: 2019-05-07
Posts: 539

Re: Alarm clock scripts

johnraff wrote:

Just throwing stuff in here, please ignore if you wish:

*) Alternative, extreme visual alert, like flash the whole screen on and off?

Possibly with the use of xscreensaver maybe?

Offline

#28 2019-11-18 11:13:47

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

johnraff wrote:

*) Alternative, extreme visual alert, like flash the whole screen on and off?

Improved version of this should blink on some systems.

p.s. Combined with xbacklight might make a more universal solution.

edit: If someone want's to improve on this (not me), probably redshift sources might be the way to find how-to

redshift -m list
Available adjustment methods:
  drm
  randr
  vidmode
  dummy

*) At alarm time, turn the volume up if it's down?

Unmute or ...?

amixer sset Master unmute # ?

edit: ^ Probably a bad idea to mess with peoples volume at any point in time.

Last edited by brontosaurusrex (2019-11-19 08:41:18)

Offline

#29 2019-11-18 17:38:50

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Alarm clock scripts

brontosaurusrex wrote:

...
edit: ^ Probably a bad idea to mess with peoples volume at any point in time.

So a pulsing screen, or pop-up, could help with that.

I guess you could re-set the sound values after the alarm has finished, but there would always be a problem if something is already playing (although that would be an alert in itself!)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#30 2019-11-18 20:37:23

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

^The problem would also be if something is playing and user would mute that on purpose, only to be overridden by reminder.

I improved the blink script a bit and it runs surprisingly smooth (seems to be in sync with monitor refresh) on my old nvidia and surprisingly out-of-sync (visible tearing) on an old integrated intel graphics. edit: Added slight sleep into gradation itself which seems to reduce tearing on intel, but shall probably decrease smoothness on nvidia.

edit:
- Also the way it is done right now is that on faster machines it will blink faster than on slower ones (but the difference should be small, so could be a nonissue)
- According to xrandr docs it appears there is possibility that no monitor is marked as primary (to research) edit: It shall now search for name of the 'primary AND connected' or else '1st connected' will do.
(Because I found a version where my primary is not connected..., I assume there are more ways that this could fail).

And I incorporated blink script as function to beepmein (and it's not working there, possibly due to 'at' environment ...), fixed by adding 'DISPLAY=${DISPLAY}' at start of the exported job.

Last edited by brontosaurusrex (2019-11-19 09:24:27)

Offline

#31 2019-11-19 01:07:28

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 655
Website

Re: Alarm clock scripts

Wow guys this is really turning into a cool project.  I don’t know if I’ll use it much since I occasionally use alarms and just on my phone but will definitely kick the tires once y’all are done.

Offline

#32 2019-11-19 04:48:29

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,652
Website

Re: Alarm clock scripts

I think I actually might use this myself. Phone is usually switched off, and often forget something I have to do, getting deep into some trivia...


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#33 2019-11-20 11:19:30

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

So I was awoken by 'mpv' playing axelF.mod this morning, but there are 'speaker-test' beeps that will be triggered if
- script is not configured to find sample
- mpv is not present

Also there is now some defense in the field of 'user not getting at syntax right'.

beepmein yesterday
at time format error. # and double beep.

More user testing would be needed before I can call this ok for general consumption thought.

btw: What is expected to happen on --reaction:
- sample or beep
- notification
- screen blink (on some systems)

Last edited by brontosaurusrex (2019-11-20 12:15:38)

Offline

#34 2019-11-29 19:54:01

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

Some changes to beepmein.

changelog wrote:

    fixed --help a bit
    --set-alarm && --set-remind, also with yad --file selector (idea by Damo)

One can now say

beepmein --set-alarm /path/to/file.flac

or

beepmein --set-alarm

and yad --file selector should pop-up.

Last edited by brontosaurusrex (2019-11-29 20:23:48)

Offline

#35 2019-12-03 19:43:29

bigbenaugust
Member
From: the 704 / KCLT
Registered: 2017-05-20
Posts: 179

Re: Alarm clock scripts

Back in the day, I used to just use:

at 06:00 mpg123 -m some_mp3_file.mp3

lol

This is infinitely more sophisticated.


--Ben
BL / MX / Raspbian... and a whole bunch of RHEL boxes. :)

Offline

#36 2019-12-03 21:45:41

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

changelog wrote:

--list at jobs
beepmein relative to now shortcut 'beepmein <minutes>' is now the only one that has precision in seconds

todo: why not in nanoseconds

sleep "$(date +%_S.%N)"
misko_2083 wrote:

When using "at" app DISPLAY env variable needs to be set to run Yad or some other gui apps.
"At" doesn't set DISPLAY and some other variables.

True that.

beepmein --list | sort
617 Wed Dec  4 07:00:00 2019 a b | sleep 0; DISPLAY=:0 beepmein --reaction --alarm 'Wake up.'
619 Wed Dec  4 07:30:00 2019 a b | sleep 0; DISPLAY=:0 beepmein --reaction --alarm 'Really?'

Last edited by brontosaurusrex (2019-12-04 07:23:10)

Offline

#37 2019-12-04 06:28:10

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 655
Website

Re: Alarm clock scripts

Lol, lookin' like beepmein is relentless & will get your butt up.  Nice work @Brex

Offline

#38 2019-12-04 20:55:16

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

@cog, thanks.

So I've added the delay in (nano)seconds to this specific beepmein-custom-setter, this delay is actually added to job itself and should (the purpose) bring 'in seconds precision' to short-timed-relative-to-now events, like 'beepmein 5', however if the user says 'beepmein now + 5 minutes' that will not happen (we are in 'at' land). < is there a short way to explain all this in --help?

Last edited by brontosaurusrex (2019-12-04 20:57:06)

Offline

#39 2019-12-05 06:55:03

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

I'am thinking spaghetti actually, and how they need exactly 12 minutes. (Pretty sure they eat them in CERN as well)

Last edited by brontosaurusrex (2019-12-05 07:05:09)

Offline

#40 2020-01-22 10:30:06

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,746

Re: Alarm clock scripts

@misko, nice, some thoughts (I build latest yad)
- position 'Repeat' and 'Loop forever' under 'Select a file to play' so it is clear this is related to sound and not repeating alarm every day (or something)
- Select a file to play' doesn't do anything for me, I get file dialog after clicking 'Set Alarm!'
- 'At Job List' is showing two alarms set at same time, but when running atq from cli there is only single event
- Missing delete event functionality?

edit: I wonder if analog picker like
https://weareoutman.github.io/clockpicker/ or
https://github.com/luncheon/clocklet
could be implemented?

edit2: I have repacked some css/html/js/svg clock for testing purposes and it works (but don't feel brave enough for js->yad interface as it would be needed for picker).
https://github.com/brontosaurusrex/svgclockcool
jbTMpz4b.png

Last edited by brontosaurusrex (2020-01-22 23:31:53)

Offline

Board footer

Powered by FluxBB