From e082250de0f96a379026555455e193f3b276cab6 Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Mon, 29 Jul 2019 20:11:18 +0200 Subject: [PATCH] Remove music script Signed-off-by: Severin Kaderli --- system/.local/bin/music | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 system/.local/bin/music diff --git a/system/.local/bin/music b/system/.local/bin/music deleted file mode 100755 index b31735b..0000000 --- a/system/.local/bin/music +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -# -# SCRIPT NAME: -# music -# -# AUTHOR: -# Severin Kaderli -# -# DESCRIPTION: -# Prints out the title of the current playing song using cmus-remote. -# -# USAGE: -# ./music - -QUERY="$(cmus-remote -Q)" - -STATUS="$(echo "$QUERY" | grep -e "status " | cut -d " " -f 2)" -ARTIST="$(echo "$QUERY" | grep -e " artist " | cut -d " " -f 3-)" -ALBUM="$(echo "$QUERY" | grep -e " album " | cut -d " " -f 3-)" -TITLE="$(echo "$QUERY" | grep -e " title " | cut -d " " -f 3-)" -position="$(echo "$QUERY" | grep -e "position " | cut -d " " -f 2)" -duration="$(echo "$QUERY" | grep -e "duration " | cut -d " " -f 2)" - -if [ "$STATUS" != "playing" ]; then - OUTPUT="Not playing" -else - pos_minutes=$(printf "%02d" $(("$position" / 60))) - pos_seconds=$(printf "%02d" $(("$position" % 60))) - - dur_minutes=$(printf "%02d" $(("$duration" / 60))) - dur_seconds=$(printf "%02d" $(("$duration" % 60))) - - OUTPUT="$ARTIST | $ALBUM | $TITLE | $pos_minutes:$pos_seconds / $dur_minutes:$dur_seconds" -fi - -echo "$OUTPUT"