aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/mpd_show.sh6
-rwxr-xr-x.local/bin/unmount_usb.sh12
2 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/mpd_show.sh b/.local/bin/mpd_show.sh
new file mode 100755
index 0000000..1d0629a
--- /dev/null
+++ b/.local/bin/mpd_show.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+raw="$(mpc)"
+song=$(echo "$raw" | sed -n '1p')
+time=$(echo "$raw" | sed -n '2p')
+notify-send "$song" "$time"
diff --git a/.local/bin/unmount_usb.sh b/.local/bin/unmount_usb.sh
new file mode 100755
index 0000000..764365c
--- /dev/null
+++ b/.local/bin/unmount_usb.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+options=$(lsblk | grep /media/$USER | rev | cut -d ' ' -f 1 | rev)
+[ -n "$options" ] && opt_num=$(echo "$options" | wc -l) || opt_num=0
+if [ $opt_num == 0 ]; then
+ notify-send "Nothing mounted!"
+elif [ $opt_num == 1 ]; then
+ udiskie-umount "$options"
+else
+ unmount_device=$(echo "$options" | dmenu -p "What device you want to unmount?")
+ [[ ! -z "$unmount_device" ]] && udiskie-umount "$unmount_device"
+fi