dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 55b33aaa5272ed391c12a0b9bb2b264801b31f77
parent 090b16c61933785750062f136e6ecbb70feedad4
Author: Anders Damsgaard Christensen <adc@geo.au.dk>
Date:   Fri, 27 May 2016 12:46:55 -0700

add bitbar plugins

Diffstat:
Abitbar-plugins/batt.10s.sh | 3+++
Abitbar-plugins/kwm.2s.sh | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Abitbar-plugins/mail.5s.sh | 22++++++++++++++++++++++
Abitbar-plugins/mpd.3s.sh | 18++++++++++++++++++
4 files changed, 120 insertions(+), 0 deletions(-)

diff --git a/bitbar-plugins/batt.10s.sh b/bitbar-plugins/batt.10s.sh @@ -0,0 +1,3 @@ +#!/bin/bash +color="#81a2be" +echo "$(bash ~/bin/battery-osx) | color=${color}" diff --git a/bitbar-plugins/kwm.2s.sh b/bitbar-plugins/kwm.2s.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +color="#f0c674" + +#kwmc=$HOME/code/kwm/bin/kwmc +kwmc=/usr/local/bin/kwmc + +currentFocus=$($kwmc query focus) +currentMouse=$($kwmc query mouse-follows) +tag=$($kwmc query tag) + +if [ "$1" = 'quit' ]; then + killall kwm + exit +fi + +if [ "$1" = 'reload' ]; then + $kwmc config reload + exit +fi + +if [ "$1" = 'refresh' ]; then + $kwmc tree -c refresh + exit +fi + +if [ "$1" = 'bsp' ]; then + $kwmc space -t bsp + exit +fi + +if [ "$1" = 'monocle' ]; then + $kwmc space -t monocle + exit +fi + +if [ "$1" = 'float' ]; then + $kwmc space -t float + exit +fi + +if [ "$1" = 'toggle-autoraise' ]; then + [[ $currentFocus = "autoraise" ]] && value="disabled" || value="autoraise" + $kwmc config focus $value + exit +fi + +if [ "$1" = 'toggle-mouse-follows' ]; then + [[ $currentMouse = "enabled" ]] && value="disable" || value="enable" + $kwmc config focus mouse-follows $value + exit +fi + +echo "$(echo kwm $tag | sed 's/kwm Connection failed!//') | dropdown=false color=${color}" + +echo "---"; + +echo "BSP | bash=$0 param1=bsp terminal=false" +echo "Monocle | bash=$0 param1=monocle terminal=false" +echo "Floating | bash=$0 param1=float terminal=false" + +echo "---" + +[[ $currentFocus = "autoraise" ]] && focus="Disable" || focus="Enable" + +echo "$focus Focus Follows Mouse | bash=$0 param1=toggle-autoraise terminal=false" + +[[ $currentMouse = "enabled" ]] && mouse="Disable" || mouse="Enable" + +echo "$mouse Mouse Follows Focus | bash=$0 param1=toggle-mouse-follows terminal=false" + +echo "---" + +echo "Refresh kwm | bash=$0 param1=refresh terminal=false" +echo "Reload kwm | bash=$0 param1=reload terminal=false" +echo "Quit kwm | bash=$0 param1=quit terminal=false" + diff --git a/bitbar-plugins/mail.5s.sh b/bitbar-plugins/mail.5s.sh @@ -0,0 +1,22 @@ +#!/bin/sh +newmails=$(find ~/Mail/*/INBOX/new -type f | wc -l | sed 's/ *//') +mailcolor="#859900" +debug=false +offlineimap=/usr/local/bin/offlineimap + +if [ "$newmails" -gt 0 ]; then + mailcolor="#cb4b16" +fi + +echo "M: ${newmails} | color=${mailcolor}" + +# everything below in drop down menu +echo "---" + +mailboxes="$(find ~/Mail/*/INBOX/new -type f | sed 's/.*Mail\///' | sed 's/\/INBOX.*//')" +echo $mailboxes + +echo "---" + +echo "Sync inboxes | bash=\"$offlineimap\" param1=-qf param2=INBOX terminal=$debug" +echo "Sync all | bash=\"$offlineimap\" terminal=$debug" diff --git a/bitbar-plugins/mpd.3s.sh b/bitbar-plugins/mpd.3s.sh @@ -0,0 +1,18 @@ +#!/bin/bash +color="#81a2be" +mpcpath=/usr/local/bin/mpc +debug=false + +echo "$($mpcpath | head -n 1 | sed 's/volume.*$//') | color=${color}" + +echo "---" + +echo "$($mpcpath | tail -n 2 | sed 's/volume.*$//')" + +echo "---" + +echo "Play/Pause | bash=\"$mpcpath\" param1=toggle terminal=$debug" +echo "Previous | bash=\"$mpcpath\" param1=prev terminal=$debug" +echo "Next | bash=\"$mpcpath\" param1=next terminal=$debug" +echo "Stop | bash=\"$mpcpath\" param1=stop terminal=$debug" +