diff options
Diffstat (limited to '.config')
-rwxr-xr-x | .config/herbstluftwm/autostart | 2 | ||||
-rwxr-xr-x | .config/herbstluftwm/calc.sh | 28 | ||||
-rwxr-xr-x | .config/herbstluftwm/colourgrab.sh | 4 | ||||
-rwxr-xr-x | .config/herbstluftwm/switcher.sh | 2 |
4 files changed, 34 insertions, 2 deletions
diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index 3089516..b414be2 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -125,7 +125,6 @@ hc keybind Mod4-c spawn ~/.config/herbstluftwm/colourgrab.sh # spawn hc keybind Mod4-Return spawn urxvt -hc keybind Mod4-Shift-c spawn gnome-calculator hc keybind Mod4-Shift-d spawn ~/games/desura/desura hc keybind Mod4-Shift-f spawn firefox hc keybind Mod4-Shift-i spawn gimp @@ -145,6 +144,7 @@ hc keybind Mod4-Down spawn banshee --toggle-playing # dmenu hc keybind Mod4-0 spawn dmenu_run -p "Run:" -h 18 -nb $bg_normal -nf $fg_normal -sb $bg_focus -sf $fg_focus hc keybind Mod4-9 spawn ~/.config/herbstluftwm/switcher.sh $bg_normal $fg_normal $bg_focus $fg_focus +hc keybind Mod4-8 spawn ~/.config/herbstluftwm/calc.sh $bg_normal $fg_normal $bg_focus $fg_focus ############## end launchers ############## diff --git a/.config/herbstluftwm/calc.sh b/.config/herbstluftwm/calc.sh new file mode 100755 index 0000000..aa041a6 --- /dev/null +++ b/.config/herbstluftwm/calc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +acc=0 +in="first" +prompt="calc:" +pi="3.1415926535897932384626433832795028841971694" +e="2.7182818284590452353602874713526624977572471" +while [ "$in" != "" ]; do + val=0 + + in=$(echo "" | dmenu -q -h 18 -nb $1 -nf $2 -sb $3 -sf $4 -p "$prompt") + + out=$(echo "pi=$pi; e=$e; $acc $in" | calc -p 2>&1 | tr -d "\n") + + if [ "$out" = "Missing operator" ]; then + out=$(echo "pi=$pi; e=$e; $in" | calc -p 2>&1) + fi + + # check for error output + if [ "${?#0}" != "" ]; then + out=$(echo "$out" | tr -d "\n") + prompt="calc: ($acc) err: $out" + else + acc=$out + prompt="calc: ($acc)" + fi +done + diff --git a/.config/herbstluftwm/colourgrab.sh b/.config/herbstluftwm/colourgrab.sh new file mode 100755 index 0000000..1144001 --- /dev/null +++ b/.config/herbstluftwm/colourgrab.sh @@ -0,0 +1,4 @@ +#!/bin/bash +file=$(xoris) +echo "$file" | tr -d '\n' | xclip -selection clipboard +echo "$file" | tr -d '\n' | xclip -selection primary diff --git a/.config/herbstluftwm/switcher.sh b/.config/herbstluftwm/switcher.sh index 9bf344c..88ff366 100755 --- a/.config/herbstluftwm/switcher.sh +++ b/.config/herbstluftwm/switcher.sh @@ -1,7 +1,7 @@ #!/bin/bash IFS=$'\r\n' clients=($(wmctrl -l | cut -c -10)) -number=$(wmctrl -l | cut -c 20- | nl -w 2 -s ") " | dmenu -i -h 16 -nb $1 -nf $2 -sb $3 -sf $4 -p "Select:" -l 40 | grep -oE '[0-9]' | head -1) +number=$(wmctrl -l | cut -c 20- | nl -w 2 -s ") " | dmenu -i -h 18 -nb $1 -nf $2 -sb $3 -sf $4 -p "Select:" -l 40 | grep -oE '[0-9]' | head -1) if [ $number ]; then herbstclient jumpto ${clients[$(expr $number - 1)]} fi |