added README

John McQuah 2022-03-21 11:31:20 -04:00
parent c07335bf5e
commit d474237518
4 changed files with 87 additions and 5 deletions

View File

@ -332,11 +332,11 @@ f:5a1495ba54a541d79d29e7ce959d1d05:szip/.footprint

View File

@ -1,6 +1,6 @@
untrusted comment: verify with /etc/ports/
SHA256 (Pkgfile) = c6a63405841ecea18b783c342b406af496f53eaa7e062def2ed98bdef40d35cf
SHA256 (.footprint) = e381b96011b0b5d436dc16328dc442cd0cc58d2ad5a1a065c99cb8106f21b473
SHA256 ( = f6fbb373da4bca5d21e3246a72077d26e1aac1c11b07d37aa33f0119edf772ae
SHA256 ( = be0e1fd9c96ce85dd13fd5bf882ad61d4d57601502e265b8d0e410ec1d6708fe
SHA256 (Makefile) = 4e349a81457b623f8a26eda596fdffda6167b1d764d75a0fb83b02cdb7d95032

deadbeef-alarm/ Normal file
View File

@ -0,0 +1,82 @@
# alarm clock plugin for DeaDBeeF
## About
This plugin allows the DeaDBeeF music player to serve as an alarm clock.
Even with its comprehensive set of command-line options, DeaDBeeF is
ultimately a graphical program, in most cases completely unreachable
from the restricted environment in which crontab shell scripts are executed.
The MPRIS plugin[1] does allow some control of the media player from a crontab
script, but because the dbus session bus address is not exported to cron
tasks, this environment variable must be hard-coded in the shell script
you intend to use for activating DeaDBeeF. (Perhaps a hook for
could automatically update your shell script after a successful login and
dbus session launch.) Even after surmounting this obstacle, you'll discover
that the MPRIS plugin implements only one method for selecting a particular
file for playback (OpenUri), and to assemble an entire playlist with this
method you would have to parse the metadata of each song to determine how
long the parent process should sleep between successive calls of OpenUri.
**TLDR**: working around the limitations of crontab and MPRIS is more
trouble than building a specialized plugin for alarm clock functionality.
To close the gap between DeaDBeeF and its console-interface counterparts
(moc, mpd, cmus -- all of which *can* be controlled by scripts in a crontab),
this plugin translates the underlying logic of the audacious alarm
plugin[2] into the DeaDBeeF idiom. The configuration dialog lets you choose
which days of the week the alarm goes off, what time of day, and which
playlist you want loaded. Leaving the playlist field empty (or selecting
an invalid file) will just start playback at the beginning of the current
list when the alarm goes off.
## What is missing
The following features were present in the audacious alarm plugin, but
have not been implemented here.
- Volume fading from quiet to loud after a fixed time interval. If you need that kind of control, the mixer commands for most audio stacks (ALSA, OSS, Pipewire, Pulseaudio, sndio) work fine when executed within crontab scripts, and you can just leave the DeaDBeeF volume slider at its highest level.
- Stopping the playback after a specified time interval.
(TODO: let the plugin itself turn off repeat mode if that behaviour is
desired, simply by adding a "disable repeat mode" checkbox to the alarm
configuration dialog. It then becomes the user's responsibility to make
sure a playlist of the appropriate length is selected, so playback doesn't
continue past the transition from sleep to wakefulness.)
- Setting a different alarm time for each day of the week. Sleep
professionals recommend that you stick to a consistent bedtime and
wakeup time for optimal health. (But if you have a healthy sleep regimen in
the first place, you probably wake up at the right time without an alarm.
Omitting this feature thus makes the plugin less useful to people who
genuinely need a mechanical disruption of their established sleep-wake cycle.)
## How to install
### For CRUX users
- cd to a directory in your local ports overlay
- download the source code from this host:
`httpup sync deadbeef-alarm`
- prt-get depinst install deadbeef-alarm
### For users of other Linux distributions
- check that all dependencies and header files are installed (DeaDBeeF
and glib)
- save the source code and the Makefile
and ``)
into a working directory.
- cd to the working directory and run make. Invoke make with
`GLIB_CXX_FLAGS="$(pkg-config --cflags glib-2.0)"` and
`GLIB_LD_FLAGS="$(pkg-config --libs glib-2.0)"` if your
distribution has installed the shared glib libraries in non-standard
- run `make install` , optionally prepending a custom setting for PREFIX
(such as $HOME/.local) or DESTDIR.
## How to contribute
Patches are welcome. See the header of the accompanying Pkgfile for
contact information.

View File

@ -180,7 +180,7 @@ static DB_misc_t plugin = {
"You should have received a copy of the GNU General Public License\n"
"along with this program; if not, write to the Free Software\n"
"Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n",
.website = "",
.website = "",
.start = onStart,
.stop = onStop,
.connect = NULL,