~mehdix/dotfiles

61a1a18ec6616491a5472b6f94226c8126cf764a — Mehdi Sadeghi 2 years ago a2a18f7
Add mutt/rock stuff.
M .bashrc => .bashrc +2 -13
@@ 1,3 1,4 @@
echo .bashrc begin
# .bashrc
[ $0 != sh ] && [ -n "${ENV:=$HOME/.env}" ] && . "$ENV"



@@ 27,16 28,4 @@ complete -D -F _completion_loader -o bashdefault -o default
[ -f ~/.config/broot/launcher/bash/br ] && . ~/.config/broot/launcher/bash/br
[ -f ~/.local/src/z.sh ] && . ~/.local/src/z.sh

# direnv hook
_direnv_hook() {
  local previous_exit_status=$?;
  trap -- '' SIGINT;
  eval "$("/usr/bin/direnv" export bash)";
  trap - SIGINT;
  return $previous_exit_status;
};

if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then
  PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}"
fi

echo .bashrc end

M .config/i3status/config => .config/i3status/config +2 -2
@@ 39,8 39,8 @@ ethernet _first_ {
battery 0 {
	format = "%status %percentage %remaining %emptytime"
	#path = "/sys/class/power_supply/rk-bat/uevent"
	#path = "/sys/class/power_supply/cw2015-battery/uevent"
	path = "/sys/class/power_supply/BAT0/uevent"
	path = "/sys/class/power_supply/cw2015-battery/uevent"
	#path = "/sys/class/power_supply/BAT0/uevent"
}

tztime local {

A .config/isync/mbsyncrc => .config/isync/mbsyncrc +21 -0
@@ 0,0 1,21 @@
IMAPAccount main
Host mail.mehdix.org
User mehdi@mehdix.org
PassCmd "pass mail/mx"
SSLType IMAPS
AuthMechs LOGIN

IMAPStore main-remote
Account main

MaildirStore main-local
Subfolders Verbatim
Path ~/Maildir/main/
Inbox ~/Maildir/main/Inbox

Channel main
Far :main-remote:
Near :main-local:
Patterns *
Create Both
SyncState *

M .config/mutt/muttrc => .config/mutt/muttrc +20 -2
@@ 1,8 1,26 @@
# Main config for Maildir (by mbsync)
set folder = "~/Maildir/main"
set mbox_type = Maildir
set spoolfile = +Inbox
set record = +Sent
set postponed = +Drafts
set header_cache = ~/.cache/mutt

# Some nice to have
set sort = threads
set sort_aux = reverse-last-date-received
set date_format = "%y/%m/%d %I:%M%p"

# HTML
set mailcap_path = "~/.config/mutt/mailcap"
auto_view text/html
alternative_order text/plain text/enriched text/html

# Read imap_pass
source ~/.config/mutt/secret

# IMAP
set spoolfile	= imaps://mail.mehdix.org/
#set spoolfile	= imaps://mail.mehdix.org/
set imap_user	= mehdi@mehdix.org

# SMTP


@@ 16,4 34,4 @@ set smtp_url	= smtp://$imap_user@mehdix.org:587/
lists sr.ht-discuss
set reply_to 	= "ask-yes"

source ~/.config/mutt/`hostname`
#source ~/.config/mutt/`hostname`

M .config/sway/config => .config/sway/config +5 -5
@@ 4,7 4,7 @@ set $down j
set $up k
set $right l
set $mod Mod4
set $term foot
set $term foot-extra

# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.


@@ 25,10 25,10 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
exec swayidle -w \
	timeout 300 'swaylock -f -c 000000' \
	timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
	before-sleep 'swaylock -f -c 000000'
#exec swayidle -w \
#	timeout 300 'swaylock -f -c 000000' \
#	timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
#	before-sleep 'swaylock -f -c 000000'

# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when

A .config/systemd/user/mbsync.service => .config/systemd/user/mbsync.service +9 -0
@@ 0,0 1,9 @@
[Unit]
Description=Mailbox synchronization service

[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -ac ${HOME}/.config/isync/mbsyncrc

[Install]
WantedBy=default.target

A .config/systemd/user/mbsync.timer => .config/systemd/user/mbsync.timer +10 -0
@@ 0,0 1,10 @@
[Unit]
Description=Mailbox synchronization timer

[Timer]
OnBootSec=2m
OnUnitActiveSec=5m
Unit=mbsync.service

[Install]
WantedBy=timers.target

M .env => .env +4 -0
@@ 1,3 1,4 @@
echo .env begin
# .env
PS1='$(prompt)'



@@ 30,6 31,7 @@ alias gl='git pull'
alias gcm='git checkout master'
alias gco='git checkout'
alias gst='git status'
alias mbsync="mbsync -c ~/.config/isync/mbsyncrc"

# Use correct TTY for GPG Pinentry
export GPG_TTY="$(tty)"


@@ 41,3 43,5 @@ export PATH=$HOME/.cargo/bin:$PATH
export GOPATH="$HOME/.local/share/go"
export PATH=$GOPATH/bin:$PATH

export BROWSER=w3m
echo .env end

M .profile => .profile +4 -1
@@ 1,9 1,10 @@
echo .profile begin
# .profile
export ENV=~/.env
export LANG=en_US.UTF-8
export LC_TIME=de_DE.UTF-8
export EDITOR=vim
export TERM=foot-extra
#export TERM=foot-extra
export HISTSIZE=65535

export MAKEFLAGS=-j`lscpu | grep '^CPU(s):' | awk -F' ' '{ print $2 }'`


@@ 15,3 16,5 @@ export GDK_BACKEND=wayland

[ -e .config/$(hostname).profile ] && . .config/$(hostname).profile
[ $0 != sh ] && [ -n $BASH_VERSION ] && shopt login_shell 2>&1 > /dev/null && [ -f ~/.bashrc ] && . ~/.bashrc

echo .profile end

M .vimrc => .vimrc +19 -53
@@ 1,62 1,28 @@
set nocompatible              " required
set tabstop=4
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

Plugin 'vim-syntastic/syntastic'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'nvie/vim-flake8'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'rust-lang/rust.vim'
Plugin 'racer-rust/vim-racer'
Plugin 'ConradIrwin/vim-bracketed-paste'
"Bundle 'Valloric/YouCompleteMe'
Plugin 'junegunn/fzf'
" Save the buffer whenever text is changed.
" https://stackoverflow.com/a/55761306
" autocmd TextChanged,TextChangedI <buffer> silent write


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

let python_highlight_all=1
let g:airline_theme='wombat'
set encoding=utf-8
set mouse-=a
set rtp+=/usr/bin/fzf
syntax on

"split navigations
" Pane navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

au BufNewFile,BufRead *.py
    \ set tabstop=4 |
    \ set softtabstop=4 |
    \ set shiftwidth=4 |
    \ set textwidth=79 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix
" Use ctrl-[hjkl] to select the active split!
"nmap <silent> <c-k> :wincmd k<CR>
"nmap <silent> <c-j> :wincmd j<CR>
"nmap <silent> <c-h> :wincmd h<CR>
"nmap <silent> <c-l> :wincmd l<CR>

" Source vimrc in $CWD in a secure way
set exrc
set secure


:source /home/rock/.vim/right_align.vim

"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
map <C-n> :NERDTreeToggle<CR>
set arabicshape!
let g:RightAlign_RightBorder = 80
imap <silent> <C-b>    <Plug>RightAlign
nmap <silent> <C-k>b    :RightAlign<CR>
vmap <silent> <C-k>b    :RightAlign<CR>