From 93fba2472ff507b6d9eb3d57ccb4f2dbf5f0c97b Mon Sep 17 00:00:00 2001 From: Carolyn Saunders Date: Fri, 16 Dec 2016 13:06:16 -0800 Subject: [PATCH] Added tasks and mail to lemonbar --- .config/admiral.d/admiral.toml | 30 ++-- .config/bspwm/bspwmrc | 27 ++++ .config/offlineimap/hooks/postsync_gigavinyl | 7 + .config/sxhkd/sxhkd/sxhkdrc | 141 +++++++++++++++++++ .config/sxhkd/sxhkdrc | 141 +++++++++++++++++++ .notmuch-config | 98 +++++++++++++ .offlineimaprc | 23 +++ .scripts/bar.sh | 2 +- .scripts/battery.sh | 6 +- .scripts/cpu.sh | 6 + .scripts/fehbg.sh | 2 + .scripts/mail.sh | 3 + .scripts/memory.sh | 4 + .scripts/offlineimap-notify.sh | 18 +++ .scripts/tasks.sh | 4 + .zshrc | 8 +- 16 files changed, 503 insertions(+), 17 deletions(-) create mode 100755 .config/bspwm/bspwmrc create mode 100755 .config/offlineimap/hooks/postsync_gigavinyl create mode 100644 .config/sxhkd/sxhkd/sxhkdrc create mode 100755 .config/sxhkd/sxhkdrc create mode 100644 .notmuch-config create mode 100644 .offlineimaprc create mode 100755 .scripts/cpu.sh create mode 100755 .scripts/fehbg.sh create mode 100755 .scripts/mail.sh create mode 100755 .scripts/memory.sh create mode 100755 .scripts/offlineimap-notify.sh create mode 100755 .scripts/tasks.sh diff --git a/.config/admiral.d/admiral.toml b/.config/admiral.d/admiral.toml index 3d28624..3736bff 100644 --- a/.config/admiral.d/admiral.toml +++ b/.config/admiral.d/admiral.toml @@ -1,5 +1,5 @@ [admiral] -items = ["left", "padding", "workspaces", "right", "network", "padding", "volume", "padding", "battery", "padding", "clock", "padding"] +items = ["left", "padding", "workspaces", "padding", "title", "padding", "right", "tasks", "padding", "mail", "padding", "cpu", "padding", "memory", "padding", "battery", "padding", "clock", "padding"] [left] path = "echo '%{l}'" @@ -18,23 +18,31 @@ path = "echo ' '" static = true [battery] -path = "./battery.sh" +path = "$HOME/.scripts/battery.sh" reload = 3 -[network] -path = "$HOME/.scripts/networkname.sh" +[mail] +path = "$HOME/.scripts/mail.sh" reload = 5 -[volume] -path = "./volume.sh" -reload = 0.05 - [workspaces] -path = "./bspwm_workspaces.sh" +path = "$HOME/.scripts/workspaces.sh" [title] -path = "xtitle -s | scroller -o -l 60" +path = "xtitle -s | roller -t 50" [clock] -path = "date '+%D %H:%M' " +path = "date '+%m/%d %H:%M' " reload = 1 + +[memory] +path = "$HOME/.scripts/memory.sh" +reload = 0.05 + +[cpu] +path = "$HOME/.scripts/cpu.sh" +reload = 0.05 + +[tasks] +path= "$HOME/.scripts/tasks.sh | grep /" +reload = 5 diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc new file mode 100755 index 0000000..3ecb979 --- /dev/null +++ b/.config/bspwm/bspwmrc @@ -0,0 +1,27 @@ +#!/bin/bash + +sxhkd & + +bspc config border_width 3 +bspc config window_gap 20 +bspc config top_padding 50 +bspc config right_padding 0 +bspc config bottom_padding 0 +bspc config left_padding 0 + +bspc config split_ratio 0.50 +bspc config focus_follows_pointer true +bspc config pointer_follows_monitor true + +bspc config focused_border_color "#7986cb" +bspc config active_border_color "#7986cb" +bspc config normal_border_color "#121315" +bspc config presel_feedback_color "#181818" + +bspc monitor -d I II III IV V VI + +xsetroot -cursor_name left_ptr + +~/.scripts/fehbg.sh +~/.scripts/bar.sh +compton & diff --git a/.config/offlineimap/hooks/postsync_gigavinyl b/.config/offlineimap/hooks/postsync_gigavinyl new file mode 100755 index 0000000..a5490dd --- /dev/null +++ b/.config/offlineimap/hooks/postsync_gigavinyl @@ -0,0 +1,7 @@ +#!/bin/sh + +# Initial import +notmuch new + +# Tagging +notmuch tag -inbox +archive folder:Archive diff --git a/.config/sxhkd/sxhkd/sxhkdrc b/.config/sxhkd/sxhkd/sxhkdrc new file mode 100644 index 0000000..c9c04a5 --- /dev/null +++ b/.config/sxhkd/sxhkd/sxhkdrc @@ -0,0 +1,141 @@ + +# +# wm independent hotkeys +# + +# increase / decrease volume +XF86Audio{Raise,Lower}Volume + amixer -q sset Master {2%+,2%-} unmute + +# Mute volume +XF86AudioMute + amixer -q sset Master toggle + +# brightness +XF86MonBrightness{Up,Down} + xbacklight -time 1 -steps 1 -{inc,dec} 5 + +# terminal emulator +super + Return + st + +# program launcher +super + space + rofi -show run -m -1 -padding 20 -width 30 -lines 5 -color-window "#111314, #7986cb, #7986cb" -color-normal "#111314, #7986cb, #111314, #7986cb, #111314" -color-active "#111314, #7986cb, #111314, #7986cb, #111314" -location 0 -font "Inconsolata 17" -bc "#7986cb" -bw 2 -opacity 100 -regex + +# window management +super + shift + space + rofi -show window -m -1 -padding 20 -width 30 -lines 5 -color-window "#111314, #7986cb, #7986cb" -color-normal "#111314, #7986cb, #111314, #7986cb, #111314" -color-active "#111314, #7986cb, #111314, #7986cb, #111314" -location 0 -font "Inconsolata 17" -bc "#7986cb" -bw 2 -opacity 100 + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# +# bspwm hotkeys +# + +# quit bspwm normally +super + alt + Escape + bspc quit + +# close and kill +super + {_,shift + }w + bspc node -{c,k} + +# alternate between the tiled and monocle layout +super + m + bspc desktop -l next + +# if the current node is automatic, send it to the last manual, +# otherwise pull the last leaf +super + y + bspc query -N -n focused.automatic && bspc node -n +last.!automatic || bspc node last.leaf -n focused + +# swap the current node and the biggest node +super + g + bspc node -s biggest + +# +# state/flags +# + +# set the window state +super + {t,shift + t,s,f} + bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# set the node flags +super + ctrl + {x,y,z} + bspc node -g {locked,sticky,private} + +# +# focus/swap +# + +# focus the node in the given direction +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# focus the node for the given path jump +super + {p,b,comma,period} + bspc node -f @{parent,brother,first,second} + +# focus the next/previous node +super + {_,shift + }c + bspc node -f {next,prev} + +# focus the next/previous desktop +super + bracket{left,right} + bspc desktop -f {prev,next} + +# focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# focus the older or newer node in the focus history +super + {o,i} + bspc wm -h off; \ + bspc node {older,newer} -f; \ + bspc wm -h on + +# focus or send to the given desktop +super + {_,shift + }{1-9} + bspc {desktop -f,node -d} '^{1-9}' + +# +# preselect +# + +# preselect the direction +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} + +# preselect the ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# cancel the preselection for the focused node +super + ctrl + space + bspc node -p cancel + +# cancel the preselection for the focused desktop +super + ctrl + shift + space + bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel + +# +# move/resize +# + +# expand a window by moving one of its side outward +super + alt + {h,j,k,l} + bspc node {@west -r -10,@south -r +10,@north -r -10,@east -r +10} + +# contract a window by moving one of its side inward +super + alt + shift + {h,j,k,l} + bspc node {@east -r -10,@north -r +10,@south -r -10,@west -r +10} + +# move a floating window +super + {Left,Down,Up,Right} + xdo move {-x -20,-y +20,-y -20,-x +20} + diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc new file mode 100755 index 0000000..4f47aba --- /dev/null +++ b/.config/sxhkd/sxhkdrc @@ -0,0 +1,141 @@ + +# +# wm independent hotkeys +# + +# increase / decrease volume +XF86Audio{Raise,Lower}Volume + amixer -q sset Master {2%+,2%-} unmute + +# Mute volume +XF86AudioMute + amixer -q sset Master toggle + +# brightness +XF86MonBrightness{Up,Down} + xbacklight -time 1 -steps 1 -{inc,dec} 5 + +# terminal emulator +super + Return + st + +# program launcher +super + p + rofi -show run -m -1 -padding 20 -width 30 -lines 5 -color-window "#111314, #7986cb, #7986cb" -color-normal "#111314, #7986cb, #111314, #7986cb, #111314" -color-active "#111314, #7986cb, #111314, #7986cb, #111314" -location 0 -font "Inconsolata 17" -bc "#7986cb" -bw 2 -opacity 100 -regex + +# window management +super + shift + p + rofi -show window -m -1 -padding 20 -width 30 -lines 5 -color-window "#111314, #7986cb, #7986cb" -color-normal "#111314, #7986cb, #111314, #7986cb, #111314" -color-active "#111314, #7986cb, #111314, #7986cb, #111314" -location 0 -font "Inconsolata 17" -bc "#7986cb" -bw 2 -opacity 100 + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# +# bspwm hotkeys +# + +# quit bspwm normally +super + alt + Escape + bspc quit + +# close and kill +super + {_,shift + }w + bspc node -{c,k} + +# alternate between the tiled and monocle layout +super + m + bspc desktop -l next + +# if the current node is automatic, send it to the last manual, +# otherwise pull the last leaf +super + y + bspc query -N -n focused.automatic && bspc node -n +last.!automatic || bspc node last.leaf -n focused + +# swap the current node and the biggest node +super + g + bspc node -s biggest + +# +# state/flags +# + +# set the window state +super + {t,shift + t,s,f} + bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# set the node flags +super + ctrl + {x,y,z} + bspc node -g {locked,sticky,private} + +# +# focus/swap +# + +# focus the node in the given direction +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# focus the node for the given path jump +super + {p,b,comma,period} + bspc node -f @{parent,brother,first,second} + +# focus the next/previous node +super + {_,shift + }c + bspc node -f {next,prev} + +# focus the next/previous desktop +super + bracket{left,right} + bspc desktop -f {prev,next} + +# focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# focus the older or newer node in the focus history +super + {o,i} + bspc wm -h off; \ + bspc node {older,newer} -f; \ + bspc wm -h on + +# focus or send to the given desktop +super + {_,shift + }{1-9} + bspc {desktop -f,node -d} '^{1-9}' + +# +# preselect +# + +# preselect the direction +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} + +# preselect the ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# cancel the preselection for the focused node +super + ctrl + space + bspc node -p cancel + +# cancel the preselection for the focused desktop +super + ctrl + shift + space + bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel + +# +# move/resize +# + +# expand a window by moving one of its side outward +super + alt + {h,j,k,l} + bspc node {@west -r -10,@south -r +10,@north -r -10,@east -r +10} + +# contract a window by moving one of its side inward +super + alt + shift + {h,j,k,l} + bspc node {@east -r -10,@north -r +10,@south -r -10,@west -r +10} + +# move a floating window +super + {Left,Down,Up,Right} + xdo move {-x -20,-y +20,-y -20,-x +20} + diff --git a/.notmuch-config b/.notmuch-config new file mode 100644 index 0000000..8e19ead --- /dev/null +++ b/.notmuch-config @@ -0,0 +1,98 @@ +# .notmuch-config - Configuration file for the notmuch mail system +# +# For more information about notmuch, see http://notmuchmail.org + +# Database configuration +# +# The only value supported here is 'path' which should be the top-level +# directory where your mail currently exists and to where mail will be +# delivered in the future. Files should be individual email messages. +# Notmuch will store its database within a sub-directory of the path +# configured here named ".notmuch". +# +[database] +path=/home/gigavinyl/mail + +# User configuration +# +# Here is where you can let notmuch know how you would like to be +# addressed. Valid settings are +# +# name Your full name. +# primary_email Your primary email address. +# other_email A list (separated by ';') of other email addresses +# at which you receive email. +# +# Notmuch will use the various email addresses configured here when +# formatting replies. It will avoid including your own addresses in the +# recipient list of replies, and will set the From address based on the +# address to which the original email was addressed. +# +[user] +name=Carolyn Saunders +primary_email=gigavinyl@gmail.com +other_email=timandmoby@gmail.com;600006667@fjuhsd.org; + +# Configuration for "notmuch new" +# +# The following options are supported here: +# +# tags A list (separated by ';') of the tags that will be +# added to all messages incorporated by "notmuch new". +# +# ignore A list (separated by ';') of file and directory names +# that will not be searched for messages by "notmuch new". +# +# NOTE: *Every* file/directory that goes by one of those +# names will be ignored, independent of its depth/location +# in the mail store. +# +[new] +tags=unread;inbox; +ignore= + +# Search configuration +# +# The following option is supported here: +# +# exclude_tags +# A ;-separated list of tags that will be excluded from +# search results by default. Using an excluded tag in a +# query will override that exclusion. +# +[search] +exclude_tags=deleted;spam; + +# Maildir compatibility configuration +# +# The following option is supported here: +# +# synchronize_flags Valid values are true and false. +# +# If true, then the following maildir flags (in message filenames) +# will be synchronized with the corresponding notmuch tags: +# +# Flag Tag +# ---- ------- +# D draft +# F flagged +# P passed +# R replied +# S unread (added when 'S' flag is not present) +# +# The "notmuch new" command will notice flag changes in filenames +# and update tags, while the "notmuch tag" and "notmuch restore" +# commands will notice tag changes and update flags in filenames +# +[maildir] +synchronize_flags=true + +# Cryptography related configuration +# +# The following option is supported here: +# +# gpg_path +# binary name or full path to invoke gpg. +# +[crypto] +gpg_path=gpg diff --git a/.offlineimaprc b/.offlineimaprc new file mode 100644 index 0000000..37ca12f --- /dev/null +++ b/.offlineimaprc @@ -0,0 +1,23 @@ +[general] +accounts = gigavinyl +pythonfile = ~/.offlineimappass.py + +[Account gigavinyl] +localrepository = gigavinyl-local +remoterepository = gigavinyl-remote +postsynchook = ~/.config/offlineimap/hooks/postsync_gigavinyl + +[Repository gigavinyl-local] +type = Maildir +localfolders = ~/mail/gigavinyl + +[Repository gigavinyl-remote] +type = Gmail +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +remotehost = imap.gmail.com +remoteport = 993 +remoteusereval = "gigavinyl@gmail.com" +remotepasseval = get_pass("gigavinyl") +nametrans = lambda folder: {'[Gmail]/All Mail': 'archive', + }.get(folder, folder) +folderfilter = lambda folder: folder == '[Gmail]/All Mail' diff --git a/.scripts/bar.sh b/.scripts/bar.sh index 0cd3650..807f068 100755 --- a/.scripts/bar.sh +++ b/.scripts/bar.sh @@ -2,7 +2,7 @@ pkill admiral -font="Gohufont:size=10" +font="GohuFont:style=Regular:size=9" fallback_font="FontAwesome:size=8" background="#cc111314" foreground="#bcbdc3" diff --git a/.scripts/battery.sh b/.scripts/battery.sh index 1e56f98..2cab275 100755 --- a/.scripts/battery.sh +++ b/.scripts/battery.sh @@ -1,6 +1,6 @@ #!/bin/bash -status="$(cat /sys/class/power_supply/BAT0/status)" -capacity="$(cat /sys/class/power_supply/BAT0/capacity)" +status="$(acpi | awk '{orint $3;}' | sed 's/,//g')" +capacity=$(acpi | awk '{print $4;}' | sed 's/%//g' | sed 's/,//g') color=false echo -n "%{F#e5c078}" if [[ $status == "Charging" ]]; then @@ -19,7 +19,7 @@ elif [[ $capacity -ge "0" ]]; then fi echo -n "%{F-}" -echo -n "Bat: $capacity%" +echo -n "Bat: $capacity% [$(spark $capacity)]" if [[ color ]]; then echo "%{F-}" diff --git a/.scripts/cpu.sh b/.scripts/cpu.sh new file mode 100755 index 0000000..42481c4 --- /dev/null +++ b/.scripts/cpu.sh @@ -0,0 +1,6 @@ +#!/bin/bash +percent=$(top -bn1 | grep "Cpu(s)" | \ + sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \ + awk '{print 100 - $1}') +sparks=$(spark 0 $percent 100) +echo "CPU: $(echo "$percent% [${sparks:1:1}]")" diff --git a/.scripts/fehbg.sh b/.scripts/fehbg.sh new file mode 100755 index 0000000..1a1c96f --- /dev/null +++ b/.scripts/fehbg.sh @@ -0,0 +1,2 @@ +#!/bin/bash +feh --randomize --bg-fill ~/Wallpapers/* diff --git a/.scripts/mail.sh b/.scripts/mail.sh new file mode 100755 index 0000000..9e55f01 --- /dev/null +++ b/.scripts/mail.sh @@ -0,0 +1,3 @@ +#!/bin/sh +NEWEMAILS=$(ls $HOME/mail/**/archive/new | wc -l) +echo "Mail: $NEWEMAILS" diff --git a/.scripts/memory.sh b/.scripts/memory.sh new file mode 100755 index 0000000..b160e0c --- /dev/null +++ b/.scripts/memory.sh @@ -0,0 +1,4 @@ +#!/bin/bash +used=$(free | grep Mem | awk '{print $3/$2 * 100.0}') +sparks=$(spark 0 $used 100) +echo "Mem: $(echo "($used+0.5)/1" | bc)% [${sparks:1:1}]" diff --git a/.scripts/offlineimap-notify.sh b/.scripts/offlineimap-notify.sh new file mode 100755 index 0000000..fedf3c4 --- /dev/null +++ b/.scripts/offlineimap-notify.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +#run OfflineIMAP once, with quiet interface +offlineimap -o -q -u quiet + +count new mail for every maildir +#maildirnew="$HOME/mail/*/*/new/" +#new="$(find $maildirnew -type f | wc -l)" + +count old mail for every maildir +#maildirold="$HOME/mail/*/*/cur/" +#old="$(find $maildirold -type f | wc -l)" + +#if [ $new -gt 0 ] +#then + #export DISPLAY=:0; export XAUTHORITY=~/.Xauthority; + #notify-send -a "OfflineIMAP" "New mail! New: $new Old: $old" +#fi diff --git a/.scripts/tasks.sh b/.scripts/tasks.sh new file mode 100755 index 0000000..5ff3569 --- /dev/null +++ b/.scripts/tasks.sh @@ -0,0 +1,4 @@ +#!/bin/sh +today="$(task list due:today | grep tasks | awk '{print $1;}')" +total="$(task list | grep tasks | awk '{print $1;}')" +echo "Tasks: $today/$total" diff --git a/.zshrc b/.zshrc index da7eed1..2ffff4f 100644 --- a/.zshrc +++ b/.zshrc @@ -22,9 +22,10 @@ bindkey "^[[B" down-line-or-beginning-search # Down source ~/.zplug/init.zsh -zplug "plugins/git", from:oh-my-zsh, nice:10 +zplug "plugins/git", from:oh-my-zsh, defer:3 zplug "plugins/sudo", from:oh-my-zsh zplug "lib/theme-and-appearance", from:oh-my-zsh +zplug "plugins/taskwarrior", from:oh-my-zsh zplug "zsh-users/zsh-syntax-highlighting" zplug "zsh-users/zsh-history-substring-search" zplug "zsh-users/zsh-completions" @@ -45,11 +46,14 @@ export EDITOR="nvim" eval "$(hub alias -s)" alias vi="nvim" alias vim="nvim" -alias cl="clear && neofetch" +alias cl="clear && neofetch --ascii_distro Gentoo && task list" alias prm=". $HOME/.prm/prm.sh" +alias bar=". $HOME/.scripts/bar.sh" . $HOME/.asdf/asdf.sh . $HOME/.asdf/completions/asdf.bash export PATH="$HOME/.apps/Elm-Platform/0.18/.cabal-sandbox/bin/":$PATH export PATH="$HOME/.apps/admiral/target/release/":$PATH export PATH="$HOME/.apps/roller/target/release":$PATH + +task list