From 59d37ada838e8233a65c4527c79c8624a4cb0ee6 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 1 Jun 2016 19:28:25 +0200 Subject: include a password file for mutt and other misc changes config.fish: 1) include ~/.local/bin in the PATH variable 2) prepend new PATH components muttrc: 1) write comment about new password file 2) use variables exported by mutt.sh 3) use dmenu instead of rofi to select links from urlscan mutt.sh: 1) mutt wrapper script that decrypts and reads the password file 2) start mutt dependend on the calling context (Termial|XSession) password: new password file. The Layout is explained in muttrc setup.py: include mutt.sh in the mutt target --- config/fish/config.fish | 25 ++++++++++++++++--------- mutt/passwords | Bin 0 -> 622 bytes muttrc | 15 ++++++++++++++- scripts/mutt.sh | 19 +++++++++++++++++++ setup.py | 3 ++- 5 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 mutt/passwords create mode 100755 scripts/mutt.sh diff --git a/config/fish/config.fish b/config/fish/config.fish index 37ee23a..322df54 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -6,14 +6,6 @@ set fish_complete_path $HOME/.dotfiles/config/fish/completions $fish_complete_pa # add git-alias subdirectory to functions path set fish_function_path $HOME/.dotfiles/config/fish/functions/git-alias $fish_function_path -# include cargo binaries -if type -q multirust - for p in $HOME/.multirust/toolchains/*/cargo/bin - if not contains $p $PATH - set PATH $PATH $p - end - end -end if not set -q __fish_git_prompt_show_informative_status set -Ux __fish_git_prompt_show_informative_status true @@ -35,6 +27,21 @@ if not set -q SSH_KEY_PATH set -Ux SSH_KEY_PATH $HOME/.ssh/rsa_id end +# PATH Stuff + +# include cargo binaries +if type -q multirust + for p in $HOME/.multirust/toolchains/*/cargo/bin + if not contains $p $PATH + set PATH $PATH $p + end + end +end + +if not contains ~/.local/bin $PATH + set PATH ~/.local/bin $PATH +end + if not contains /usr/local/bin $PATH - set PATH $PATH /usr/local/bin + set PATH /usr/local/bin $PATH end diff --git a/mutt/passwords b/mutt/passwords new file mode 100644 index 0000000..172224a Binary files /dev/null and b/mutt/passwords differ diff --git a/muttrc b/muttrc index 6a12019..1b99fba 100644 --- a/muttrc +++ b/muttrc @@ -33,6 +33,18 @@ set use_from = yes set smtp_url="smtps://$imap_user@smtp-auth.uni-erlangen.de" + +############### PASSWORDS ################## +# the passwords are stored in the file .mutt/passwords.gpg +# and this file is read and evaluated before mutt is started. +# the file format should be: +# export +# +# see: http://www.mail-archive.com/mutt-users@mutt.org/msg36375.html + +set smtp_pass=$FAU_PASS +set imap_pass=$FAU_PASS + ############### GPG ######################## source ~/.mutt/gpg.rc @@ -46,7 +58,8 @@ set crypt_verify_sig=yes set sort=threads set sort_aux=last-date-received -macro pager,index \cb 'eval $BROWSER $(urlscan -n | rofi -dmenu)' 'Follow links with urlview' +# open links with urlscan +macro pager,index \cb 'eval $BROWSER $(urlscan -n | dmenu)' 'Follow links with urlview' ############## Bindings #################### diff --git a/scripts/mutt.sh b/scripts/mutt.sh new file mode 100755 index 0000000..31702ca --- /dev/null +++ b/scripts/mutt.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# read the password file +pwds=`gpg -d ~/.mutt/passwords` +eval "$pwds" +# execute mutt in a terminal if we are in a graphical session ( X or Wayland ) +# and TERM is linux => this script was started not from a terminal +if [ "$DISPLAY" ] || [ "$WAYLAND_DISPLAY" ] && [ "$TERM" == "linux" ] +then + # change font size on my main laptop + if [ "$(hostname)" = "fishtank" ] + then + exec urxvt -fn "xft: Terminess Powerline:pixelsize=18" -e "mutt" + else + exec urxvt -e "mutt" + fi +else + exec mutt "$@" +fi diff --git a/setup.py b/setup.py index 1338902..85c3766 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,8 @@ targets = {"vimrc": [("vimrc", home_dir + "/.vimrc")], "ssh-config": [("ssh/config", home_dir + "/.ssh/config")], "xinitrc": [("xinitrc", home_dir + "/.xinitrc")], "Xresources": [("Xresources", home_dir + "/.Xresources")], - "mutt": [("muttrc", home_dir + "/.muttrc"), ("mutt", home_dir + "/.mutt")], + "mutt": [("muttrc", home_dir + "/.muttrc"), ("mutt", home_dir +"/.mutt") + ("scripts/mutt.sh", home_dir+"/.local/bin/mutt.sh"),], "zshrc": [("zshrc", home_dir + "/zshrc")], "i3-config": [("i3", home_dir + "/.i3")], "dir_colors": [("dir_colors", home_dir + "/.dir_colors")], -- cgit v1.2.3