# try to wait for session to start
(sleep 0.1 && tint2) &
+#x220t
(sleep 0.1 && [ -x "$HOME/bin/acpi_ac" ] && \
"$HOME/bin/acpi_ac" "0x0`sysctl -n hw.acpi.acline`") &
(sleep 1.5 && [ -x /usr/local/bin/conky ] && conky -c "$HOME/.conkyrc.d/dock") &
--- /dev/null
+#!/bin/sh
+exec /usr/local/bin/dmenu -fn 'Dina-10' -nb \#110800 -nf \#93a1a1 -sb \#aa5500 -sf \#eee8d5 "$@"
--- /dev/null
+#!/bin/sh
+cmd=$(dmenu_path | ~/bin/dmenu "$@")
+if [ -n "$cmd" ]; then
+ # zsh SH_WORD_SPLIT is unset by default, `=' flag is required to expand
+ echo "alias sudo='sudo -Ak'
+cmd='$(echo "$cmd" | sed "s/'/'\\\\''/g")'" '
+if [ -n "$ZSH_VERSION" ]; then
+ out="$(${=cmd} 2>&1)"
+else
+ out="$($cmd 2>&1)"
+fi
+code=$?
+out="$(echo "$out" | tail -n 3)"
+notify-send -t 10000 -u $([ $code != 0 ] && echo normal || echo low) -a ' "'$(basename $0)'" ' "${cmd}$([ $code != 0 ] && echo \: $code)" "$out"' | SUDO_ASKPASS=~/bin/dpass ${SHELL:-"/bin/sh"}
+fi
--- /dev/null
+#!/bin/sh
+p="$1"
+if [ -z "$p" ]; then
+ p="[$(ps -o comm= -p $(ps -o ppid= -p $$))]";
+fi
+~/bin/dmenu -p "$p" -fn Dina-10 -nb \#110800 -nf \#110800 -sb \#264bd2 -sf \#fdf6e3 <&-
--- /dev/null
+#!/usr/bin/env perl
+
+BEGIN { $| = 1 } # flush \n
+
+use strict;
+use warnings;
+use Data::Dumper;
+use AnyEvent::I3;
+use v5.10;
+
+my $i3 = i3();
+$i3->connect->recv or die "Error connecting to i3";
+
+sub subscribe {
+ my $ev = $_[0];
+ my $dump = $_[1];
+ if($i3->subscribe({
+ $ev => sub {
+ my ($msg) = @_;
+ say "$ev:$msg->{'change'}";
+ if($dump) {
+ print Dumper($msg);
+ }
+ }
+ })->recv->{success}) {
+ say "Successfully subscribed to $ev-event";
+ }
+}
+
+my $nextArg = shift;
+if(!$nextArg) {
+ say "Subscribe to i3-events";
+ say "Usage: $0 workspace|output|mode|window|barconfig_update|binding [dump]";
+ say "Example: $0 workspace dump window binding dump";
+ exit 1;
+}
+while($nextArg) {
+ my $arg = $nextArg;
+ $nextArg = shift;
+ my $dump = 0;
+ if($nextArg and $nextArg eq "dump") {
+ $dump = 1;
+ $nextArg = shift;
+ }
+ subscribe("$arg", $dump);
+}
+AE::cv->recv;
+
+# vim: et:ts=4:sts=4
--- /dev/null
+#!/bin/sh
+killall redshift > /dev/null 2>&1
+redshift -m randr -x
--- /dev/null
+#!/bin/sh
+killall redshift > /dev/null 2>&1
+redshift -l manual:lat=38.95171:lon=-92.33407 -m randr -t 6600:4000 -r &
--- /dev/null
+#!/bin/sh
+
+default_output=LVDS1
+
+usage() {
+ echo "Usage:
+ rotate (left|right|invert) [output]
+ rotate set (normal|right|inverted|left) [output]
+Examples:
+ rotate left LVDS1
+ rotate set right HDMI2
+
+Only the first letter of each command is checked (case-insensitive), so they
+can be abbreviated or even cut to one letter each in lower or upper case.
+
+For example, the following commands do the same thing:
+ rotate set left
+ rotate SET LeFt
+ rotate s l
+ rotate salad lasagna"
+}
+
+rot_to_num() {
+ case $1 in
+ # normal right invert left
+ # convert to numbers to allow math to rotate
+ [nN]*) rot0=0;;
+ [rR]*) rot0=1;;
+ [iI]*) rot0=2;;
+ [lL]*) rot0=3;;
+ *) usage; exit 2;;
+ esac
+}
+num_to_rot() {
+ case $1 in
+ # maps to rot_to_num output
+ 0) rot1=normal
+ rot2=none;;
+ 1) rot1=right
+ rot2=cw;;
+ 2) rot1=inverted
+ rot2=half;;
+ 3) rot1=left
+ rot2=ccw;;
+ esac
+}
+
+case $1 in
+ [sS]*)
+ # set: rotate set (normal|right|inverted|left) [output]
+ output=${3:-$default_output}
+ rot_to_num $2
+ ;;
+ *)
+ # rotate (left|right|invert) [output]
+ output=${2:-$default_output}
+ rot_to_num `xrandr --query --verbose | grep $output | awk '{print $5}'`
+ case $1 in
+ [lL]*) rot0=$(($rot0 - 1));;
+ [rR]*) rot0=$(($rot0 + 1));;
+ [iI]*) rot0=$(($rot0 + 2));;
+ *) usage; exit 1;;
+ esac
+ ;;
+esac
+
+# add 4 modulo 4 to prevent negatives and overflows
+num_to_rot $((($rot0 + 4) % 4))
+
+xrandr --output $output --rotation $rot1
+# x220t
+if [ -x /usr/local/bin/xsetwacom ]; then
+ xsetwacom --set stylus Rotate $rot2
+ xsetwacom --set eraser Rotate $rot2
+ xsetwacom --set touch Rotate $rot2
+fi
+
+# reload bg
+~/.fehbg
--- /dev/null
+#!/bin/sh
+first=true
+i3subscribe mode | while read -r x; do
+ if $first; then
+ first=false
+ continue
+ fi
+ x=${x#mode:}
+ case $x in
+ default) echo;;
+ *) echo $x;;
+ esac
+done
--- /dev/null
+#!/bin/sh
+i3status -c ${XDG_CONFIG_HOME:-~/.config}/i3status/tint2-$1 | sed -ue 's/fc=\(#[a-f0-9]\{3,6\}\)/span color="\1"/gi;s_/fc_/span_g'
--- /dev/null
+#!/bin/sh
+base=~/.icons/Paper/24x24/panel/network
+excellent=$base-wireless-signal-excellent.svg
+ good=$base-wireless-signal-good.svg
+ ok=$base-wireless-signal-ok.svg
+ low=$base-wireless-signal-low.svg
+ none=$base-wireless-signal-none.svg
+ offline=$base-wireless-offline.svg
+while true; do
+ sleep 3
+ x=$(ifconfig wlan0 list sta)
+ if [ $? != 0 ]; then
+ echo $offline
+ continue
+ fi
+ x=$(echo "$x" | awk 'NR == 1 {next} {printf "%.0f", $5}')
+ if [ $x -ge 20 ]; then
+ echo $excellent
+ elif [ $x -ge 15 ]; then
+ echo $good
+ elif [ $x -ge 10 ]; then
+ echo $ok
+ elif [ $x -ge 5 ]; then
+ echo $low
+ else
+ echo $none
+ fi
+done
--- /dev/null
+#!/bin/sh
+(sleep 0.1; xdotool search --class --sync XMixer \
+ windowmove $(xdotool getmouselocation|awk 'BEGIN{FS=" |:"}{print $2" "$4}'))&
+xmixer
#!/bin/sh
-#fix permissions from git (should probably move this to git hook)
+#fix permissions from git (TODO: should probably move this to git hook)
chmod go= base/.zshenv base/.Xresources
if [ 0 -eq 1 ]; then
fi
l() {
+ # TODO: use install?
[ -L "$1" -o \! -e "$1" ] && ln -sFhvw "$x" "$1"
}
find "$PWD/base" -depth 1 | while read -r x; do
l "$HOME/`basename "$x"`"
done
+mkdir "$HOME/bin"
+find "$PWD/bin" -depth 1 | while read -r x; do
+ l "$HOME/bin/`basename "$x"`"
+done
find "$PWD/xdg" -depth 1 | while read -r x; do
l "${XDG_CONFIG_HOME:-$HOME/.config}/`basename "$x"`"
done