-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart
executable file
·40 lines (35 loc) · 1021 Bytes
/
start
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
#!/bin/sh
# we search for musics on XDG_MUSIC_DIR by default, change below
# for another path
MUSIC_DIR="$XDG_MUSIC_DIR"
CATCHME_SOCKET_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/catchme/catchme-socket"
## Interesting mpv flags to add:
## add these alongisde mpv exec call below
# Enables auto-load extension
# --script="$XDG_CONFIG_HOME/mpv/scripts/scripts.disable/autoload.lua" \
# Volume normalization
# --af="lavfi=[loudnorm=I=-16:TP=-3:LRA=4]" \
pkill -f "mpv.*catchme-socket"
find "$MUSIC_DIR" \( -name "*.mp3" \
-o -name "*.mkv" \
-o -name "*.ogg" \
-o -name "*.flac" \
-o -name "*.m4a" \
-o -name "*.opus" \) \
! -path "sounds" \
-type f |
sort -R |
exec mpv --really-quiet \
--volume=70 \
--video=no \
--force-window=no \
--volume-max=120 \
--pause \
--loop-playlist=inf \
--term-osd=no \
--idle=yes \
--load-scripts=no \
--script="$XDG_CONFIG_HOME/mpv/scripts/scripts.disable/mpv-catchme/" \
--input-ipc-server="$CATCHME_SOCKET_PATH" \
"$@" \
--playlist=- >/dev/null 2>&1 &