aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
l---------bin/bin1
-rwxr-xr-xbin/project-open24
-rwxr-xr-xbin/tag-music38
3 files changed, 29 insertions, 34 deletions
diff --git a/bin/bin b/bin/bin
new file mode 120000
index 0000000..4f8476b
--- /dev/null
+++ b/bin/bin
@@ -0,0 +1 @@
+/home/charles/git/dotfiles/bin \ No newline at end of file
diff --git a/bin/project-open b/bin/project-open
index 0dd5d31..955d31d 100755
--- a/bin/project-open
+++ b/bin/project-open
@@ -1,6 +1,7 @@
#!/bin/sh
# shellcheck disable=SC2088
+# (tile does not expand in single quote)
dest=$(
find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' |
sort -r |
@@ -15,7 +16,7 @@ dest_path="$HOME/git/$dest"
if cd "$dest_path" 2> /dev/null
then
touch "$dest_path"
- st
+ exec st
else
while [ -z "$choice" ]
do
@@ -27,16 +28,25 @@ else
mkdir -p "$dest_path"
cd "$dest_path" || exit 1
git init
+ exec st
;;
+
"clone")
- url="$(echo '' | dmenu -p "Entry repository url: ")"
- notify-send "Cloning $url to $dest_path"
- git clone --recursive "$url" "$dest_path" ||
- (notify-send -u critical "Clone failed"; exit 1)
- cd "$dest_path" || exit 1
+ while [ -z "$remote_choice" ]
+ do
+ remote_choice=$(printf 'github.com\ncacharle.xyz\nother' | dmenu -p "Remote location")
+ done
+ case "$remote_choice" in
+ "github.com") prefix='git@github.com:cacharle/' ;;
+ "cacharle.xyz") prefix='git@cacharle.xyz:/srv/git/' ;;
+ "other") ;;
+ esac
+ url="$prefix$(echo "$dest" | dmenu -p "Enter repository url: $prefix")"
+ st -e /bin/sh -c "git clone --recursive '$url' '$dest_path' && cd '$dest_path' && exec $SHELL" ||
+ notify-send -u critical "Could not clone $url in $dest_path" && exit 1
;;
+
"cancel") exit ;;
*) exit 1 ;;
esac
- st
fi
diff --git a/bin/tag-music b/bin/tag-music
index 17d6aac..e801132 100755
--- a/bin/tag-music
+++ b/bin/tag-music
@@ -16,33 +16,17 @@ do
for song_file in "$album_dir"/*
do
[ ! -f "$song_file" ] && continue
- song="$(basename "$song_file" | cut -d '.' -f 1)"
- # echo "$artist"
- # echo "$album"
- # echo "$song"
- case "$song_file" in
- *.ogg)
- ;;
- *.opus)
- echo "OPUS: $song_file"
- echo "Title=$song
-Artist=$artist
-Album=$album
-Track=
-Total=
-Date=
-Genre=
-Comment=" | opustags -i -S "$song_file"
- ;;
- *.mp3)
- id3tag --artist "$artist" --album "$album" --song "$song" "$songfile"
- ;;
- *.m4a)
- id3tag --artist "$artist" --album "$album" --song "$song" "$songfile"
- ;;
- *)
- ;;
- esac
+ song="$(basename "$song_file" | rev | cut -d '.' -f 2- | rev)"
+ # echo $song_file
+ track=0
+ if expr "$song" : "[0-9][0-9]*\-.*" > /dev/null
+ then
+ track="$(echo "$song" | cut -d '-' -f 1)"
+ song="$(echo "$song" | cut -d '-' -f 2-)"
+ fi
+ # echo $track $song
+ echo $song_file
+ taffy --artist "$artist" --album "$album" --title "$song" --track "$track" "$song_file"
done
done
done