From 61a1a18ec6616491a5472b6f94226c8126cf764a Mon Sep 17 00:00:00 2001 From: Mehdi Sadeghi Date: Mon, 21 Feb 2022 10:20:00 +0100 Subject: Add mutt/rock stuff. --- .bashrc | 15 ++------ .config/i3status/config | 4 +-- .config/isync/mbsyncrc | 21 +++++++++++ .config/mutt/muttrc | 22 ++++++++++-- .config/sway/config | 10 +++--- .config/systemd/user/mbsync.service | 9 +++++ .config/systemd/user/mbsync.timer | 10 ++++++ .env | 4 +++ .profile | 5 ++- .vimrc | 72 ++++++++++--------------------------- 10 files changed, 96 insertions(+), 76 deletions(-) create mode 100644 .config/isync/mbsyncrc create mode 100644 .config/systemd/user/mbsync.service create mode 100644 .config/systemd/user/mbsync.timer diff --git a/.bashrc b/.bashrc index dde7534..56b7e73 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/.config/i3status/config b/.config/i3status/config index d064a7c..b5f64fb 100644 --- a/.config/i3status/config +++ b/.config/i3status/config @@ -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 { diff --git a/.config/isync/mbsyncrc b/.config/isync/mbsyncrc new file mode 100644 index 0000000..f138920 --- /dev/null +++ b/.config/isync/mbsyncrc @@ -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 * diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc index 741cdd4..92c650b 100644 --- a/.config/mutt/muttrc +++ b/.config/mutt/muttrc @@ -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` diff --git a/.config/sway/config b/.config/sway/config index bb9c126..2e4eb3d 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -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 diff --git a/.config/systemd/user/mbsync.service b/.config/systemd/user/mbsync.service new file mode 100644 index 0000000..cebd702 --- /dev/null +++ b/.config/systemd/user/mbsync.service @@ -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 diff --git a/.config/systemd/user/mbsync.timer b/.config/systemd/user/mbsync.timer new file mode 100644 index 0000000..82ebb83 --- /dev/null +++ b/.config/systemd/user/mbsync.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Mailbox synchronization timer + +[Timer] +OnBootSec=2m +OnUnitActiveSec=5m +Unit=mbsync.service + +[Install] +WantedBy=timers.target diff --git a/.env b/.env index ab8d692..2132db0 100644 --- a/.env +++ b/.env @@ -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 diff --git a/.profile b/.profile index 4832034..cb54b12 100644 --- a/.profile +++ b/.profile @@ -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 diff --git a/.vimrc b/.vimrc index 2714d6e..5093c95 100644 --- a/.vimrc +++ b/.vimrc @@ -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 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 nnoremap nnoremap nnoremap -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 :wincmd k +"nmap :wincmd j +"nmap :wincmd h +"nmap :wincmd l + +" 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 :NERDTreeToggle +set arabicshape! +let g:RightAlign_RightBorder = 80 +imap RightAlign +nmap b :RightAlign +vmap b :RightAlign -- cgit v1.2.3