aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-01 18:13:25 +0100
committerSoispha <soispha@vhack.eu>2024-01-01 18:13:25 +0100
commitfae458378581faa4ae63e03a927c7549470d4fdf (patch)
treebb02363b46aa5fa904d7b2a2360d617f5a68f5c3 /hm/soispha
parentfix(hm/conf/yambar): Add some padding (diff)
downloadnixos-config-fae458378581faa4ae63e03a927c7549470d4fdf.zip
fix(hm/pkgs/ytc): Improve cli output
Diffstat (limited to 'hm/soispha')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/ytc11
1 files changed, 6 insertions, 5 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/ytc b/hm/soispha/pkgs/scripts/wrappers/ytc
index c7797c16..9dfbf6c5 100755
--- a/hm/soispha/pkgs/scripts/wrappers/ytc
+++ b/hm/soispha/pkgs/scripts/wrappers/ytc
@@ -10,14 +10,14 @@ col() {
}
play() {
- dbg "Playing: $1"
+ msg2 "Playing: $1"
mpv "$1" --speed=2.7
output="$?";
if [ "$output" -eq 0 ]; then
- dbg "Removing: $1"
+ msg2 "Removing: $1"
rm "$1"
- dbg "Marking: " "$2"
+ msg2 "Marking: " "$2"
ytcc mark "$2"
fi
return "$output"
@@ -51,7 +51,8 @@ while read -r base; do
echo "$old_filename,$old_id" >> "$files_to_play"
# Check if the process (pid) exists
- if ! kill -0 "$pid" >/dev/null; then
+ dbg "PID is '$pid'"
+ if ! kill -0 "$pid"; then
saved_base="$(head -n 1 "$files_to_play")";
sed -i '1d' "$files_to_play";
saved_name="$(col "$saved_base" 1)";
@@ -59,7 +60,7 @@ while read -r base; do
dbg "Started play for '$saved_name'"
play "$saved_name" "$saved_id" &
- pid="$!"
+ pid=$!
else
dbg "Storing for later '$old_filename'"
fi