aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-16 10:21:18 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-16 10:21:18 +0200
commitfb6d9a33c8a7b10557f7119865877f648d8f05da (patch)
tree07dc2afefdea417667c2bb8f059a6a3167f19be6 /bin
parente1f86f92ffcba791739dfea105cb5d8e9081db5e (diff)
parentcb9e981c80476a7297ecd7c80ba9cd8eafe0f0d1 (diff)
downloaddotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.tar.gz
dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.tar.bz2
dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.zip
Merge branch 'master' into carbon
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tag-music48
-rwxr-xr-xbin/touchpad-toggle9
2 files changed, 57 insertions, 0 deletions
diff --git a/bin/tag-music b/bin/tag-music
new file mode 100755
index 0000000..17d6aac
--- /dev/null
+++ b/bin/tag-music
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+music_dir="$HOME/Music"
+
+for artist_dir in "$music_dir"/*
+do
+ [ ! -d "$artist_dir" ] && continue
+ artist="$(basename "$artist_dir")"
+ [ "$artist" = backup ] && continue
+
+ for album_dir in "$artist_dir"/*
+ do
+ album="$(basename "$album_dir")"
+ [ ! -d "$album_dir" ] && continue
+
+ 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
+ done
+ done
+done
diff --git a/bin/touchpad-toggle b/bin/touchpad-toggle
new file mode 100755
index 0000000..f0a86a1
--- /dev/null
+++ b/bin/touchpad-toggle
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+touchpad_name='ETPS/2 Elantech Touchpad'
+
+active="$(xinput list-props "$touchpad_name" | grep 'Device Enabled' | cut -f 3)"
+
+[ "$active" -eq 1 ] &&
+ xinput disable "$touchpad_name" ||
+ xinput enable "$touchpad_name"