qs: better lyrics
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
url=$(playerctl --player=elisa metadata xesam:url)
|
||||
|
||||
if [[ "$url" != file://* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path="${url#file://}"
|
||||
lyrics_path="${path%.*}.lrc"
|
||||
|
||||
if [[ ! -e "$lyrics_path" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat "$lyrics_path"
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
lockfile=/tmp/fzfclip.lock
|
||||
exec {LOCK_FD}>"$lockfile"
|
||||
@@ -7,4 +7,4 @@ flock -n "$LOCK_FD" || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
fzfclip "$@"
|
||||
fzfclip "$@" {LOCK_FD}>&-
|
||||
|
||||
Reference in New Issue
Block a user