Created
August 5, 2015 12:40
-
-
Save hotpxl/e3adbeb0081af8182f99 to your computer and use it in GitHub Desktop.
Utilities for laptop access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
case "$1" in | |
+) | |
ACTION="-inc";; | |
-) | |
ACTION="-dec";; | |
*) | |
echo "invalid option"; | |
exit 1;; | |
esac | |
xbacklight ${ACTION} 10 | |
CURRENT_BACKLIGHT=$(xbacklight | sed -r -e "s/\.[0-9]+//g") | |
${HOME}/local/bin/display_info "Backlight ${CURRENT_BACKLIGHT}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
case "$1" in | |
+) | |
ACTION="2+";; | |
-) | |
ACTION="2-";; | |
*) | |
echo "invalid option"; | |
exit 1;; | |
esac | |
amixer set Master ${ACTION} &> /dev/null | |
CURRENT_VOLUME=$(amixer get Master | tail -n 1 | grep -oP "\d+(?=%)") | |
${HOME}/local/bin/display_info "Volume ${CURRENT_VOLUME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
WINDOW_HEIGHT=$(xrandr | head -n 1 | awk '{sub(",", "", $10); print $10; }') | |
LINE_HEIGHT=120 | |
dzen2 -p 1 -fg "#80c0ff" -bg "#000040" \ | |
-fn "-*-dejavu sans-*-*-*-*-100-*-*-*-*-*-*-*" \ | |
-h ${LINE_HEIGHT} -y $(((WINDOW_HEIGHT - LINE_HEIGHT) / 2)) <<< $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
amixer set Master toggle &> /dev/null | |
CURRENT_VOLUME=$(amixer get Master | tail -n 1 | awk '{gsub(/(\[|\])/, "", $6); print $6;}') | |
${HOME}/local/bin/display_info "Volume ${CURRENT_VOLUME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
acpi -abt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo cat /proc/acpi/bbswitch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment