From 67ffc7f964ef4a7aa49a11b26991d4cd6291f9f2 Mon Sep 17 00:00:00 2001 From: Mats van Reenen Date: Fri, 25 Dec 2020 20:43:30 +0100 Subject: [PATCH] add first scripts --- scripts/0 22-23 * * 0-4 - go sleep.sh | 12 ++++++++++++ scripts/15 8 * * 1-5 - alarm.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 scripts/0 22-23 * * 0-4 - go sleep.sh create mode 100644 scripts/15 8 * * 1-5 - alarm.sh diff --git a/scripts/0 22-23 * * 0-4 - go sleep.sh b/scripts/0 22-23 * * 0-4 - go sleep.sh new file mode 100644 index 0000000..76cf608 --- /dev/null +++ b/scripts/0 22-23 * * 0-4 - go sleep.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +mpd="/usr/bin/mpc" +function amix(){ + /usr/bin/amixer sset 'Headphone' $1 +} + +function playlist(){ + . /home/pi/playlists/$1.sh +} + +$mpd stop \ No newline at end of file diff --git a/scripts/15 8 * * 1-5 - alarm.sh b/scripts/15 8 * * 1-5 - alarm.sh new file mode 100644 index 0000000..99cb267 --- /dev/null +++ b/scripts/15 8 * * 1-5 - alarm.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +mpd="/usr/bin/mpc" +function amix(){ + /usr/bin/amixer sset 'Headphone' $1 +} + +function playlist(){ + . /home/pi/playlists/$1.sh +} + +$mpd clear +$mpd add "Wintergaten/Prototype 1.mp3" +$mpd repeat off +amix 10% + +$mpd play + +sleep 900 # 15 min + +$mpd add "Wintergaten/Prototype 1.mp3" +amix 30% + +$mpd play + +playlist whoo