commit 50792ab0b0089c1114de7416ddbaa4398294de06
parent f744170732f6c5e55ec97915ba96747679461e97
Author: Hayden Hamilton <hayden@haydenvh.com>
Date: Thu, 20 Feb 2020 17:43:04 +0000
neomutt & mbsync
Diffstat:
11 files changed, 276 insertions(+), 164 deletions(-)
diff --git a/.config/fish/config.fish b/.config/fish/config.fish
@@ -38,7 +38,7 @@ abbr -a -g rmst bash ~/.scripts/random/gnulinux.sh
abbr -a -g fff bash ~/.config/fff/config
abbr -a -g python python3
abbr -a -g vimb vimb --no-maximize
-abbr -a -g cleancache "sudo xbps-remove -O; rm -rf ~/.cache ~/.mozilla ~/.local/share/webkitgtk"
+abbr -a -g cleancache "sudo xbps-remove -Oo; rm -rf ~/.cache ~/.mozilla ~/.local/share/webkitgtk"
abbr -a -g clock tty-clock -s -c -C 7
abbr -a -g ~d cd ~/general/downloads
abbr -a -g ~do cd ~/general/documents
diff --git a/.config/neomutt/colours b/.config/neomutt/colours
@@ -0,0 +1,72 @@
+# vim: filetype=neomuttrc
+# Default index colors:
+color index yellow default '.*'
+color index_author magenta default '.*'
+color index_number magenta default
+color index_subject cyan default '.*'
+
+# For new mail:
+color index blue default "~N"
+color index_author magenta default "~N"
+color index_subject color12 default "~N"
+
+# Header colors:
+color header blue default ".*"
+color header brightmagenta default "^(From)"
+color header brightcyan default "^(Subject)"
+color header brightwhite default "^(CC|BCC)"
+
+mono bold bold
+mono underline underline
+mono indicator reverse
+mono error bold
+color normal default default
+color indicator brightblack white
+color sidebar_highlight red default
+color sidebar_divider brightblack black
+color sidebar_flagged red black
+color sidebar_new green black
+color normal brightyellow default
+color error red default
+color tilde black default
+color message cyan default
+color markers red white
+color attachment white default
+color search brightmagenta default
+color status brightyellow black
+color hdrdefault brightgreen default
+color quoted color3 default
+color quoted1 color4 default
+color quoted2 color5 default
+color quoted3 color6 default
+color quoted4 color7 default
+color quoted5 color7 default
+color quoted6 color7 default
+color quoted7 color7 default
+color signature brightgreen default
+color bold black default
+color underline black default
+color normal default default
+
+color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
+color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
+color body green default "\`[^\`]*\`" # Green text between ` and `
+color body brightblue default "^# \.*" # Headings as bold blue
+color body brightcyan default "^## \.*" # Subheadings as bold cyan
+color body brightgreen default "^### \.*" # Subsubheadings as bold green
+color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
+color body brightcyan default "[;:][-o][)/(|]" # emoticons
+color body brightcyan default "[;:][)(|]" # emoticons
+color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
+color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
+color body red default "(BAD signature)"
+color body cyan default "(Good signature)"
+color body brightblack default "^gpg: Good signature .*"
+color body brightyellow default "^gpg: "
+color body color10 red "^gpg: BAD signature from.*"
+mono body bold "^gpg: Good signature"
+mono body bold "^gpg: BAD signature from.*"
+color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
+
+# Set status bar color
+color status color5 default
diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc
@@ -0,0 +1,18 @@
+set ssl_starttls = yes
+set ssl_force_tls = yes
+source user
+source pass
+set smtp_authenticators = "plain"
+
+set spoolfile = "~/mail/inbox"
+set record = "~/mail/sent"
+set postponed = "~/mail/drafts"
+set trash = "~/mail/rubbish"
+mailboxes =inbox =sent =drafts =rubbish
+
+set mbox_type = Maildir
+
+source colours
+source sidebar
+
+bind index D purge-message
diff --git a/.config/vimb/style.css b/.config/vimb/style.css
@@ -1,7 +1,7 @@
span[vimbhint^='label'] {
background-color:#0c0a1499 !important;
- border:0 !important;
color:#fff !important;
+ border:0 !important;
opacity:1 !important;
padding:1px !important;
text-transform:uppercase !important;
@@ -9,9 +9,11 @@ span[vimbhint^='label'] {
}
*[vimbhint^='hint'] {
background-color:#0c0a1433 !important;
+ color:#888 !important;
}
*[vimbhint^='hint focus'] {
background-color:#0c0a1433 !important;
+ color:#aaa !important;
}
*{
border-radius:0 !important;
diff --git a/.gitaddlist b/.gitaddlist
@@ -56,4 +56,6 @@ git add .config/fish/config.fish
git add .config/vimb/config
git add .config/vimb/style.css
git add .config/vimb/scripts.js
+git add .config/neomutt/neomuttrc
+git add .config/neomutt/colours
git rm --cache .config/vim/.netrwhist
diff --git a/.profile b/.profile
@@ -18,18 +18,15 @@ export BROWSER="vimb"
export work="$HOME/work"
export WORK="$HOME/work"
export SUDO_ASKPASS="$HOME/.scripts/bin/dmenu/daskpass"
-export PASS="$WORK/pass"
+export PASS="$HOME/general/security/pass"
export SHELL="/usr/bin/fish"
bash ~/.ls_colors
-if [ "$hostname" != "" ]
-then
+[ "$hostname" != "" ] && {
echo > /dev/null
-elif [ "$HOSTNAME" != "" ]
-then
+} || [ "$HOSTNAME" != "" ] && {
export hostname="$HOSTNAME"
-elif [ "$(command -v hostname)" != "" ]
-then
+} || [ "$(command -v hostname)" != "" ] && {
export hostname=$(hostname)
-else
+} || {
echo "No built in way to get a hostname..."
-fi
+};
diff --git a/.scripts/bin/dmenu/dfm b/.scripts/bin/dmenu/dfm
@@ -30,10 +30,7 @@ Written by Hayden Hamilton <haydenvh.com>"
fi
forn1="$1"
lsforce="$3"
-if [ "$1" == "" ]
-then
- export forn1="fm"
-fi
+[ "$1" == "" ] && export forn1="fm"
getconf(){
dmenu="dmenu"
@@ -43,23 +40,15 @@ getconf(){
DFM_CLIPBOARD_TYPE="PRIMARY"
. $HOME/.dmenurc
. $HOME/.config/dfm/config
- if [ "$DFM_USE_HH_PATCH" == "1" ]
- then
- dmenu="$dmenu -c -w 1000"
- fi
- if [ "$DFM_CLIPBOARD_TYPE" == "PRIMARY" ]
- then
- clipboard="xclip"
- elif [ "$DFM_CLIPBOARD_TYPE" == "CLIPBOARD" ]
- then
- clipboard="xclip -selection clipboard"
- elif [ "$DFM_CLIPBOARD_TYPE" == "CUSTOM" ]
- then
- clipboard="$DFM_CLIPBOARD_CUSTOM"
- else
- clipboard="xclip"
- fi
- echo $clipboard
+ [ "$DFM_USE_HH_PATCH" == "1" ] && dmenu="$dmenu -c -w 1000"
+
+ case "$DFM_CLIPBOARD_TYPE" in
+ PRIMARY) clipboard="xclip" ;;
+ CLIPBOARD) clipboard="xclip -selection clipboard" ;;
+ CUSTOM) clipboard="$DFM_CLIPBOARD_CUSTOM" ;;
+ esac
+ [ "$DFM_CLIPBOARD_TYPE" = "" ] && clipboard="xclip"
+
confdir="$DFM_CONF_DIR"
conffile="$confdir/config"
}
@@ -79,46 +68,40 @@ sendconf(){
}
fmornorm(){
- if [ "$forn1" == "fm" ]
- then
+ [ "$forn1" == "fm" ] && {
output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:")
fmspecial
- else
+ } || {
dooutput
- if [ "$doarg" == "true" ]
- then
+ [ "$doarg" == "true" ] && {
echo $forn1
$forn1 $argu
argu=""
- fi
- fi
+ };
+ };
}
dooutput(){
[ "$DFM_DISABLE_ENQUEUE" != "1" ] && enqueue=$(echo "DO ENQUEUE" | tr " " "\n" | $dmenu -i -p "What do you want to do?")
- if [ "$enqueue" == "ENQUEUE" ]
- then
+ [ "$enqueue" == "ENQUEUE" ] && {
argu+="$(pwd)/$output "
doarg="false"
- else
+ } || {
argu+="$(pwd)/$output "
doarg="true"
- fi
+ };
}
getdot(){
- if [ "$lsforce" != "" ]
- then
+ [ "$lsforce" != "" ] && {
lscommand="$lsforce"
- elif [ "$DFM_DOT" == "1" ]
- then
+ } || [ "$DFM_DOT" == "1" ] && {
lscommand="ls -A"
- elif [ "$DFM_DOT" == "0" ]
- then
+ } || [ "$DFM_DOT" == "0" ] && {
lscommand="ls"
- else
+ } || {
lscommand="ls -A"
- fi
+ };
}
getprog(){
@@ -139,34 +122,35 @@ sendscrn0x0(){
}
fmspecial(){
- if [ "$output2" == "AUTO - Check config for program to use" ]
- then
- getprog "$output"
- [ "$commandout" != "" ] && $commandout $output $argu
- [ "$commandout" == "" ] && echo "No program set..."
- elif [ "$output2" == "RM - Remove file" ]
- then
- rm $output
- elif [ "$output2" == "CMD - Specific command" ]
- then
- output3=$(dmenu_path | $dmenu -i -p "Select program")
- $output3 $output $argu
- argu=""
- elif [ "$output2" == "MV - Move file" ]
- then
- output3=$(echo "" | $dmenu -i -p "Move to:")
- mv $output $output3
- elif [ "$output2" == "EDIT - Open with $EDITOR" ]
- then
- $EDITOR $output $argu
- argu=""
- elif [ "$output2" == "QUE - Enqueue" ]
- then
- argu+="$output "
- elif [ "$output2" == "SND - Send to 0x0.st" ]
- then
- send0x0
- fi
+ case "$output2" in
+ "AUTO - Check config for program to use")
+ getprog "$output"
+ [ "$commandout" != "" ] && $commandout $output $argu
+ [ "$commandout" == "" ] && echo "No program set..."
+ ;;
+ "RM - Remove file")
+ rm $output
+ ;;
+ "CMD - Specific command")
+ output3=$(dmenu_path | $dmenu -i -p "Select program")
+ $output3 $output $argu
+ argu=""
+ ;;
+ "MV - Move file")
+ output3=$(echo "" | $dmenu -i -p "Move to:")
+ mv $output $output3
+ ;;
+ "EDIT - Open with $EDITOR")
+ $EDITOR $output $argu
+ argu=""
+ ;;
+ "QUE - Enqueue")
+ argu+="$output "
+ ;;
+ "SND - Send to 0x0.st")
+ send0x0
+ ;;
+ esac
}
cd $2
@@ -190,81 +174,72 @@ CMD - Specific command
EDIT - Open with $EDITOR
QUE - Enqueue
SND - Send to 0x0.st"
- if [ "$output" == "FM" ]
- then
+ [ "$output" == "FM" ] && {
output=$(echo "$fmcmd1" | $dmenu -l 30 -i -p "Select command:")
- if [ "$output" == "MD - Make dir" ]
- then
- output2=$(echo "" | $dmenu -i -p "Name dir:")
- mkdir $output2
- elif [ "$output" == "MF - Make file" ]
- then
- output2=$(echo "" | $dmenu -i -p "Name file:")
- touch $output2
- elif [ "$output" == "BM - Bookmarks" ]
- then
- touch ~/.config/dfm/bookmarks
- output=$(echo "MK DEL $(cat ~/.config/dfm/bookmarks | awk '// {print $1}')" | tr "\n" " " | tr " " "\n" | $dmenu -l 30 -i -p "Select file/directory:")
- if [ "$output" == "MK" ]
- then
- output=$(echo "" | $dmenu -i -p "Choose bookmark name(no spaces):")
- output2=$(echo "" | $dmenu -i -p "Choose bookmark path(absolute):")
- echo "$output $output2" >> ~/.config/dfm/bookmarks
- elif [ "$output" == "DEL" ]
- then
- output=$(echo "$(cat $confdir/bookmarks | awk '// {print $1}')" | $dmenu -l 30 -i -p "Select bookmark to delete:")
- [ "$(cat $confdir/bookmarks | awk "/$output/ {print"' $1}')" == "$output" ] && sed -i "/$output/d" $confdir/bookmarks
- else
- output=$(cat ~/.config/dfm/bookmarks | awk "/$output/"' {print $2}')
- output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:")
- fmspecial
- fi
- elif [ "$output" == "FND - Find" ]
- then
- output=$(echo "" | $dmenu -i -p "Enter name of file:")
- output2=$(printf "ROOT (Takes a while)\nLOCALLY" | $dmenu -i -p "Find option")
- if [ "$(echo $output2 | awk '/ROOT/')" != "" ]
- then
- echo "May take a while..."
- output3="/"
- else
- output3="."
- fi
- output=$(echo "NONE $(find $output3 | grep -i "$output")" | tr " " "\n" | $dmenu -i -l 30 -p "Select file:")
- if [ "$output" == "NONE" ]
- then
- echo > /dev/null
- else
- fmornorm
- fi
- elif [ "$output" == "HIDE - Toggle Dotfiles" ]
- then
- if [ "$DFM_DOT" == "0" ]
- then
- export DFM_DOT="1"
- sendconf "DFM_DOT" "1"
- elif [ "$DFM_DOT" == "1" ]
- then
- export DFM_DOT="0"
- sendconf "DFM_DOT" "0"
- else
- export DFM_DOT="0"
- sendconf "DFM_DOT" "0"
- fi
- elif [ "$output" == "SCRN - Host screenshot on 0x0.st" ]
- then
- sendscrn0x0
- fi
- elif [ -d "$output" ]
- then
+ case "$output" in
+ "MD - Make dir")
+ output2=$(echo "" | $dmenu -i -p "Name dir:")
+ mkdir $output2
+ ;;
+ "MF - Make file")
+ output2=$(echo "" | $dmenu -i -p "Name file:")
+ touch $output2
+ ;;
+ "BM - Bookmarks")
+ touch ~/.config/dfm/bookmarks
+ output=$(echo "MK DEL $(cat ~/.config/dfm/bookmarks | awk '// {print $1}')" | tr "\n" " " | tr " " "\n" | $dmenu -l 30 -i -p "Select file/directory:")
+ [ "$output" == "MK" ] && {
+ output=$(echo "" | $dmenu -i -p "Choose bookmark name(no spaces):")
+ output2=$(echo "" | $dmenu -i -p "Choose bookmark path(absolute):")
+ echo "$output $output2" >> ~/.config/dfm/bookmarks
+ } || [ "$output" == "DEL" ] && {
+ output=$(echo "$(cat $confdir/bookmarks | awk '// {print $1}')" | $dmenu -l 30 -i -p "Select bookmark to delete:")
+ [ "$(cat $confdir/bookmarks | awk "/$output/ {print"' $1}')" == "$output" ] && sed -i "/$output/d" $confdir/bookmarks
+ } || {
+ output=$(cat ~/.config/dfm/bookmarks | awk "/$output/"' {print $2}')
+ output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:")
+ fmspecial
+ };
+ ;;
+ "FND - Find")
+ output=$(echo "" | $dmenu -i -p "Enter name of file:")
+ output2=$(printf "ROOT (Takes a while)\nLOCALLY" | $dmenu -i -p "Find option")
+ [ "$(echo $output2 | awk '/ROOT/')" != "" ] && {
+ echo "May take a while..."
+ output3="/"
+ } || {
+ output3="."
+ };
+ output=$(echo "NONE $(find $output3 | grep -i "$output")" | tr " " "\n" | $dmenu -i -l 30 -p "Select file:")
+ [ "$output" == "NONE" ] && {
+ echo > /dev/null
+ } || {
+ fmornorm
+ };
+ ;;
+ "HIDE - Toggle Dotfiles")
+ [ "$DFM_DOT" == "0" ] && {
+ export DFM_DOT="1"
+ sendconf "DFM_DOT" "1"
+ } || [ "$DFM_DOT" == "1" ] && {
+ export DFM_DOT="0"
+ sendconf "DFM_DOT" "0"
+ } || {
+ export DFM_DOT="0"
+ sendconf "DFM_DOT" "0"
+ };
+ ;;
+ "SCRN - Host screenshot on 0x0.st")
+ sendscrn0x0
+ ;;
+ esac
+ } || [ -d "$output" ] && {
cd $output
- elif [ "$output" == "exit" ]
- then
+ } || [ "$output" == "exit" ] && {
exit 1
- elif [ "$output" == "" ]
- then
+ } || [ "$output" == "" ] && {
exit 1
- else
+ } || {
fmornorm
- fi
+ };
done
diff --git a/.scripts/bin/misc/fetchmail b/.scripts/bin/misc/fetchmail
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+while true
+do
+ mbsync --config ~/.config/neomutt/mbsync -a
+ sleep 4m
+done
diff --git a/.scripts/bin/misc/mkmailpass b/.scripts/bin/misc/mkmailpass
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+file="$HOME/general/security/mailinfo"
+[ "$1" != "" ] && file="$1"
+
+. $file
+
+printf "set folder = \"~/mail/\"
+set smtp_url = \"$SMTP_ADDRESS\"
+set from = \"$MAIL_ADDRESS\"
+set realname = \"$REAL_NAME\"
+" > ~/.config/neomutt/user
+
+printf "set imap_pass = \"$IMAP_PASS\"
+set smtp_pass = \"$SMTP_PASS\"
+" > ~/.config/neomutt/pass
+
+printf "IMAPAccount main
+Host $IMAP_HOST
+User $IMAP_USER
+Pass $IMAP_PASS
+SSLType IMAPS
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore main-remote
+Account main
+
+MaildirStore main-local
+Subfolders Verbatim
+Path ~/mail/main/
+Inbox ~/mail/inbox
+
+Channel main
+Master :main-remote:
+Slave :main-local:
+Patterns *
+Create Both
+SyncState *
+" > ~/.config/neomutt/mbsync
diff --git a/.scripts/i3blocks/convtodwm b/.scripts/i3blocks/convtodwm
@@ -3,6 +3,7 @@
mkdir -p ~/.cache/blocks
./host > ~/.cache/blocks/host &
+fetchmail &
swait=21
while true
do
@@ -19,7 +20,7 @@ do
#./.scripts/i3blocks/cal > .cache/blocks/cal &
./cpu > ~/.cache/blocks/cpu &
./mem > ~/.cache/blocks/mem &
- ./mpv > ~/.cache/blocks/mpv &
+ ./mpv 2> /dev/null > ~/.cache/blocks/mpv &
./vol > ~/.cache/blocks/vol &
sleep 3
cd ~/.cache/blocks
diff --git a/.vimrc b/.vimrc
@@ -62,12 +62,12 @@ imap <leader><leader>j <Esc>0/<++><Enter>"_c4l
map <leader>C i<++><Esc>
imap <leader><leader>c <++><Enter>
-map <leader><leader>[ []<Esc><Left>i
-map <leader><leader>( ()<Esc><Left>i
-map <leader><leader>" ""<Esc><Left>i
-map <leader><leader>' ''<Esc><Left>i
-map <leader><leader>{ {}<Esc><Left>i
-map <leader><leader>< <><Esc><Left>i
+map <leader><leader>[ i[]<Esc><Left>i
+map <leader><leader>( i()<Esc><Left>i
+map <leader><leader>" i""<Esc><Left>i
+map <leader><leader>' i''<Esc><Left>i
+map <leader><leader>{ i{}<Esc><Left>i
+map <leader><leader>< i<><Esc><Left>i
imap <leader><leader>[ []<Esc><Left>i
imap <leader><leader>( ()<Esc><Left>i
imap <leader><leader>" ""<Esc><Left>i
@@ -96,12 +96,11 @@ nm <leader>li :call ToggleIPA()<CR>
imap <leader>li <esc>:call ToggleIPA()<CR>a
nm <F8> :call ToggleProse()<CR>
-"File-browser
-map <leader>eh :Sexplore \| set linebreak<CR>
-map <leader>ev :Vexplore \| set linebreak<CR>
-map <leader>en :Explox \| set linebreak<CR>
-map <leader>Eo :browse oldfiles \| set linebreak<CR>
-map <leader>Eb 100j
+"An erotic file-browser
+map <leader>eh :Sex \| set linebreak<CR>
+map <leader>ev :Vex \| set linebreak<CR>
+map <leader>eo :browse oldfiles \| set linebreak<CR>
+map <leader>eb 100j
let g:netrw_liststyle=3
let g:netrw_banner=0
let g:netrw_altv=1