From ec69fe2a8df6f9128c80efc35b6a69b69467b475 Mon Sep 17 00:00:00 2001 From: Mateja Date: Wed, 16 Jun 2021 21:22:11 +0200 Subject: Added status bar scripts. --- .local/bin/sb_layout.sh | 8 ++++++++ .local/bin/sb_set.sh | 23 +++++++++++++++++++++++ .local/bin/sb_test.sh | 2 +- .local/bin/sb_volume.sh | 14 ++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 .local/bin/sb_layout.sh create mode 100755 .local/bin/sb_set.sh create mode 100755 .local/bin/sb_volume.sh diff --git a/.local/bin/sb_layout.sh b/.local/bin/sb_layout.sh new file mode 100755 index 0000000..9fdeb51 --- /dev/null +++ b/.local/bin/sb_layout.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +case $BUTTON in + # Left mouse click + 1) xkb-switch -n ;; +esac + +printf $(xkb-switch -p | tr -d '\n') diff --git a/.local/bin/sb_set.sh b/.local/bin/sb_set.sh new file mode 100755 index 0000000..236b856 --- /dev/null +++ b/.local/bin/sb_set.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +case $1 in + -i) + amixer -q sset Master 5%+ + pkill -SIGRTMIN+11 dwmblocks + ;; + + -d) + amixer -q sset Master 5%- + pkill -SIGRTMIN+11 dwmblocks + ;; + + -t) + amixer -q sset Master toggle + pkill -SIGRTMIN+11 dwmblocks + ;; + + -n) + xkb-switch -n + pkill -SIGRTMIN+10 dwmblocks + ;; +esac diff --git a/.local/bin/sb_test.sh b/.local/bin/sb_test.sh index 726c618..3d4b5b1 100755 --- a/.local/bin/sb_test.sh +++ b/.local/bin/sb_test.sh @@ -17,4 +17,4 @@ case $BUTTON in 5) notify-send "$BUTTON" ;; esac -echo "Test" +printf "Test" diff --git a/.local/bin/sb_volume.sh b/.local/bin/sb_volume.sh new file mode 100755 index 0000000..c769ddd --- /dev/null +++ b/.local/bin/sb_volume.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +case $BUTTON in + # Left mouse click + 1) amixer -q sset Master toggle ;; + + # Mouse wheel up + 4) amixer -q sset Master 1%+ ;; + + # Mouse wheel down + 5) amixer -q sset Master 1%- ;; +esac + +amixer get Master | awk -F'[][]' 'END{ print toupper($(NF-1))": "$2 }' -- cgit v1.2.3