From b4a8386fe9bd38f5e5128b5d0c0c0f4e5421ed3e Mon Sep 17 00:00:00 2001 From: samedamci Date: Mon, 1 Jun 2020 13:52:49 +0200 Subject: [PATCH] Add mpdrandom script and bind it --- .config/sxhkd/sxhkdrc | 4 +++- .local/bin/scripts/mpdrandom | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 .local/bin/scripts/mpdrandom diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 2e49a7d..6deafa7 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -15,9 +15,11 @@ super + a; {g,k,l,i} {gimp,keepassxc,libreoffice,inkscape} super + {_,ctrl +} m - rofi-mpd {-a,-s} + rofi-mpd {-a,-s} && refbar super + apostrophe mpdqueue +XF86Tools + mpdrandom {Prior,super + x} slock super + z diff --git a/.local/bin/scripts/mpdrandom b/.local/bin/scripts/mpdrandom new file mode 100755 index 0000000..635231f --- /dev/null +++ b/.local/bin/scripts/mpdrandom @@ -0,0 +1,13 @@ +#!/bin/sh + +# Add random song to mpd queue. + +song="$(mpc listall | shuf -r -n 1)" + +mpc add "$song" + +notify-send -u normal "MPD added random song" "$( + mpc -f "%artist% - %title%" find filename "$song" +)" + +mpc play>/dev/null