Merge pull request #4 from mateossh/fix-indentation

Fix indentation inconsistency
This commit is contained in:
Siddharth Dushantha 2019-02-17 18:39:23 +01:00 committed by GitHub
commit 5a58f89f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 12 deletions

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = tab
indent_size = 4
# Tab indentation (no size specified)
[*.md]
indent_style = space
indent_size = 2

24
kunst
View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# ┬┌─┬ ┬┌┐┌┌─┐┌┬┐ # ┬┌─┬ ┬┌┐┌┌─┐┌┬┐
# ├┴┐│ ││││└─┐ │ # ├┴┐│ ││││└─┐ │
# ┴ ┴└─┘┘└┘└─┘ ┴ # ┴ ┴└─┘┘└┘└─┘ ┴
# Created by Siddharth Dushantha # Created by Siddharth Dushantha
# VERSION=1.0 # VERSION=1.0
@ -22,21 +22,21 @@ update_cover() {
# output of ffmpeg # output of ffmpeg
ffmpeg -i "$MUSIC_DIR$(mpc current -f %file%)" $COVER -y &> /dev/null ffmpeg -i "$MUSIC_DIR$(mpc current -f %file%)" $COVER -y &> /dev/null
# get the status of the previous command # get the status of the previous command
STATUS=$? STATUS=$?
# check if the file has a embbeded album art # check if the file has a embbeded album art
if [ $STATUS -eq 0 ];then if [ $STATUS -eq 0 ];then
echo "kunst: extracted album art" echo "kunst: extracted album art"
ARTLESS=false ARTLESS=false
else else
echo "error: file does not have an album art" echo "error: file does not have an album art"
ARTLESS=true ARTLESS=true
return return
fi fi
# resize the image to 250x250 # resize the image to 250x250
convert $COVER -resize 250x250 $COVER convert $COVER -resize 250x250 $COVER
echo "kunst: resized album art to 250x250" echo "kunst: resized album art to 250x250"
} }
@ -46,24 +46,24 @@ main() {
update_cover update_cover
if [ $ARTLESS == true ];then if [ $ARTLESS == true ];then
# change the path to COVER because the music note # change the path to COVER because the music note
# image is a png not jpg # image is a png not jpg
COVER=/tmp/kunst.png COVER=/tmp/kunst.png
# decode the base64 encoded image and save it # decode the base64 encoded image and save it
# to /tmp/kunst.png # to /tmp/kunst.png
echo "$MUSIC_NOTE" | base64 --decode > $COVER echo "$MUSIC_NOTE" | base64 --decode > $COVER
fi fi
echo "kunst: swapped album art to $(mpc current)" echo "kunst: swapped album art to $(mpc current)"
# display the album art using sxiv # display the album art using sxiv
sxiv -g 250x250 -b $COVER & sxiv -g 250x250 -b $COVER &
while true; do while true; do
# waiting for an event from mpd; play/pause/next/previous # waiting for an event from mpd; play/pause/next/previous
# this is lets kunst use less CPU :) # this is lets kunst use less CPU :)
mpc idle &> /dev/null mpc idle &> /dev/null
echo "kunst: received event from mpd" echo "kunst: received event from mpd"
update_cover update_cover