diff --git a/manage_volume b/manage_volume new file mode 100755 index 0000000..7e783a3 --- /dev/null +++ b/manage_volume @@ -0,0 +1,66 @@ +#!/bin/dash + +printMuted() { + if [ "$(pamixer --get-mute )" = "true" ]; then + printf " (muted)" + fi +} + +sendNotification() { + notify-send "$1" \ + -h string:x-canonical-private-synchronous:volume \ + -u low + } + +checkSingleAction() { + if [ -n "$ACTION" ]; then + echo "More than one action specified" + exit 1 + fi +} + +checkEmptyValue() { + if [ -z "$VALUE" ]; then + echo "Value needed to $ACTION volume" + exit 1 + fi +} + +ACTION="" +VALUE="" +NOTIFY="false" +PRINT="false" + +while getopts "s:i:d:tnp" arg; do + case $arg in + s) checkSingleAction; ACTION="set"; VALUE=$OPTARG ;; + i) checkSingleAction; ACTION="increase"; VALUE=$OPTARG ;; + d) checkSingleAction; ACTION="decrease"; VALUE=$OPTARG ;; + t) checkSingleAction; ACTION="toggle" ;; + n) NOTIFY="true" ;; + p) PRINT="true" ;; + *) echo "Invalid argument"; exit 1 ;; + esac +done + +if test -z "$ACTION" && test "$NOTIFY" = "false" && test "$PRINT" = "false"; then + echo "No action specified" + exit 1 +fi + +case $ACTION in + set) checkEmptyValue; pamixer --set-volume "$VALUE" ;; + increase) checkEmptyValue; pamixer -i "$VALUE" ;; + decrease) checkEmptyValue; pamixer -d "$VALUE" ;; + toggle) pamixer -t ;; +esac + +INFO="Volume: $(pamixer --get-volume)%$(printMuted)" + +if [ "$NOTIFY" = "true" ]; then + sendNotification "$INFO" +fi + +if [ "$PRINT" = "true" ]; then + echo "$INFO" +fi diff --git a/setup/disable_watchdog b/setup/disable_watchdog new file mode 100755 index 0000000..39c6201 --- /dev/null +++ b/setup/disable_watchdog @@ -0,0 +1,10 @@ +#!/bin/sh + +set -uo pipefail + +if (( $EUID != 0 )); then + echo "Should be run as root" + exit 1 +fi + +echo "blacklist iTCO_wdt" > /etc/modprobe.d/nowatchdog.conf diff --git a/setup/setup_cups b/setup/setup_cups new file mode 100755 index 0000000..b662d70 --- /dev/null +++ b/setup/setup_cups @@ -0,0 +1,10 @@ +#!/bin/sh + +set -Eeuo pipefail + +if (( $EUID != 0 )); then + echo "Should be run as root" + exit 1 +fi + +systemctl enable org.cups.cupsd.service diff --git a/setup/setup_rtl8723be b/setup/setup_rtl8723be new file mode 100755 index 0000000..7fd5941 --- /dev/null +++ b/setup/setup_rtl8723be @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "options rtl8723be fwlps=0" > /etc/modprobe.d/rtl8723be.conf