aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-10-28 12:25:16 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-10-28 12:25:16 +0200
commitaae1f618c630dd18ac2ecb843c9e70b3817d3483 (patch)
treebb271048f56429681b9474dc64e6c4a9315a477b
parentf6314400471c60cf0a77591346d0614a3b8f6242 (diff)
downloadscripts-aae1f618c630dd18ac2ecb843c9e70b3817d3483.tar.gz
scripts-aae1f618c630dd18ac2ecb843c9e70b3817d3483.zip
case-insensitive dmenu emoji.
-rwxr-xr-xcmusShow.sh23
-rwxr-xr-xemoji/emoji.sh4
2 files changed, 19 insertions, 8 deletions
diff --git a/cmusShow.sh b/cmusShow.sh
index a28d8f2..8a5c576 100755
--- a/cmusShow.sh
+++ b/cmusShow.sh
@@ -2,6 +2,12 @@
# Shows a notification with info about the current playing song.
+scriptName="${0##*/}"
+[ "$(pgrep "${scriptName}" | wc -l)" -gt "2" ] && exit 0
+
+notificationFreq=0.1
+steps=20
+
getCmusInfo() {
cmus-remote -Q | grep "^${1} " | cut -d' ' -f "${2}-"
}
@@ -13,9 +19,14 @@ sToTime() {
echo "${min}:${s}"
}
-artist="$(getCmusInfo 'tag artist' '3')"
-album="$(getCmusInfo 'tag album' '3')"
-title="$(getCmusInfo 'tag title' '3')"
-position="$(getCmusInfo 'position' '2')"
-duration="$(getCmusInfo 'duration' '2')"
-dunstify -r "$(dunstifyIDs.sh cmusShow)" "${title}" "${artist} - ${album}\n$(sToTime ${position}) - $(sToTime ${duration})"
+i=0
+while [ "$i" -lt "$steps" ]; do
+ artist="$(getCmusInfo 'tag artist' '3')"
+ album="$(getCmusInfo 'tag album' '3')"
+ title="$(getCmusInfo 'tag title' '3')"
+ position="$(getCmusInfo 'position' '2')"
+ duration="$(getCmusInfo 'duration' '2')"
+ dunstify -r "$(dunstifyIDs.sh cmusShow)" -t 250 "${title}" "${artist} - ${album}\n$(sToTime "${position}") - $(sToTime "${duration}")"
+ sleep "$notificationFreq"
+ i=$((i+1))
+done
diff --git a/emoji/emoji.sh b/emoji/emoji.sh
index 6bbe041..ae2f3ab 100755
--- a/emoji/emoji.sh
+++ b/emoji/emoji.sh
@@ -39,12 +39,12 @@ emojiList="$(sed "$sedFilter" "$emojiFile")"
usedEmojis="$(echo "$emojiList" | grep '^[0-9]' | sort -nr)"
[ -n "$usedEmojis" ] &&
emojiList="$(printf -- \
- "---------Used----------\n${usedEmojis}\n----------All----------\n${emojiList}")"
+ "---------Used----------\n%s\n----------All----------\n%s" "${usedEmojis}" "${emojiList}" )"
# Choose an emoji with dmenu
lineNoNumber="$(echo "$emojiList" |
sed 's/^[ 0-9]*//' |
- "$dmenuPath" -l 40 $dmenuGridOptions -p "Emoji:")"
+ "$dmenuPath" -i -l 40 $dmenuGridOptions -p "Emoji:")"
if [ -z "$lineNoNumber" ] || echo "$lineNoNumber" | grep -q '^-'; then
exit 0