diff options
| -rwxr-xr-x | lock | 1 | ||||
| -rwxr-xr-x | sc | 14 | ||||
| -rwxr-xr-x | vol | 17 |
3 files changed, 21 insertions, 11 deletions
@@ -1,3 +1,4 @@ #!/usr/bin/env sh killall -s HUP gpg-agent +xset dpms force off slock @@ -1,13 +1,13 @@ #!/usr/bin/env sh # Quick hack to manage screen hotplugging case "$1" in - "d") xrandr --nograb --output VGA-0 --off --output LVDS --auto;; - "r") xrandr --nograb --output VGA-0 --auto --primary --output LVDS --off;; - "c") xrandr --nograb --output VGA-0 --auto --output LVDS --auto;; - "n") xrandr --nograb --output LVDS --auto --above VGA-0 --output VGA-0 --auto;; - "s") xrandr --nograb --output LVDS --auto --below VGA-0 --output VGA-0 --auto;; - "e") xrandr --nograb --output LVDS --auto --right-of VGA-0 --output VGA-0 --auto;; - "w") xrandr --nograb --output LVDS --auto --left-of VGA-0 --output VGA-0 --auto;; + "d") xrandr --nograb --output VGA1 --off --output LVDS1 --auto;; + "r") xrandr --nograb --output VGA1 --auto --primary --output LVDS1 --off;; + "c") xrandr --nograb --output VGA1 --auto --output LVDS1 --auto;; + "n") xrandr --nograb --output LVDS1 --auto --above VGA1 --output VGA1 --auto;; + "s") xrandr --nograb --output LVDS1 --auto --below VGA1 --output VGA1 --auto;; + "e") xrandr --nograb --output LVDS1 --auto --right-of VGA1 --output VGA1 --auto;; + "w") xrandr --nograb --output LVDS1 --auto --left-of VGA1 --output VGA1 --auto;; *) xrandr --nograb ;; esac; #feh --bg-center "$BKG" @@ -2,13 +2,22 @@ # A small volume control script for the laptop -cmd="amixer set Master" +if [ "$1" == "--headphone" ]; then + shift; + mixer="Headphone" +else + mixer="Master" +fi; + +cmd="amixer set $mixer" fle=$HOME/.vol + +echo -n $mixer\ > $fle case "$1" in - "up") $cmd 2%+;; - "down") $cmd 2%-;; + "--up") $cmd 2%+;; + "--down") $cmd 2%-;; *) $cmd toggle;; -esac | grep \% | cut -d\ -f 6,8 | tr -d '[]' > $fle +esac | tail -n 1 | cut -d: -f 2 | cut -d\ -f 4,6 | tr -d '[]' >> $fle for c in "set bargravity ne" "echo Volume: `cat $fle`" "set bargravity c"; do ratpoison -c "$c" |
