Initial Commit

This commit is contained in:
David Thurstenson 2021-04-22 00:50:33 -05:00
commit e73482c86a
2 changed files with 88 additions and 0 deletions

5
config.yaml Normal file
View File

@ -0,0 +1,5 @@
playlist:
- name: testvids
dir: ~/Videos/testvideos
config:
defaultStorageDir: ~/Videos/testmedia

83
testmedia Normal file
View File

@ -0,0 +1,83 @@
#!/usr/bin/env bash
####
# tllib init
####
export tllib_dir=/usr/share/tllib
export tllib_required=(tlmsg tlcm)
eval $(tllib-include)
# Set up tlmsg config from the outside
declare -A tlmsgconf
# Set up tlcm config array
declare -A tlcm_conf
# Setting default tlcm options
export tlcm_conf=(
[fpath]=$XDG_CONFIG_HOME/tl-testmedia.conf
)
####
####
# Runtime config init
####
# Set up runtime config array
#declare -A conf
####
####
# Option parsing
####
while getopts ":c:v:" opt; do
case $opt in
c)
export tlcm_conf[fpath]="$OPTARG"
;;
v)
# -vv
if [[ "$OPTARG" == "v" ]]; then
tlmsgconf[opmode]=2
# -vvv
elif [[ "$OPTARG" == "vv" ]]; then
tlmsgconf[opmode]=3
else
tlmsg -e "Incorrect verbosity level: $OPTARG"
fi
;;
:)
# -v
if [[ "$OPTARG" == "-v" ]]; then
export tlmsgconf[opmode]=1
else
tlmsg -e "Option requires argument: $OPTARG"
fi
;;
*)
tlmsg -e "Unknown option: $OPTARG"
;;
esac
done
####
if ! tlcm check; then
tlmsg -e "Unable to read config file: ${tlcm_conf[fpath]}"
exit 1
fi
sync() {
:
}
$1