]> www.git.dmfe.net Git - dotfiles/commitdiff
Add scripts for mpd and emojis. Edit volume and shutdown scripts.
authorDmitry Fedotov <dm.fe@yandex.ru>
Sun, 31 May 2020 15:11:11 +0000 (18:11 +0300)
committerDmitry Fedotov <dm.fe@yandex.ru>
Sun, 31 May 2020 15:11:11 +0000 (18:11 +0300)
scripts/dmenu-unicode.sh [new file with mode: 0755]
scripts/i3mpd.sh [new file with mode: 0755]
scripts/shutdown.sh
scripts/volume.sh

diff --git a/scripts/dmenu-unicode.sh b/scripts/dmenu-unicode.sh
new file mode 100755 (executable)
index 0000000..94e63b4
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+choose=$(grep -v "#" ~/.local/share/emoji | \
+    dmenu -i -l 20 -fn Monospace-18 | \
+    awk '{print $1}')
+
+if [[ -z ${choose} ]]; then
+    exit 1
+fi
+
+echo "${choose}" | tr -d '\n' | xclip -selection clipboard
+
+pgrep -x dunst > /dev/null && \
+notify-send "$(xclip -o -selection clipboard) copied to clipboard"
diff --git a/scripts/i3mpd.sh b/scripts/i3mpd.sh
new file mode 100755 (executable)
index 0000000..a08a561
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#Pass the password to the block instance
+if [[ -n $BLOCK_INSTANCE ]]; then
+    password=("-h" "${BLOCK_INSTANCE}@localhost")
+fi
+
+filter() {
+    tr '\n' ' ' | grep -Po '.*(?= \[playing\])|paused' | tr -d '\n'
+}
+
+case $BLOCK_BUTTON in
+    1) mpc $password status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click pause/unpause
+    3) mpc $password toggle | filter ;; # right click, pause/unpause
+    4) mpc $password prev   | filter ;; # scroll up, previous
+    5) mpc $password next   | filter ;; # scroll down, next
+    *) mpc $password status | filter ;;
+esac
index 75c567306ea57fb1b97072fcee9a0d2acf9fedb7..44a74e7a60cbe6f55f87be1fb7e753041c218182 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-font="System San Francisco Display 12"
+font="Monospace-18"
 
 pgrep -x dmenu && exit
 
index e7625170975182ce0a93b7bd5fcbff3a3fb96771..681ab82610b189416f58059808070af9cd387354 100755 (executable)
@@ -11,17 +11,17 @@ esac
 muted=$( awk '/muted/ {print $2}' <(pacmd list-sinks | grep '^[[:space:]]muted:' | head -n $(( $sink + 1 )) | tail -n 1 ) )
 
 if [ "$muted" = "yes" ]; then
-  icon=""
+  icon="🔇"
   printf "%s\\n" "$icon"
 else
   vol=$( pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $sink + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,' )
   if [ "$vol" -gt 60 ]; then
-    icon=""
+    icon="🔊"
   elif [[ "$vol" -le 60 && "$vol" -gt 30 ]]; then
-    icon=""
+    icon="🔉"
   else
-    icon=""
+    icon="🔈"
   fi
-  
+
   printf "%s %s%%\\n" "$icon" "$vol"
 fi