Chore: format using `shfmt`
Use [`shfmt`](https://github.com/mvdan/sh) to format kunst. Fixes the remaining issues in #14. No flags/customizations are needed; all have been added to .editorconfig.
This commit is contained in:
parent
e03b872d27
commit
37069dc6a9
|
@ -3,10 +3,12 @@ root = true
|
||||||
# Unix-style newlines with a newline ending every file
|
# Unix-style newlines with a newline ending every file
|
||||||
[*]
|
[*]
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = false
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
binary_next_line = true
|
||||||
|
switch_case_indent = true
|
||||||
|
|
||||||
# Tab indentation (no size specified)
|
# Tab indentation (no size specified)
|
||||||
[*.md]
|
[*.md]
|
||||||
|
|
14
kunst
14
kunst
|
@ -6,7 +6,6 @@
|
||||||
#
|
#
|
||||||
# Dependencies: sxiv or imv, bash, ffmpeg, mpc, jq, mpd
|
# Dependencies: sxiv or imv, bash, ffmpeg, mpc, jq, mpd
|
||||||
|
|
||||||
|
|
||||||
VERSION=1.2.5
|
VERSION=1.2.5
|
||||||
COVER=/tmp/kunst.jpg
|
COVER=/tmp/kunst.jpg
|
||||||
MUSIC_DIR=~/Music/
|
MUSIC_DIR=~/Music/
|
||||||
|
@ -14,7 +13,6 @@ WIDTH=250
|
||||||
SIZE="${WIDTH}x${WIDTH}"
|
SIZE="${WIDTH}x${WIDTH}"
|
||||||
POSITION="+0+0"
|
POSITION="+0+0"
|
||||||
|
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
echo "usage: kunst [-h] [--size "px"] [--position "+x+y"] [--viewer <imv|x11>] [--music_dir "path/to/dir"] [--silent] [--version]"
|
echo "usage: kunst [-h] [--size "px"] [--position "+x+y"] [--viewer <imv|x11>] [--music_dir "path/to/dir"] [--silent] [--version]"
|
||||||
echo " "
|
echo " "
|
||||||
|
@ -33,7 +31,6 @@ show_help() {
|
||||||
echo " --version show the version of kunst you are using"
|
echo " --version show the version of kunst you are using"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Parse the arguments
|
# Parse the arguments
|
||||||
options=$(getopt -o h --long position:,size:,music_dir:,version,silent,help -- "$@")
|
options=$(getopt -o h --long position:,size:,music_dir:,version,silent,help -- "$@")
|
||||||
eval set -- "$options"
|
eval set -- "$options"
|
||||||
|
@ -41,19 +38,19 @@ eval set -- "$options"
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--size)
|
--size)
|
||||||
shift;
|
shift
|
||||||
SIZE=$1
|
SIZE=$1
|
||||||
;;
|
;;
|
||||||
--position)
|
--position)
|
||||||
shift;
|
shift
|
||||||
POSITION=$1
|
POSITION=$1
|
||||||
;;
|
;;
|
||||||
--viewer)
|
--viewer)
|
||||||
shift;
|
shift
|
||||||
VIEWER=$1
|
VIEWER=$1
|
||||||
;;
|
;;
|
||||||
--music_dir)
|
--music_dir)
|
||||||
shift;
|
shift
|
||||||
MUSIC_DIR=$1
|
MUSIC_DIR=$1
|
||||||
;;
|
;;
|
||||||
-h | --help)
|
-h | --help)
|
||||||
|
@ -89,7 +86,6 @@ read -d '' MUSIC_NOTE << EOF
|
||||||
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJESURBVGhD7Zg/axRRFMVXAtpYphEVREKClnHfJI0MmReSfAC3tRejhaBgo70fwN7aD2BvEU0gfztbu5AqMxNjoVnvG87KZXy7z5m5dxLI/OCw8Pade+7M3n3Dbq+jo6OjY8RwMJhKk+hhlph3eRJ9w/LF5jCOr1PTj6jpD7mNjkjDkbDl4vFjpX87teZJlkSfSD9501zYfv5QJ1fyZHGexuJtZs12ZqMzX8NlwX4+nK3NXMutWaOm39Nd/u5rMCSUao80fjBNwY+p8Y+krNxQVaGsLsfWzFLYS2r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2thSRceSM0/zVfnb+CtWvB6WNJFOlC6XhDpQOl6QaQDpesFkQ6UrhdEOlC6XpA6gcPB/avumKXnxCadXHkha766tTr1GlE18CRZvEmN7nHfOMGiS5XA4mdmYg64Z5Jg06VKYHlEQoKtOVIz6zx8f0iwNUNyZt2F+3zjBFt9pGe22gWYFLb6lEckJNjGUmWEssR8ga0+0jNL9Z75fD7Rp7UOW32kZxb/1u37vFyUu+sODtjqozGzxaFADfprFM3vuD3Y3gytmf17LJPHXbgTNb5BWhe58yNan1lpWp9ZDVqdWS1am9mOjo7LRq/3B1ESKyYUVquzAAAAAElFTkSuQmCC
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
is_connected() {
|
is_connected() {
|
||||||
# Check if internet is connected. We are using api.deezer.com to test
|
# Check if internet is connected. We are using api.deezer.com to test
|
||||||
# if the internet is connected because if api.deezer.com is down or
|
# if the internet is connected because if api.deezer.com is down or
|
||||||
|
@ -104,7 +100,6 @@ is_connected() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get_cover_online() {
|
get_cover_online() {
|
||||||
# Check if connected to internet
|
# Check if connected to internet
|
||||||
is_connected
|
is_connected
|
||||||
|
@ -135,7 +130,6 @@ get_cover_online() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
update_cover() {
|
update_cover() {
|
||||||
# Extract the album art from the mp3 file and dont show the messsy
|
# Extract the album art from the mp3 file and dont show the messsy
|
||||||
# output of ffmpeg
|
# output of ffmpeg
|
||||||
|
|
Loading…
Reference in New Issue