Skip to content

Instantly share code, notes, and snippets.

@hotpxl
Created August 5, 2015 12:40
Show Gist options
  • Save hotpxl/e3adbeb0081af8182f99 to your computer and use it in GitHub Desktop.
Save hotpxl/e3adbeb0081af8182f99 to your computer and use it in GitHub Desktop.
Utilities for laptop access
#!/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}"
#!/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}"
#!/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
#!/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}"
#!/bin/bash
acpi -abt
#!/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