Cleaner async, music-client aliased to go trough awesome
This commit is contained in:
@@ -112,17 +112,33 @@ if [ -d "$GCLONE_PATH" ]; then
|
||||
fi
|
||||
|
||||
# Music things
|
||||
# command -v music-server > /dev/null 2>&1
|
||||
# if [ $? -eq 0 ]; then
|
||||
# mplayer() {
|
||||
# ps -e | grep music-server > /dev/null 2>&1
|
||||
# if [ $? -ne 0 ]; then
|
||||
# nohup music-server > /dev/null 2>&1 &
|
||||
# disown
|
||||
# sleep 0.2s
|
||||
# fi
|
||||
# filename=$(echo `realpath $1` | sed 's/ /\\\\ /g' | sed "s/'/\\\\\\\\'/g")
|
||||
# awesome-client "require('music').execute_command('file ' .. \"$filename\")"
|
||||
# }
|
||||
# fi
|
||||
command -v music-server > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
# If music-server is installed, check if awesome is running with screenfetch
|
||||
command -v screenfetch > /dev/null 2>&1
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
screenfetch -d wm -nN | grep "Awesome" > /dev/null 2>&1
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
# User is running awesome, music-client will go through awesome-client
|
||||
music-client() {
|
||||
command=$1
|
||||
if [ $# -eq 1 ]; then
|
||||
echo "require('music').execute_command(\"$command\")"
|
||||
else
|
||||
library_path=$(realpath $2 | rev | cut -d '/' -f -3 | rev)
|
||||
awesome_command="require('music').execute_command(\"$command\",\"$library_path\")"
|
||||
echo $awesome_command | awesome-client
|
||||
fi
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user