summaryrefslogtreecommitdiff
path: root/bin/goodmorning
blob: 1306cbc27fe264165036fef6c6fdac2e75855bdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

VOLUME=70                      # lid closed!
SONG="/home/swhitton/lib/annex/music/Soundtracks/Cardcaptor Sakura/Cardcaptor Sakura OST/2-4-32 - Yokoku BGM (BGM for Preview).mp3"

# dow=$(date +%u)
# # not at the weekend
# if [ "$dow" = "6" -o "$dow" = "7" ]; then
#     exit 0
# fi

# systemd doesn't set $HOME for services
HOME=/home/swhitton
export HOME

. $HOME/.shenv

# make sure it's not too loud nor muted.  (`-c 0' ensures we're not
# just interacting with PulseAudio)
amixer sset Master ${VOLUME}%
amixer sset Master unmute
amixer -c 0 sset "Auto-Mute Mode" Disabled
amixer -c 0 sset Master unmute
amixer -c 0 sset Speaker 100%
amixer -c 0 sset Speaker unmute
amixer -c 0 sset PCM 100%
# amixer -c 0 sset PCM unmute # invalid command

# play the alarm (TODO: randomly choose from folder of symlinks into annex)
mplayer "$SONG"

# probably want auto-mute back on (TODO: turn on/off only if it's not already off)
amixer -c 0 sset "Auto-Mute Mode" Enabled