-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenconfig
71 lines (64 loc) · 2.21 KB
/
genconfig
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/zsh
# Copyright 2015 Han Boetes <[email protected]>
# For license info see http://unlicense.org/
config="~/.config/muzshic/config"
prog="${0:t}"
if [[ -f ${~config} ]]; then
echo "$prog: $config already exists. Exiting."
exit 0
else
mkdir -m 700 -p ${~config:h}
cat << EOF > ${~config}
# How do you want to search your music database
GREP="grep -i"
# Music directory: This can simply be a single path like:
# database="/mp3"
# Or anything else that find and zsh accept. Curly braces only work in arrays.
database="/mp3/(4ad|Jazz|HipHop|Metal|Klassiek|Pop|Soundtracks)"
filetypes=(mp3 ogg flac ape aac wav m4a mkv mpc opus webm dff)
# Make sure it ends in .gz
playlist="/mp3/playlist.gz"
play_queue="/mp3/queue"
play_hist="/mp3/history"
# Number of tracks to print from the history
qhist=10
# Number of tracks in the queue to print
qfuture=20
# Enable debugging
debug=0
# Function for the mediaplayer. You simply plug in your fancy high
# end device and check the directory: "/dev/snd/by-id" for whatever
# udev made out of it and then use "mpv --audio-device help" to see
# how mpv calls it. Ah yes, make sure pulse isn't running, it kills
# audio quality.
mediaplayer()
{
# This is what I use at home, you'll need an up to date mpv version for it to work.
# if [ -L /dev/snd/by-id/usb-Logitech_Logitech_G933_Gaming_Wireless_Headset-00 ]; then
# device="alsa/default:CARD=H"
# elif [ -L /dev/snd/by-id/usb-Creative_Technology_USB_Sound_Blaster_HD_000000te-00 ]; then
# device="alsa/default:CARD=HD"
# else
# device="auto"
# fi
# mpv --audio-device \$device -vo null -af volume=-10:replaygain-album,equalizer=0:0:0:0:0:0:0:0:0:0 --msg-level all=no,statusline=v "\$@"
mpv --really-quiet "\$@"
}
# This function contains the local actions you want to have performed
# when playing a song
local_print_song()
{
# print "NP: \${song:t}" > ~/.nowplaying
# rsync ~/.nowplaying [email protected]: &
}
# This function contains the local actions you want to have performed
# when all playing is finished
local_unprint_song()
{
# : > ~/.nowplaying
# rsync ~/.nowplaying [email protected]: &
}
EOF
echo "$prog: Please edit and change the file $config to your liking."
exit 0
fi