├── .gitmodules ├── .tmux ├── plugins │ └── .placeholder └── omnius ├── .bash_completion.d └── .placeholder ├── .vim ├── ftplugin │ └── tex.vim ├── ftdetect │ └── bitbake.vim └── syntax │ └── known_hosts.vim ├── .neomutt ├── bin │ ├── common │ │ └── mutt-64x64.png │ ├── helpers │ │ └── mailboxes.sh │ ├── search_glab_n_jira.sh │ ├── print.sh │ ├── search_similar.sh │ ├── jira.sh │ ├── gitlab.sh │ ├── notmuch-post-new │ ├── sync.d │ │ ├── sync_github │ │ ├── sync │ │ ├── sync_jira │ │ └── sync_gitlab │ └── sidecar_router.sh ├── neomuttrc.autoview ├── mailcap_work ├── mailcap_personal ├── neomuttrc.demo-imap ├── toggle │ ├── neomuttrc.arrow_cursor_on │ ├── neomuttrc.pager_index_lines_off │ ├── neomuttrc.arrow_cursor_off │ └── neomuttrc.pager_index_lines_on ├── .deps ├── neomuttrc.crypt ├── neomuttrc.tmp ├── neomuttrc.profile-work-mailstep ├── neomuttrc.demo-toggle-delete ├── lua │ ├── rotate_window_timebase.lua │ └── change_color_scheme.lua ├── neomuttrc.profile-personal.bak ├── neomuttrc.profile-personal-jj ├── neomuttrc.profile-personal ├── neomuttrc.profile-work ├── mailcap ├── neomuttrc.sidebar ├── neomuttrc.hooks ├── neomuttrc.profile-personal-cockli ├── .schema ├── neomuttrc.myvars ├── neomuttrc.profile-common.new ├── neomuttrc.profile-common.bak ├── neomuttrc.profile-common ├── neomuttrc.demo-dynamic-mailboxes ├── neomuttrc.aliases ├── neomuttrc.colors ├── neomuttrc ├── neomuttrc.mailboxes └── neomuttrc.bindings ├── .gitignore ├── .bash_logout ├── .xinitrc ├── .screenrc ├── README.md ├── .slate ├── .gitconfig ├── .bash_profile ├── .xmobarrc ├── .Xresources ├── .bash_aliases ├── .inputrc ├── .bashrc ├── .tmux.conf ├── .notmuch-config ├── .psqlrc ├── .tigrc ├── .vimrc ├── .xmonad └── xmonad.hs └── .bash_functions /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.tmux/plugins/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.bash_completion.d/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vim/ftplugin/tex.vim: -------------------------------------------------------------------------------- 1 | imap it Tex_InsertItemOnThisLine 2 | -------------------------------------------------------------------------------- /.neomutt/bin/common/mutt-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jindraj/dotfiles/HEAD/.neomutt/bin/common/mutt-64x64.png -------------------------------------------------------------------------------- /.neomutt/neomuttrc.autoview: -------------------------------------------------------------------------------- 1 | # to see some MIME types inline 2 | auto_view text/html 3 | auto_view text/csv 4 | 5 | # vim:foldmethod=marker:ft=neomuttrc 6 | -------------------------------------------------------------------------------- /.neomutt/mailcap_work: -------------------------------------------------------------------------------- 1 | text/html; (open -n -a "Google Chrome" --args --profile-directory="Default" %s && sleep 2) &; nametemplate=%s.html; needsterminal 2 | -------------------------------------------------------------------------------- /.neomutt/mailcap_personal: -------------------------------------------------------------------------------- 1 | text/html; (open -n -a "Google Chrome" --args --profile-directory="Profile 1" %s && sleep 2) &; nametemplate=%s.html; needsterminal 2 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.demo-imap: -------------------------------------------------------------------------------- 1 | 2 | set imap_pass="pass" 3 | set imap_user="user@gmail.com" 4 | 5 | set spoolfile="imaps://imap.gmail.com" 6 | mailboxes $spoolfile 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vim/bundle 2 | .vim/plugged 3 | .vim/autoload 4 | .vim/.netrwhist 5 | .notmuch-config 6 | .neomutt/signature-work 7 | .neomutt/signature-personal 8 | .neomutt/bin/common/.env 9 | -------------------------------------------------------------------------------- /.neomutt/toggle/neomuttrc.arrow_cursor_on: -------------------------------------------------------------------------------- 1 | set arrow_cursor = yes 2 | color indicator default default 3 | 4 | macro index,browser,alias,generic,pager , \ 5 | "source $my_cfgdir/toggle/neomuttrc.arrow_cursor_off\ 6 | echo 'Arrow cursor off'" \ 7 | "toggle arrow cursor" 8 | -------------------------------------------------------------------------------- /.bash_logout: -------------------------------------------------------------------------------- 1 | # Remove mysql/psql history files 2 | #[[ -s ~/.mysql_history ]] && rm ~/.mysql_history 3 | #[[ -s ~/.psql_history ]] && rm ~/.psql_history 4 | 5 | # clear screen 6 | [[ "$TERM" != "screen-256color" ]] && clear 7 | 8 | sudo -k # delete sudo timestamps 9 | history -a # append bash_history to history file 10 | -------------------------------------------------------------------------------- /.neomutt/toggle/neomuttrc.pager_index_lines_off: -------------------------------------------------------------------------------- 1 | unbind index,browser,alias,generic,pager , 2 | 3 | set pager_index_lines = 0 4 | macro index,browser,alias,generic,pager ,m \ 5 | "source $my_cfgdir/toggle/neomuttrc.pager_index_lines_on\ 6 | echo 'Toggle pager lines off'" \ 7 | "Toggle pager lines" 8 | -------------------------------------------------------------------------------- /.neomutt/toggle/neomuttrc.arrow_cursor_off: -------------------------------------------------------------------------------- 1 | unset arrow_cursor 2 | color indicator $my_textcolor $my_theme_color 3 | 4 | macro index,browser,alias,generic,pager , \ 5 | "source $my_cfgdir/toggle/neomuttrc.arrow_cursor_on\ 6 | echo 'Arrow cursor on $arrow_string'" \ 7 | "toggle arrow cursor" 8 | 9 | -------------------------------------------------------------------------------- /.neomutt/toggle/neomuttrc.pager_index_lines_on: -------------------------------------------------------------------------------- 1 | unbind index,browser,alias,generic,pager , 2 | 3 | set pager_index_lines = $my_pager_index_lines 4 | macro index,browser,alias,generic,pager ,m \ 5 | "source $my_cfgdir/toggle/neomuttrc.pager_index_lines_off\ 6 | echo 'Toggle pager lines on'" \ 7 | "Toggle pager lines" 8 | -------------------------------------------------------------------------------- /.neomutt/.deps: -------------------------------------------------------------------------------- 1 | # list of dependencies 2 | ## neomuttrc 3 | * gopass 4 | 5 | ## ./bin/sync.d/* 6 | * gopass 7 | * `gmailieer` for [GMail]/All Mail 8 | * `notmuch` for indexing 9 | 10 | ## other 11 | * `elinks` (dump html in mailcaps) 12 | * `urlview` 13 | 14 | ## ./bin/print.sh 15 | * `procmail` (formail) 16 | * `enscript` (printing) 17 | * `a2ps` (printing) 18 | -------------------------------------------------------------------------------- /.tmux/omnius: -------------------------------------------------------------------------------- 1 | new -s omnius mutt # creates the new session called -s and runs command 2 | switch -t omnius # switch to sesstion omnius 3 | kill-session -t 0 # kill previous session 4 | neww -a irssi # creates new window, switch to it and runs irssi 5 | splitw -h -p 20 -t 0 'cat .irssi/nicklistfifo' # split window, right pane 20%, run nicklist 6 | selectw -t 1 7 | selectp -t 0 8 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | xrdb -merge ~/.Xresources 2 | xset +dpms 3 | xset dpms 500 1000 1500 4 | eval `ssh-agent` 5 | eval $(gpg-agent --daemon) 6 | xscreensaver &> /dev/null & 7 | trayer --edge bottom --align right --SetDockType true --SetPartialStrut true --expand true --width 5 --height 12 --transparent true --tint 0x000000 & 8 | xsetbg ~/downloads/wallpapers/mutt.png 9 | 10 | exec ck-launch-session dbus-launch --sh-syntax --exit-with-session xmonad 11 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.crypt: -------------------------------------------------------------------------------- 1 | set smime_is_default 2 | 3 | set crypt_replysign = yes # sign only replies to signed messages 4 | set crypt_replysignencrypted = yes # encrypt and sign replies to encrypted messages 5 | 6 | my_hdr X-PGP-Key: fp="F49D F080 5F0C FAF0 2EAA A46D F6F6 80DC 390A 9AE3"\; id="0x390A9AE3"\; get= 7 | 8 | # vim:foldmethod=marker:ft=neomuttrc 9 | -------------------------------------------------------------------------------- /.screenrc: -------------------------------------------------------------------------------- 1 | startup_message off # I've read this so many times I could recite it during sleeping 2 | ignorecase on # Ignore case in searches 3 | vbell off # Turn off visaul bell because of epileptic fit 4 | defscrollback 10000 # I like history 5 | hardstatus alwayslastline # Status bar 6 | hardstatus string "%{= kG}%-w%{.Gk}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y-%m-%d %C%A " # Hardstatus magic string 7 | termcapinfo xterm ti@:te@ 8 | termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' 9 | -------------------------------------------------------------------------------- /.neomutt/bin/helpers/mailboxes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # required notmuch config: 4 | # [index] 5 | # header.GitLabProjectPath=X-GitLab-Project-Path 6 | 7 | while read -r 8 | do 9 | printf 'named-mailboxes "git/%s" "notmuch://?query=GitLabProjectPath:%s AND is:inbox" \n' "$REPLY" "$REPLY" 10 | done < <(find "$HOME/cklb" -type d -execdir test -d {}/.git \; -prune -print | cut -f 6- -d / | grep -v _) 11 | # grep -v _ - to prune git repositories with underscores (my local testing repos) 12 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.tmp: -------------------------------------------------------------------------------- 1 | set maildir_check_cur = no 2 | #set resolve #jump to next undeleted message after action (deletion,tag,etc) 3 | set allow_ansi 4 | 5 | set my_theme_number = "0" 6 | macro index,pager x '\ 7 | lua-source $my_cfgdir/lua/change_color_scheme.lua\ 8 | exec refresh\ 9 | lua mutt.call("echo","Colorscheme:" .. mutt.get("my_theme_number"))' 10 | 11 | set rfc2047_parameters 12 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 13 | -------------------------------------------------------------------------------- /.neomutt/bin/search_glab_n_jira.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # required notmuch config: 4 | # [index] 5 | # header.GitLabProjectPath=X-GitLab-Project-Path 6 | # header.GitLabPipelineRef=X-GitLab-Project-Ref 7 | # header.GitLabMergeRequestIID=X-GitLab-MergeRequest-IID 8 | 9 | read -r -p 'Enter search term: ' my_nm_query 10 | printf 'push "GitLabPipelineRef:%s OR GitLabProjectPath:%s OR GitLabMergeRequestIID:%s OR subject:%s"' "$my_nm_query" "$my_nm_query" "$my_nm_query" "$my_nm_query" 11 | 12 | -------------------------------------------------------------------------------- /.vim/ftdetect/bitbake.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype detection file 2 | " 3 | " Language: OpenSSH known_hosts (known_hosts) 4 | " Author: Camille Moncelier 5 | " Copyright: Copyright (C) 2010 Camille Moncelier 6 | " Licence: You may redistribute this under the same terms as Vim itself 7 | " 8 | " This sets up the syntax highlighting for known_host file 9 | 10 | if &compatible || version < 600 11 | finish 12 | endif 13 | 14 | " Known_hosts 15 | au BufNewFile,BufRead known_hosts set filetype=known_hosts 16 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-work-mailstep: -------------------------------------------------------------------------------- 1 | source $my_cfgdir/neomuttrc.profile-work 2 | set from = "jakub.jindra@mailship.com" 3 | set realname = $my_work_name 4 | set my_receipt = $my_work_receipt 5 | set signature = $my_cfgdir/signature-work 6 | set my_theme_color = '#FFCD67' 7 | set my_theme_color2 = '#FFB00D' 8 | set my_theme_color3 = '#DBA507' 9 | set my_theme_color_b = '#FFCD67' 10 | set my_textcolor = '#1E1E1E' 11 | set my_textcolor_b = '#3C3C3C' 12 | 13 | source $my_cfgdir/neomuttrc.profile-common 14 | 15 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 16 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.demo-toggle-delete: -------------------------------------------------------------------------------- 1 | # toggles delete flag on message under cursor or tagged messages 2 | macro index A \ 3 | "score '~m . ~D' 10\ 4 | score '~m . !~D' 20\ 5 | \ 6 | unscore *\ 7 | score '~T ~D' 10\ 8 | score '~T !~D' 20\ 9 | \ 10 | ~n 20\ 11 | ~n 10\ 12 | unscore *" 13 | 14 | # ~T instead of '~m .' for multiple messages works fine. 15 | 16 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 17 | -------------------------------------------------------------------------------- /.neomutt/bin/print.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | if ! command -v a2ps >/dev/null || ! command -v ps2pdf >/dev/null; then 3 | echo "ERROR: both a2ps and ghostscript must be installed" 1>&2 4 | exit 1 5 | fi 6 | 7 | tmpfile=$(mktemp) 8 | perl -pe 's/\e\[[\d;]*m//g;' | \ 9 | iconv -f utf-8 -t iso-8859-2 -c | \ 10 | a2ps -B -X iso2 -o - | \ 11 | ps2pdf - "$tmpfile" 12 | 13 | # a2ps brew build needs a little fixing: https://github.com/orgs/Homebrew/discussions/4531#discussioncomment-6009690 14 | # a2ps can be replaced with enscript 15 | # enscript -f Courier8 -X latin2 -B $INPUT -p - 2>/dev/null 16 | 17 | open -a Preview "$tmpfile" 18 | sleep 1 19 | rm "$tmpfile" 20 | -------------------------------------------------------------------------------- /.neomutt/lua/rotate_window_timebase.lua: -------------------------------------------------------------------------------- 1 | base = { "hour", "day", "week", "month", "year" } 2 | 3 | for k,v in pairs(base) do 4 | if v == mutt.get('nm_query_window_timebase') then 5 | i=(k+1)%(#base+1) -- because LUA counts from 1 6 | if i==0 then i=1 end -- don't know if this can be done better 7 | break 8 | end 9 | end 10 | 11 | -- set the value 12 | mutt.set('nm_query_window_timebase',base[i]) 13 | -- source file where the status_format is to 14 | mutt.enter("source ~/.neomutt/neomuttrc.profile-common") 15 | -- reopen current mailbox to force rerun the query (possible neomutt bug?) 16 | mutt.command.push('c^^\\n') 17 | -- inform me 18 | mutt.call("echo","'Changing window base to '" .. base[i]) 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | dotfiles 2 | ======== 3 | 4 | My dotfiles repository for keeping config files 5 | 6 | ## repo includes 7 | 8 | ## configuration files works with 9 | * brew? 10 | * bash 11 | * GNU bash, version 4.3.46(1)-release (x86_64-apple-darwin15.5.0) 12 | * bash_completion 13 | * readline 14 | * readline: stable 6.3.8 (bottled) 15 | * iTerm2 nightly builds 16 | * tmux 2.2 (bottled) 17 | 18 | 19 | 20 | * vim configuration 21 | * Xresources 22 | * xterm 23 | * xmessage 24 | * xscreensaver dialog 25 | * xcursor theme 26 | * xinitrc 27 | * xmonad configuration 28 | * xmobar configuration 29 | * screen 30 | * tmux 31 | * git 32 | * inputrc 33 | * psqlrc 34 | * bash 35 | * aliases 36 | * functions 37 | * profile 38 | * bashrc 39 | * logout 40 | -------------------------------------------------------------------------------- /.neomutt/bin/search_similar.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # to decode mime encoded headers 4 | function __search_similar_decode_header(){ 5 | python3 -c 'from email.header import decode_header, make_header; import sys; print(make_header(decode_header(sys.stdin.read())))' 6 | } 7 | 8 | function run(){ 9 | # printf 'FORMAT' "extract headers using formail | decode mime headers | split words to lines | remove doublequotes | fzf | replace newlines with spaces" 10 | printf 'push "%s"' \ 11 | "$(formail -c -x Subject: -x From: -x To: < /dev/stdin \ 12 | | __search_similar_decode_header \ 13 | | tr ' ' '\n' \ 14 | | tr -d '"' \ 15 | | fzf -m --reverse \ 16 | | tr '\n' ' ' 17 | )" 18 | } 19 | 20 | run "$@" >"$MY_TMP_SEARCH" 21 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-personal.bak: -------------------------------------------------------------------------------- 1 | set from = $my_personal_email_address 2 | set realname = $my_personal_name 3 | set my_receipt = $my_personal_receipt 4 | set signature = $my_cfgdir/signature-personal 5 | 6 | set my_theme_color = '#8701d7' 7 | set my_theme_color2 = '#ac24fe' 8 | set my_theme_color3 = '#c86dfe' 9 | set my_textcolor = '#51d701' 10 | set my_textcolor_b = $my_textcolor 11 | set my_theme_color_b = $my_theme_color 12 | 13 | set smtp_oauth_refresh_command = $my_personal_smtp_oauth_refresh_command 14 | set smtp_url = "smtps://$my_personal_email_address@smtp.gmail.com:465/" 15 | set smtp_authenticators = "oauthbearer" 16 | 17 | unmy_hdr Organization 18 | 19 | source $my_cfgdir/neomuttrc.profile-common 20 | 21 | #color sidebar_background '#51d701' '#1b002b' 22 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 23 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-personal-jj: -------------------------------------------------------------------------------- 1 | set from = 'jakub.jindra@jakubjindra.eu' 2 | set realname = $my_personal_name 3 | set my_receipt = $my_personal_receipt 4 | set signature = $my_cfgdir/signature-personal 5 | 6 | #https://web.archive.org/web/20190712111427/https://jonasjacek.github.io/colors/ 7 | set my_theme_color = '#3030FF' 8 | set my_theme_color2 = '#9999FF' 9 | set my_theme_color3 = '#6060FF' 10 | set my_textcolor = white 11 | set my_textcolor_b = $my_textcolor 12 | set my_theme_color_b = $my_theme_color 13 | 14 | unset smtp_url 15 | unset smtp_oauth_refresh_command 16 | unset smtp_authenticators 17 | set sendmail="ssh $my_jj_hostname /usr/sbin/sendmail -oem -oi" 18 | 19 | unmy_hdr Organization 20 | my_hdr Bcc: $my_personal_email_address 21 | 22 | source $my_cfgdir/neomuttrc.mailboxes 23 | source $my_cfgdir/neomuttrc.profile-common 24 | 25 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 26 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-personal: -------------------------------------------------------------------------------- 1 | set from = $my_personal_email_address 2 | set realname = $my_personal_name 3 | set my_receipt = $my_personal_receipt 4 | set signature = $my_cfgdir/signature-personal 5 | 6 | set my_theme_color = '#8701d7' 7 | set my_theme_color2 = '#ac24fe' 8 | set my_theme_color3 = '#c86dfe' 9 | set my_textcolor = '#51d701' 10 | set my_textcolor_b = $my_textcolor 11 | set my_theme_color_b = $my_theme_color 12 | 13 | reset sendmail 14 | set smtp_oauth_refresh_command = $my_personal_smtp_oauth_refresh_command 15 | set smtp_url = "smtps://$my_personal_email_address@smtp.gmail.com:465/" 16 | set smtp_authenticators = "oauthbearer" 17 | 18 | unmy_hdr Organization 19 | 20 | source $my_cfgdir/neomuttrc.mailboxes 21 | source $my_cfgdir/neomuttrc.profile-common 22 | 23 | #color sidebar_background '#51d701' '#1b002b' 24 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 25 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-work: -------------------------------------------------------------------------------- 1 | set from = $my_work_email_address 2 | set realname = $my_work_name 3 | set my_receipt = $my_work_receipt 4 | set signature = $my_cfgdir/signature-work 5 | 6 | set my_theme_color = '#FFCD67' 7 | set my_theme_color2 = '#FFB00D' 8 | set my_theme_color3 = '#DBA507' 9 | set my_theme_color_b = '#FFCD67' 10 | set my_textcolor = '#1E1E1E' 11 | set my_textcolor_b = '#3C3C3C' 12 | 13 | reset sendmail 14 | set smtp_oauth_refresh_command = $my_work_smtp_oauth_refresh_command 15 | set smtp_url = "smtps://$my_work_email_address@smtp.gmail.com:465/" 16 | set smtp_authenticators = "oauthbearer" 17 | 18 | unmy_hdr Organization 19 | my_hdr Organization: $my_work_org 20 | my_hdr Bcc: $my_personal_email_address 21 | 22 | source $my_cfgdir/neomuttrc.mailboxes 23 | source $my_cfgdir/neomuttrc.profile-common 24 | 25 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 26 | -------------------------------------------------------------------------------- /.neomutt/bin/jira.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck source=/Users/jindraj/.bash_local 4 | source "$HOME/.bash_local" 5 | 6 | function __jira_extract(){ 7 | sed -n "/$1:/ s/.*$1: //p" <<<"$msg" 8 | } 9 | 10 | function __jira_choose_action(){ 11 | local action jiraKey 12 | 13 | action="$1" 14 | jiraKey=$( __jira_extract Key) 15 | 16 | case "$action" in 17 | "open") 18 | open -n -a "Google Chrome" --args --profile-directory="Default" "$JIRA_API_BASE_URL/browse/$jiraKey" & 19 | ;; 20 | "assign") 21 | jira issue assign "$jiraKey" "$(jira me)" 22 | ;; 23 | "view") 24 | [[ -z $TMUX ]] && return 25 | jira issue view "$jiraKey" --plain --comments 10 | tmux splitw -h -p 50 -I 26 | tmux select-pane -t :1.1 27 | ;; 28 | esac 29 | } 30 | 31 | function run(){ 32 | msg=$(cat) 33 | __jira_choose_action "$@" 34 | } 35 | 36 | run "$@" &>/dev/null 37 | 38 | # vim:foldmethod=indent:foldlevel=0:tabstop=4:shiftwidth=4:softtabstop=0:noexpandtab 39 | -------------------------------------------------------------------------------- /.neomutt/bin/gitlab.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # TODO: set token vefore running glab based on the gitlab instance to make it work with multiple gitlabi instances 4 | # shellcheck source=/Users/jindraj/.bash_local 5 | source "$HOME/.bash_local" 6 | 7 | TERM=xterm-direct # to fix colors in tmux 8 | 9 | function __gitlab_choose_action(){ 10 | local GL_PROJECT_URL GL_CICD_BRANCH action=$1 11 | 12 | GL_PROJECT_URL=$(formail -I '' <<<"$msg" | awk -F '[()]' '/^Project:/ {print $2}' | tr -d ' ') 13 | GL_CICD_BRANCH=$(formail -z -x X-GitLab-Pipeline-Ref <<<"$msg") 14 | 15 | case "$action" in 16 | cicd_view) 17 | glab ci -R "$GL_PROJECT_URL" view -b "$GL_CICD_BRANCH" 18 | ;; 19 | open) 20 | glab repo view -w "$GL_PROJECT_URL" 21 | ;; 22 | esac 23 | } 24 | 25 | function run(){ 26 | msg=$(cat) 27 | __gitlab_choose_action "$@" 28 | } 29 | 30 | run "$@" #&>/dev/null 31 | 32 | # vim:foldmethod=indent:foldlevel=0:tabstop=4:shiftwidth=4:softtabstop=0:noexpandtab 33 | -------------------------------------------------------------------------------- /.slate: -------------------------------------------------------------------------------- 1 | config defaultToCurrentScreen true 2 | config nudgePercentOf screenSize 3 | config resizePercentOf screenSize 4 | 5 | # Resize and move to sector 6 | bind h:ctrl;cmd push left bar-resize:screenSizeX/2 7 | bind j:ctrl;cmd push down bar-resize:screenSizeY/2 8 | bind k:ctrl;cmd push up bar-resize:screenSizeY/2 9 | bind l:ctrl;cmd push right bar-resize:screenSizeX/2 10 | bind y:ctrl;cmd corner top-left resize:screenSizeX/2;screenSizeY/2 11 | bind p:ctrl;cmd corner top-right resize:screenSizeX/2;screenSizeY/2 12 | bind b:ctrl;cmd corner bottom-left resize:screenSizeX/2;screenSizeY/2 13 | bind .:ctrl;cmd corner bottom-right resize:screenSizeX/2;screenSizeY/2 14 | bind m:ctrl;cmd move screenOriginX;screenOriginY screenSizeX;screenSizeY 15 | 16 | # Throw Bindings 17 | bind right:ctrl;alt;cmd throw right resize 18 | bind left:ctrl;alt;cmd throw left resize 19 | bind up:ctrl;alt;cmd throw up resize 20 | bind down:ctrl;alt;cmd throw down resize 21 | 22 | bind esc:cmd hint 23 | -------------------------------------------------------------------------------- /.neomutt/bin/notmuch-post-new: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/bash 2 | 3 | function init_variables(){ 4 | QUERY=( 5 | 'tag:inbox' 6 | 'AND tag:new' 7 | 'AND tag:important' 8 | 'AND NOT query:{lists,junk}' 9 | 'AND NOT from:@linkedin.com' 10 | ) 11 | search_result=$(notmuch search --format=json "${QUERY[*]}") 12 | # get authors and subjects of messages 13 | readarray -t authors < <(jq '.[] | .authors' <<<"$search_result") 14 | #readarray -t threads < <(jq '.[] | .thread' <<<"$search_result") 15 | readarray -t subjects < <(jq '.[] | .subject' <<<"$search_result") 16 | readarray -t dates < <(jq '.[] | .timestamp|todate' <<<"$search_result") 17 | } 18 | 19 | function run(){ 20 | init_variables 21 | # iterate over array of messages defined by ${QUERY[@]} 22 | for i in "${!authors[@]}" 23 | do 24 | terminal-notifier -title "${authors[i]}" -subtitle "${dates[i]}" -message "${subjects[i]}" -contentImage "$HOME/.neomutt/bin/common/mutt-64x64.png" 25 | sleep 0.3 26 | done 27 | notmuch tag -new -- tag:new 28 | } 29 | 30 | run &>/dev/null 31 | 32 | # vim:foldmethod=indent:foldlevel=0:tabstop=4:shiftwidth=4:softtabstop=0:noexpandtab 33 | -------------------------------------------------------------------------------- /.neomutt/mailcap: -------------------------------------------------------------------------------- 1 | #text/html; elinks %s ; nametemplate=%s.html; needsterminal 2 | #text/html; elinks -config-file neomutt.conf -dump -dump-width ${COLUMNS:-80} -dump-charset utf-8 -eval "set document.codepage.assume = %{charset}" %s; nametemplate=%s.html; copiousoutput 3 | #text/html; pandoc -s -r html+raw_html-native_divs-native_spans-line_blocks -w plain --reference-links; nametemplate=%s.html; copiousoutput 4 | text/html; lynx -dump -display_charset=utf-8 -assume_local_charset=%{charset} -assume_charset=%{charset} -width=$COLUMNS %s; nametemplate=%s.html; copiousoutput 5 | application/x-pkcs7-signature; openssl pkcs7 -in %s -inform der -noout -print_certs -text | less; copiousoutput 6 | application/pkcs7-signature; openssl pkcs7 -in %s -inform der -noout -print_certs -text | less; copiousoutput 7 | text/csv; pspg %s; nametemplate=%s.csv; needsterminal 8 | text/csv; head %s; nametemplate=%s.csv; copiousoutput 9 | application/pdf; open %s 10 | image/png; open %s 11 | image/jpeg; open %s 12 | image/gif; open %s 13 | application/ics; $HOME/.neomutt/bin/ical2rem.sh 14 | text/calendar; $HOME/.neomutt/bin/ical2rem.sh 15 | application/zip; unzip -l %s; copiousoutput 16 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Jakub Jindra 3 | email = jakub.jindra@socialbakers.com 4 | signingkey = 390A9AE3 5 | 6 | [includeIf "gitdir:~/cklb/"] 7 | path = ~/cklb/.gitconfig 8 | 9 | [instaweb] 10 | local = true 11 | httpd = python 12 | 13 | [alias] 14 | tree = log --graph --decorate --abbrev-commit 15 | ign = ls-files -o -i --exclude-standard 16 | st = status 17 | ci = commit 18 | br = branch 19 | co = checkout 20 | dt = difftool 21 | pullr = pull --rebase 22 | 23 | [color] 24 | grep = auto 25 | branch = auto 26 | diff = auto 27 | status = auto 28 | 29 | [color "branch"] 30 | current = yellow reverse 31 | local = yellow 32 | remote = green 33 | 34 | [color "diff"] 35 | meta = yellow bold 36 | frag = magenta bold 37 | old = red bold 38 | new = green bold 39 | 40 | [color "status"] 41 | added = yellow 42 | changed = green 43 | 44 | [core] 45 | pager = $PAGER --passthrough 46 | 47 | [diff] 48 | tool = vimpager 49 | 50 | [difftool] 51 | tool = vimpager 52 | prompt = false 53 | 54 | [merge] 55 | tool = vimpager 56 | 57 | [push] 58 | default = current 59 | 60 | [diff "gpg"] 61 | textconv = gpg --no-tty --decrypt 62 | 63 | [protocol] 64 | version = 2 65 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.sidebar: -------------------------------------------------------------------------------- 1 | # sidebar settings 2 | set sidebar_visible = yes 3 | set sidebar_short_path = yes 4 | #set sidebar_folder_indent = yes 5 | set sidebar_width = 43 6 | set sidebar_format = "%D%?F? [%F🚩]?%* %?N?%N/?%S" 7 | set sidebar_divider_char = "┃" 8 | set sidebar_delim_chars = "/" 9 | set sidebar_non_empty_mailbox_only = yes 10 | 11 | sidebar_whitelist GMail 12 | 13 | # sidebar bindings 14 | unbind attach,browser,compose,index,generic,pager , 15 | bind index,browser,generic,pager ,. sidebar-toggle-visible 16 | bind index,pager \CP sidebar-prev 17 | bind index,pager sidebar-prev 18 | bind index,pager \CN sidebar-next 19 | bind index,pager sidebar-next 20 | bind index,pager \CK sidebar-open 21 | bind index,pager sidebar-open 22 | bind index,browser,generic,pager } sidebar-page-down 23 | bind index,browser,generic,pager { sidebar-page-up 24 | macro index,browser,generic,pager \ 25 | "" \ 26 | "open next mailbox with an unread message" 27 | 28 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 29 | -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export LANG='en_US.UTF-8' 3 | export LC_COLLATE='en_US.UTF-8' 4 | export LC_CTYPE='en_US.UTF-8' 5 | export LC_MESSAGES='en_US.UTF-8' 6 | export LC_MONETARY='en_US.UTF-8' 7 | export LC_NUMERIC='en_US.UTF-8' 8 | export LC_TIME='C' 9 | 10 | export PROMPT_COMMAND=' 11 | printf "\e]0;${USER}@${HOSTNAME%%.*}: ${PWD/$HOME/\~}\a" 12 | printf "\e]6;1;bg;red;brightness;255\a" 13 | printf "\e]6;1;bg;green;brightness;255\a" 14 | printf "\e]6;1;bg;blue;brightness;255\a" 15 | ' 16 | 17 | # shellcheck source=.bashrc 18 | [[ -s $HOME/.bashrc ]] && source "$HOME/.bashrc" 19 | 20 | if [[ -e "${HOME}/.iterm2_shell_integration.bash" ]] 21 | then 22 | # shellcheck source=.iterm2_shell_integration.bash 23 | source "${HOME}/.iterm2_shell_integration.bash" 24 | export -f __bp_precmd_invoke_cmd \ 25 | __bp_interactive_mode \ 26 | __iterm2_prompt_command \ 27 | __bp_set_ret_value \ 28 | __iterm2_preexec \ 29 | iterm2_print_state_data \ 30 | iterm2_prompt_mark \ 31 | iterm2_prompt_prefix \ 32 | iterm2_prompt_suffix \ 33 | iterm2_begin_osc \ 34 | iterm2_end_osc \ 35 | iterm2_print_user_vars 36 | fi 37 | 38 | ulimit -n 4096 39 | ulimit -Hn 4096 40 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.hooks: -------------------------------------------------------------------------------- 1 | # reset message-hooks for all messages 2 | message-hook "~A" "unalternative_order *; alternative_order text/enriched text/plain text/html" 3 | message-hook "%f bsfl" "unalternative_order *; alternative_order text/html text/plain" 4 | message-hook "%f fs" "unalternative_order *; alternative_order text/html text/plain" 5 | message-hook "~f @linkedin.com" "unalternative_order *; alternative_order text/html text/plain" 6 | 7 | # dkim/spf/dmarc 2 8 | message-hook ~A 'ignore authentication-results' 9 | message-hook '~h "^Authentication-Results: .*(dkim|spf|dmarc)=fail"' 'unignore authentication-results' 10 | 11 | # folder hooks 12 | # zero inbox notification in status bar 13 | folder-hook . "set my_zero_inbox=''; source $my_cfgdir/neomuttrc.profile-common" 14 | folder-hook INBOX "set my_zero_inbox='Yay empty mailbox 🎉'; source $my_cfgdir/neomuttrc.profile-common" 15 | 16 | # use different mailcap for a personal/work mail 17 | message-hook "~A" "set mailcap_path = $my_cfgdir/mailcap_personal:$my_cfgdir/mailcap" 18 | message-hook "%C work" "set mailcap_path = $my_cfgdir/mailcap_work:$my_cfgdir/mailcap" 19 | 20 | #timeout-hook check-stats # bells during startup 21 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 22 | -------------------------------------------------------------------------------- /.vim/syntax/known_hosts.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " 3 | " Language: OpenSSH known_hosts (known_hosts) 4 | " Author: Camille Moncelier 5 | " Copyright: Copyright (C) 2010 Camille Moncelier 6 | " Licence: You may redistribute this under the same terms as Vim itself 7 | " 8 | " This sets up the syntax highlighting for known_host file 9 | 10 | " Setup 11 | if version >= 600 12 | if exists("b:current_syntax") 13 | finish 14 | endif 15 | else 16 | syntax clear 17 | endif 18 | 19 | if version >= 600 20 | setlocal iskeyword=_,-,a-z,A-Z,48-57 21 | else 22 | set iskeyword=_,-,a-z,A-Z,48-57 23 | endif 24 | 25 | syn case ignore 26 | 27 | syn keyword knownHostsKeyword ssh-rsa ssh-dsa 28 | syn match knownHostsHost "^[^ ]\+" 29 | syn match knownHostsKey "[^ ]\+$" 30 | 31 | " Define the default highlighting 32 | if version >= 508 || !exists("did_known_hosts_syntax_inits") 33 | if version < 508 34 | let did_sshconfig_syntax_inits = 1 35 | command -nargs=+ HiLink hi link 36 | else 37 | command -nargs=+ HiLink hi def link 38 | endif 39 | 40 | HiLink knownHostsKeyword Keyword 41 | HiLink knownHostsHost Identifier 42 | HiLink knownHostsKey String 43 | 44 | delcommand HiLink 45 | endif 46 | 47 | let b:current_syntax = "known_hosts" 48 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-personal-cockli: -------------------------------------------------------------------------------- 1 | set from = $my_cockli_address 2 | set realname = $my_personal_name 3 | set my_receipt = $my_personal_receipt 4 | set signature = "$my_cfgdir/signature-personal" 5 | 6 | set my_theme_color = '#909090' 7 | set my_theme_color2 = '#ac24fe' 8 | set my_theme_color3 = '#c86dfe' 9 | set my_textcolor = '#000000' 10 | set my_textcolor_b = $my_textcolor 11 | set my_theme_color_b = $my_theme_color 12 | 13 | reset sendmail 14 | reset smtp_authenticators 15 | reset smtp_oauth_refresh_command 16 | unmy_hdr Organization 17 | my_hdr Bcc: $my_personal_email_address 18 | 19 | set imap_user = $my_cockli_address 20 | set smtp_user = $my_cockli_address 21 | set imap_pass = `gopass personal/mail/$my_cockli_hostname/$my_cockli_address password` 22 | set smtp_pass = $imap_pass 23 | set smtp_url = "smtp://$my_cockli_hostname:587" 24 | 25 | set spool_file = "imap://$my_cockli_hostname:143/" 26 | set folder = $spool_file 27 | set postponed = '+Drafts' 28 | set record = '+Sent' 29 | set trash = '+Trash' 30 | 31 | set sidebar_non_empty_mailbox_only = no 32 | #set imap_check_subscribed 33 | #set imap_list_subscribed 34 | named-mailboxes Cock.li/INBOX + 35 | named-mailboxes Cock.li/Sent +Sent 36 | named-mailboxes Cock.li/Trash +Trash 37 | named-mailboxes Cock.li/Junk +Junk 38 | 39 | source "$my_cfgdir/neomuttrc.profile-common" 40 | -------------------------------------------------------------------------------- /.neomutt/bin/sync.d/sync_github: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # deps: [ notmuch, gh, parallel, awk ] 3 | # 4 | # required notmuch config: 5 | # [query] 6 | # gitlab_com=from:gitlab@mg.gitlab.com 7 | # github=from:notifications@github.com 8 | 9 | function get_projects_and_ids(){ 10 | notmuch search --output=messages "is:inbox AND query:github AND (query:github_is_pr OR query:github_is_issue)" \ 11 | | awk -F '[@/]' -v OFS='/' '{gsub(/^id:/,""); print $1,$2" "$3" "$4|"sort -u"}' 12 | } 13 | 14 | function prepare_notmuch_batch_tag(){ 15 | local repo_path issue_or_pr_id type status 16 | read -r repo_path type issue_or_pr_id 17 | 18 | [[ $type == pull ]] && status=$(gh pr view "$issue_or_pr_id" --repo "$repo_path" --json state -q '.state') 19 | [[ $type =~ issue ]] && status=$(gh issue view "$issue_or_pr_id" --repo "$repo_path" --json state -q '.state') 20 | 21 | printf 1>&2 '[D] Getting info about %-7s https://github.com/%s/%s/%s\n' "$type:" "$repo_path" "$type" "$issue_or_pr_id" 22 | if [[ $status == "CLOSED" || $status == "MERGED" ]] 23 | then 24 | printf 1>&2 '[I] Archiving https://github.com/%s/%s/%s\n' "$repo_path" "$type" "$issue_or_pr_id" 25 | printf '%s -- mid:/%s/%s/%s/\n' -inbox "$repo_path" "$type" "$issue_or_pr_id" 26 | fi 27 | } 28 | 29 | export -f prepare_notmuch_batch_tag 30 | 31 | function run(){ 32 | # shellcheck source=/Users/jindraj/.bash_local 33 | source "$HOME/.bash_local" 34 | 35 | get_projects_and_ids \ 36 | | parallel -P "$(nproc)" -N1 --pipe prepare_notmuch_batch_tag \ 37 | | notmuch tag --batch 38 | } 39 | 40 | run "$@" 41 | -------------------------------------------------------------------------------- /.xmobarrc: -------------------------------------------------------------------------------- 1 | Config { font = "-misc-fixed-*-*-*-*-13-*-*-*-*-*-*-*" 2 | , bgColor = "black" 3 | , fgColor = "white" 4 | , position = BottomW L 95 5 | , commands = [ Run Network "br0" ["-L","0","-H","32","--normal","green","--high","red","-w","4"] 10 6 | , Run Network "wlp14s0" ["-L","0","-H","32","--normal","green","--high","red","-w","4"] 10 7 | , Run Cpu ["-t","C:%","-L","15","-H","50","--normal","green","--high","red","-w","3"] 10 8 | , Run MultiCpu ["-t","%%","-L","30","-H","60","-h","#FFB6B0","-l","#CEFFAC","-n","#FFFFCC","-w","3"] 10 9 | , Run CoreTemp ["-t", "T: C:C","-L", "40", "-H", "60","-l", "lightblue", "-n", "gray90", "-h", "red"] 50 10 | , Run Memory ["-t","M: //:"] 10 11 | , Run Swap ["-t","S%"] 10 12 | , Run Date "%a %Y-%m-%d %H:%M:%S" "date" 10 13 | , Run Battery ["-t","B: %","-L","10","-H","80","--","-O","On ","-o","Off","-l","red","-m","yellow","-h","green","-p","blue","-f","/sys/class/power_supply/ACAD/online"] 10 14 | , Run CpuFreq ["-t","Freq:\|\GHz","-L","0","-H","2","-l","lightblue","-n","white","-h","red"] 10 15 | , Run StdinReader 16 | ] 17 | , sepChar = "%" 18 | , alignSep = "}{" 19 | , template = "%StdinReader%}{|%date% |%battery% |%cpu%%multicpu% |%coretemp% |%memory% %swap% |%br0% |%wlp14s0%|" 20 | } 21 | -------------------------------------------------------------------------------- /.neomutt/bin/sidecar_router.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | function check(){ 5 | if [[ -z "$TMUX" ]] 6 | then 7 | clear 8 | echo -e "neomutt isn't running in tmux…\nexiting" 9 | exit 1 10 | fi 11 | } 12 | 13 | function init(){ 14 | my_bindir="$(dirname $0)" 15 | action_scripts=( 16 | #"$my_bindir/sidecar/freshservice_tasks.sh" 17 | "$my_bindir/sidecar/ldap.sh" 18 | "$my_bindir/sidecar/onelogin.sh" 19 | ) 20 | } 21 | 22 | function parse(){ 23 | from=$(formail -x From: -z <<<"$msg") 24 | subject=$(formail -x Subject: -z <<<"$msg") 25 | } 26 | 27 | # keeping freshservice only as an example 28 | function guess(){ 29 | case $subject in 30 | "Task Assigned to Agent") 31 | guess=$my_bindir/sidecar/freshservice_tasks.sh 32 | return 33 | ;; 34 | "Task Closed") 35 | guess=$my_bindir/sidecar/freshservice_tasks.sh 36 | return 37 | ;; 38 | esac 39 | } 40 | 41 | function choose_action(){ 42 | # select first pane (neomutt) 43 | tmux select-pane -t :1.1 44 | # split plane 45 | # run choose or guess based on guess() 46 | # tail pipe into less 47 | # wait for keypress before exiting 48 | tmux splitw -h -p 30 " 49 | action_script=$(printf '%s\n' ${action_scripts[*]}|fzf --query=$guess --select-1) 50 | \$action_script <<<\"$msg\" | \ 51 | tail -F -n +1 | \ 52 | less -R 53 | sleep 10 54 | read 55 | " 56 | # select neomutt pane - may become optional 57 | tmux select-pane -t :1.1 58 | } 59 | 60 | function main(){ 61 | msg=$(+ GMail | 3 | +-------------+ +-------+ 4 | ^ ^ ^ 5 | | | | 6 | | | | 7 | | | | 8 | v v | 9 | +---------+ +---------+ | 10 | | notmuch | | Maildir | | 11 | +---------+ +---------+ | 12 | | | | 13 | +------------+ | 14 | | | 15 | v | 16 | +-------------------------+ SMTP | 17 | | NeoMutt +----------+ 18 | +-------------------------+ 19 | 20 | 21 | 22 | 23 | -------------- 24 | Cron -> sync +-> lieer (archive) ------> post sync +-> [0]`notmuch tag --batch` to set tags 25 | | 26 | +-> [1]`notmuch new` to trigger notmuch post-new hook 27 | | 28 | +-> [2]freshservice # sunsets soon 29 | -------------- 30 | 31 | [0] query notmuch database, tag -- new ^ !tag -- query 32 | sets new tags similar to gmail filters do 33 | [1] query notmuch database, filter inbox ^ important v junk (trash,maillists,newletters,spam,linkedin) 34 | use terminal-notifier to notify about those messages 35 | graph new,new in inbox,notified 36 | [2] script for archiving and tagging ticketing messages # sunsets soon 37 | archives emails related to tickets which were resolved,closed,deleted,marked as spam 38 | tags emails with usernames according to who are tickets assigned 39 | tags emails with due/frdue whether related ticket is escalated or first-response escalated 40 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.myvars: -------------------------------------------------------------------------------- 1 | # my variables related to accounts 2 | set my_personal_email_address = 'PLACEHOLDER' 3 | set my_personal_name = 'Jakub Jindra' 4 | set my_personal_receipt = 'PLACEHOLDER+receipts@PLACEHOLDER' 5 | set my_personal_smtp_oauth_refresh_command = "curl -s https://accounts.google.com/o/oauth2/token \ 6 | -d 'grant_type=refresh_token' \ 7 | `gopass personal/mail/google.com/$my_personal_email_address \ 8 | | sed -n '/neomutt_/s/neomutt_//p' \ 9 | | yq e '. | to_entries | map(\"-d \" + .key + \"=\" + .value) | join(\" \")' \ 10 | ` | jq -r .access_token" 11 | 12 | set my_jj_email_address = 'PLACEHOLDER' 13 | set my_jj_name = $my_personal_name 14 | set my_jj_receipt = $my_personal_receipt 15 | set my_jj_hostname = 'placeholder.exmaple.com' 16 | 17 | set my_work_email_address = 'PLACEHOLDER' 18 | set my_work_name = $my_personal_name 19 | set my_work_receipt = 'PLACEHOLDER+receipts@PLACEHOLDER' 20 | set my_work_org = 'Cookielab' 21 | set my_work_smtp_oauth_refresh_command = "curl -s https://accounts.google.com/o/oauth2/token \ 22 | -d 'grant_type=refresh_token' \ 23 | `gopass cklb/google.com-$my_work_email_address \ 24 | | sed -n '/neomutt_/s/neomutt_//p' \ 25 | | yq e '. | to_entries | map(\"-d \" + .key + \"=\" + .value) | join(\" \")' \ 26 | ` | jq -r .access_token" 27 | 28 | set my_cockli_address = 'PLACEHOLDER' 29 | set my_cockli_hostname = 'mail.cock.li' 30 | 31 | # other my variables 32 | set my_pipe_decode = no 33 | set my_pager_index_lines = 10 34 | 35 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 36 | -------------------------------------------------------------------------------- /.neomutt/bin/sync.d/sync: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/bash 2 | PATH=/bin:$HOME/bin:/usr/bin:$HOME/.neomutt/bin:/usr/local/bin 3 | PATH=/opt/homebrew/bin:$PATH 4 | GMI_DIR=$HOME/.mail/gmail 5 | export PYTHONPATH=/usr/local/lib/python3.11/site-packages/ 6 | 7 | function __is_interactive(){ 8 | tty &> /dev/null 9 | } 10 | 11 | outputfile=/dev/null 12 | __is_interactive && outputfile=/dev/stdout 13 | 14 | function __msg(){ 15 | printf '\e[033m%s%s\e[0m' "$(date '+%FT%R ')" "$@" 16 | } 17 | 18 | function __msgnl(){ 19 | printf '\e[033m%s%s\e[0m\n' "$(date '+%FT%R ')" "$@" 20 | } 21 | 22 | function __check_connectivity(){ 23 | __msg '[I] Checking connectivity' 24 | if ! /sbin/ping -W 1 -c 1 www.googleapis.com &> /dev/null 25 | then 26 | printf " ❌\n" 27 | exit 0 28 | fi 29 | printf " ✅\n" 30 | } 31 | 32 | function __sync_archive(){ 33 | umask 066 34 | __msgnl '[I] Pulling changes form GMail API' 35 | timeout 600 gmi pull -C "$GMI_DIR" && date +%R > /tmp/neomutt_latest_sync # don't write into the file, just touch it 36 | 37 | __msgnl '[I] Running pre notify tag changes' 38 | notmuch tag --input="$HOME/.neomutt/bin/sync.d/sync_prenotify_tags" 39 | 40 | __post_sync 41 | 42 | __msgnl '[I] Pushing changes to GMail API' 43 | timeout 600 gmi push -C "$GMI_DIR" 44 | } 45 | 46 | # post sync actions run notifications + statictics and archive closed tickets 47 | function __post_sync(){ 48 | __msgnl '[I] Notify new messages' 49 | notmuch new --quiet 2> /dev/null 50 | 51 | __msgnl '[I] Running Jira post sync hook' 52 | "$(dirname "$0")/sync_jira" & 53 | __is_interactive && wait 54 | 55 | __msgnl '[I] Running GitHub post sync hook' 56 | "$(dirname "$0")/sync_github" & 57 | __is_interactive && wait 58 | 59 | __msgnl '[I] Running GitLab post sync hook' 60 | "$(dirname "$0")/sync_gitlab" & 61 | __is_interactive && wait 62 | } 63 | 64 | function run(){ 65 | __msgnl '[I] Running sync' 66 | __check_connectivity 67 | __sync_archive 68 | printf '\n' 69 | } 70 | 71 | run &>>"$outputfile" 72 | 73 | # vim:foldmethod=indent:foldlevel=1:tabstop=4:shiftwidth=4:softtabstop=0:noexpandtab 74 | -------------------------------------------------------------------------------- /.neomutt/bin/sync.d/sync_jira: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # deps: [notmuch, jira bashlibs (custom set of scripts), sed, sort] 4 | 5 | # env variables: 6 | # - JIRA_API_BASE_URL_jiradomain_atlassian_net 7 | # - JIRA_API_USER_jiradomain_atlassian_net 8 | # - JIRA_API_TOKEN_jiradomain_atlassian_net 9 | 10 | # shellcheck source=/Users/jindraj/.bash_local 11 | source "$HOME/.bash_local" 12 | 13 | jira_display_names=( 14 | 'Jakub Jindra' 15 | ) 16 | 17 | notmuch_tags=( 18 | 'jindraj' 19 | ) 20 | 21 | function __nmTagBatchInput(){ 22 | local key tag=$1 23 | while read -r key 24 | do 25 | [[ $tag == "+done" ]] && printf 1>&2 '[I] Archiving %s\n' "$key" 26 | printf '%s -- %s\n' "$tag" "${nmQuery[*]} AND subject:$key" 27 | done 28 | } 29 | 30 | function __nmGetJiraKeys(){ 31 | notmuch show "${nmQuery[@]}" \ 32 | | sed -n '/^> *Key: /s/^> *Key: //p' \ 33 | | sort -u 34 | } 35 | 36 | function run(){ 37 | nmQuery=( 'is:inbox' AND 'query:ticketing_jira' AND "from:$from") 38 | jiraKeys=$(__nmGetJiraKeys | xargs | tr ' ' ',') # teoreticky se muzu zbavit xargs a upravit `tr ' ' ','` na `tr '\n' ','` 39 | # nebo jeste lepe `paste -sd ',' -` 40 | [[ -z $jiraKeys ]] && return 41 | 42 | jira_domain=${from/jira@/} 43 | jira_api_base_url="JIRA_API_BASE_URL_${jira_domain//./_}" JIRA_API_BASE_URL=${!jira_api_base_url} 44 | jira_api_user="JIRA_API_USER_${jira_domain//./_}" JIRA_API_USER=${!jira_api_user} 45 | jira_api_token="JIRA_API_TOKEN_${jira_domain//./_}" JIRA_API_TOKEN=${!jira_api_token} 46 | 47 | # shellcheck disable=SC2046 48 | printf 1>&2 "[D] Getting info about keys: $JIRA_API_BASE_URL/browse/%s\n" $(__nmGetJiraKeys) 49 | 50 | jiraResponse=$(__jiraGet "/rest/api/latest/search?fields=assignee,status&jql=key%20in%20($jiraKeys)") 51 | 52 | # shellcheck disable=SC2068 53 | for index in ${!jira_display_names[@]} 54 | do 55 | __nmTagBatchInput "+${notmuch_tags[index]}" < <(jq -r '.issues[]|select(.fields.assignee.displayName=="'"${jira_display_names[index]}"'")|.key' <<<"$jiraResponse") 56 | done 57 | __nmTagBatchInput '+done' < <(jq -r '.issues[]|select(.fields.status.name=="Done").key' <<<"$jiraResponse") 58 | __nmTagBatchInput '-inbox' < <(jq -r '.issues[]|select(.fields.status.name=="Done").key' <<<"$jiraResponse") 59 | } 60 | 61 | for from in jira@{cookielab,mailstep}.atlassian.net 62 | do 63 | run "$@" | notmuch tag --batch 64 | done 65 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-common.new: -------------------------------------------------------------------------------- 1 | unmy_hdr Disposition-Notification-To 2 | my_hdr Disposition-Notification-To: Receipt <$my_receipt> 3 | 4 | # construct my_range_from for status bar when window search is enabled 5 | lua if mutt.get("nm_query_window_duration") > 0 then\ 6 | mutt.set("my_range_from",\ 7 | " " ..\ 8 | mutt.get("nm_query_window_current_position") * mutt.get("nm_query_window_duration")\ 9 | .. ".." ..\ 10 | (mutt.get("nm_query_window_current_position") + 1) * mutt.get("nm_query_window_duration")\ 11 | .. " " ..\ 12 | mutt.get("nm_query_window_timebase")\ 13 | .. " old "\ 14 | )\ 15 | else \ 16 | mutt.set("my_range_from","")\ 17 | end 18 | 19 | # profile colors 20 | color sidebar_indicator $my_textcolor_b $my_theme_color 21 | color sidebar_divider $my_theme_color default 22 | color sidebar_spool_file bold $my_theme_color2 default 23 | color sidebar_highlight $my_theme_color3 default 24 | color sidebar_unread bold default default 25 | color search $my_theme_color_b $my_textcolor 26 | color message $my_textcolor $my_theme_color 27 | color options italic $my_theme_color $my_textcolor 28 | color progress $my_textcolor_b $my_theme_color 29 | color prompt $my_theme_color $my_textcolor 30 | 31 | color status $my_textcolor default # default status bar color 32 | color status bold $my_theme_color_b $C_THEME2 '^([^]*)' 1 # most left white bg 33 | color status '#000000' $C_THEME1 '([^]*)' 1 # rest of the left 34 | color status '#000000' $C_THEME1 '⁠.*' # most right part 35 | color status $C_THEME1 default '[[:space:]]*' # middle "invisible :D" 36 | 37 | # source formats to refill variables 38 | set status_format = " %r %D %%m & ${my_zero_inbox}>%%%%%%%l>%  %> ⁠$from ${my_range_from} %P " 39 | set compose_format = " Compose  💾 ~%l  📎 %a  %> ⁠$from " 40 | set pager_format = " %C  %[%H:%M]  %F <%a>  %s %* ⁠%c  %P " # ${message-nr} ${time} ${sender} <${address}> ${subject} ${message-size} 41 | push "" # to get rid of artifacts 42 | 43 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 44 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-common.bak: -------------------------------------------------------------------------------- 1 | unmy_hdr Disposition-Notification-To 2 | my_hdr Disposition-Notification-To: Receipt <$my_receipt> 3 | 4 | # construct my_range_from for status bar when window search is enabled 5 | lua if mutt.get("nm_query_window_duration") > 0 then\ 6 | mutt.set("my_range_from",\ 7 | " " ..\ 8 | mutt.get("nm_query_window_current_position") * mutt.get("nm_query_window_duration")\ 9 | .. ".." ..\ 10 | (mutt.get("nm_query_window_current_position") + 1) * mutt.get("nm_query_window_duration")\ 11 | .. " " ..\ 12 | mutt.get("nm_query_window_timebase")\ 13 | .. " old "\ 14 | )\ 15 | else \ 16 | mutt.set("my_range_from","")\ 17 | end 18 | 19 | # profile colors 20 | color sidebar_indicator $my_textcolor_b $my_theme_color 21 | color sidebar_divider $my_theme_color default 22 | color sidebar_spool_file bold $my_theme_color2 default 23 | color sidebar_highlight $my_theme_color3 default 24 | color sidebar_unread bold default default 25 | color search $my_theme_color_b $my_textcolor 26 | color message $my_textcolor $my_theme_color 27 | color options italic $my_theme_color $my_textcolor 28 | color progress $my_textcolor_b $my_theme_color 29 | color prompt $my_theme_color $my_textcolor 30 | 31 | color status $my_textcolor default # default status bar color 32 | color status bold $my_theme_color_b $my_textcolor '^([^]*)' 1 # most left white bg 33 | color status $my_textcolor $my_theme_color '([^]*)' 1 # rest of the left 34 | color status $my_textcolor $my_theme_color '⁠.*' # most right part 35 | color status $my_theme_color default '[[:space:]]*' # middle "invisible :D" 36 | 37 | # source formats to refill variables 38 | set status_format = " %r %D %%m & ${my_zero_inbox}>%%%%%%%l>%  %> ⁠$from ${my_range_from} %P " 39 | set compose_format = " Compose  💾 ~%l  📎 %a  %> ⁠$from " 40 | set pager_format = " %C  %[%H:%M]  %F <%a>  %s %* ⁠%c  %P " # ${message-nr} ${time} ${sender} <${address}> ${subject} ${message-size} 41 | push "" # to get rid of artifacts 42 | 43 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 44 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.profile-common: -------------------------------------------------------------------------------- 1 | unmy_hdr Disposition-Notification-To 2 | my_hdr Disposition-Notification-To: Receipt <$my_receipt> 3 | 4 | # construct my_range_from for status bar when window search is enabled 5 | lua if mutt.get("nm_query_window_duration") > 0 then\ 6 | mutt.set("my_range_from",\ 7 | " " ..\ 8 | mutt.get("nm_query_window_current_position") * mutt.get("nm_query_window_duration")\ 9 | .. ".." ..\ 10 | (mutt.get("nm_query_window_current_position") + 1) * mutt.get("nm_query_window_duration")\ 11 | .. " " ..\ 12 | mutt.get("nm_query_window_timebase")\ 13 | .. " old "\ 14 | )\ 15 | else \ 16 | mutt.set("my_range_from","")\ 17 | end 18 | 19 | # profile colors 20 | color sidebar_indicator $my_textcolor_b $my_theme_color 21 | color sidebar_divider $my_theme_color default 22 | color sidebar_spool_file bold $my_theme_color2 default 23 | color sidebar_highlight $my_theme_color3 default 24 | color sidebar_unread bold default default 25 | color search $my_theme_color_b $my_textcolor 26 | color message $my_textcolor $my_theme_color 27 | color options italic $my_theme_color $my_textcolor 28 | color progress $my_textcolor_b $my_theme_color 29 | color prompt $my_theme_color $my_textcolor 30 | 31 | color status $my_textcolor default # default status bar color 32 | color status bold $my_theme_color_b $my_textcolor '^([^]*)' 1 # most left white bg 33 | color status $my_textcolor $my_theme_color '([^]*)' 1 # rest of the left 34 | color status $my_textcolor $my_theme_color ' .*' # most right part #contains NBP 35 | color status $my_theme_color default '[[:space:]]*' # middle "invisible :D" 36 | 37 | # source formats to refill variables 38 | set status_format = " %r %D %%m & ${my_zero_inbox}>%%%%%%%l>%  %>  $from ${my_range_from} %P " #contains NBSP 39 | set compose_format = " Compose  💾 ~%l  📎 %a  %>  $from " #CONTAINS NBSP 40 | set pager_format = " %C  %[%H:%M]  %F <%a>  %s %*  %c  %P " # ${message-nr} ${time} ${sender} <${address}>  ${subject}  ${message-size} NBSP%{message_size}  ${pager_progress} 41 | push "" # to get rid of artifacts 42 | 43 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 44 | -------------------------------------------------------------------------------- /.Xresources: -------------------------------------------------------------------------------- 1 | ! Defaults for all xterm clients 2 | xterm*background: black 3 | xterm*foreground: white 4 | xterm*highlightColor: darkgrey 5 | xterm*utf8: 2 6 | !XTerm*utf8Title: 1 7 | xterm*saveLines: 5000 8 | xterm*loginShell: true 9 | xterm*cursorColor: white 10 | xterm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48 11 | xterm*faceName: Deja Vu Sans Mono for Powerline 12 | xterm*faceSize: 10 13 | !xterm*termName: xterm-256color 14 | !XTerm*xftAntialias: 1 15 | 16 | ! xscreensaver --------------------------------------------------------------- 17 | !font settings 18 | xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-* 19 | xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* 20 | xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* 21 | xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* 22 | xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-* 23 | xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-12-*-*-*-*-*-*-* 24 | xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-12-*-*-*-*-*-*-* 25 | !general dialog box (affects main hostname, username, password text) 26 | xscreensaver.Dialog.foreground: #ffffff 27 | xscreensaver.Dialog.background: #111111 28 | xscreensaver.Dialog.topShadowColor: #111111 29 | xscreensaver.Dialog.bottomShadowColor: #111111 30 | xscreensaver.Dialog.Button.foreground: #666666 31 | xscreensaver.Dialog.Button.background: #ffffff 32 | !username/password input box and date text colour 33 | xscreensaver.Dialog.text.foreground: #666666 34 | xscreensaver.Dialog.text.background: #ffffff 35 | xscreensaver.Dialog.internalBorderWidth:24 36 | xscreensaver.Dialog.borderWidth: 20 37 | xscreensaver.Dialog.shadowThickness: 2 38 | !timeout bar (background is actually determined by Dialog.text.background) 39 | xscreensaver.passwd.thermometer.foreground: #ff0000 40 | xscreensaver.passwd.thermometer.background: #000000 41 | xscreensaver.passwd.thermometer.width: 8 42 | !datestamp format--see the strftime(3) manual page for details 43 | xscreensaver.dateFormat: %I:%M%P %a %b %d, %Y 44 | 45 | !------------------------------------------------------------------------------- 46 | ! xmessage 47 | !Xmessage*font: -xos4-terminus-*-*-*-*-*-*-*-*-*-*-iso8859-2 48 | Xmessage*background: #3F3F3F 49 | Xmessage*foreground: #F0DFAF 50 | Xmessage*form.*.shapeStyle: rectangle 51 | Xmessage*Scrollbar.width: 1 52 | Xmessage*Scrollbar.borderWidth: 0 53 | !Xmessage.form.message.Scroll: WhenNeeded 54 | !Xmessage*Buttons: Quit 55 | !Xmessage*defaultButton: Quit 56 | !Xmessage*geometry: +20+20 57 | 58 | !------------------------------------------------------------------------------- 59 | ! xcursor 60 | Xcursor.theme: whiteglass 61 | 62 | !Xft.dpi: 96 63 | !Xft.antialias: true 64 | !Xft.rgba: rgb 65 | !Xft.hinting: true 66 | !Xft.hintstyle: hintslight 67 | -------------------------------------------------------------------------------- /.bash_aliases: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | alias k9s='TERM=xterm k9s' 3 | alias mtr='TERM=xterm mtr' 4 | alias deluge-console='TERM=xterm deluge-console' 5 | alias calout='remind -m@2,0,0c2 -b1 -gdddd ~/.reminders/team_out.rem' 6 | alias calweek='rem -m@2,0,0cl+2 -b1 -gdddd' 7 | alias calmonth='rem -m@2,0,0cl1 -b1 -gdddd' 8 | alias kubenodes='kubectl get nodes --label-columns kubernetes.io/hostname,node.kubernetes.io/server,topology.kubernetes.io/zone,beta.kubernetes.io/instance-type --sort-by={.metadata.labels."node\.kubernetes\.io\/server"}' 9 | alias jiv='jira issues view --comments 100' 10 | alias jil='jira issues list' 11 | alias jel='jira epic list' 12 | alias bat='PAGER=cat bat' 13 | alias aman='man -a' 14 | alias bell='printf "\a"' 15 | alias bsvc='brew services' 16 | alias cd..='cd ..' 17 | alias chromekill="ps ux | grep '[C]hrome Helper (Renderer)' | grep -v extension-process | awk '{print "\$2"}'|xargs kill" 18 | alias counts='sort | uniq -c | sort -g' 19 | alias curl='curl -g -s' 20 | alias dnscc='sudo kill -HUP $(pgrep dnsmasq); sudo killall -HUP mDNSResponder; sudo dscacheutil -flushcache' 21 | alias gitcd='cd $(git rev-parse --show-toplevel)' 22 | alias focus='echo -ne "\033]50;StealFocus\a"' 23 | alias h='history' 24 | alias hgrep='history | rg' 25 | alias icloud='cd ~/Library/Mobile\ Documents/com~apple~CloudDocs/' 26 | alias k='kubectl' 27 | alias l='ls -alh' 28 | alias ldapsearch='ldapsearch -x -o ldif-wrap=no -S "" -LLL' 29 | alias ldapvi='ldapvi -D "cn=jakub jindra,ou=people,dc=socialbakers,dc=com"' #sed -n '/^BINDDN/ s/^BINDDN[[:space:]]\{1,\}//p' $HOME/.ldaprc 30 | alias lstat="stat -lt '%Y-%m-%d %X'" 31 | alias mysql='mysql -C --pager="pspg -X -F --force-uniborder"' 32 | alias nocomment="grep -Ev '^($|\s*#)'" 33 | alias nocolor="perl -pe 's/\e\[[\d;]*m//g;'" 34 | alias puppet-lint='puppet-lint --no-documentation-check' 35 | alias r='sudo -E bash -l' 36 | alias rsync='rsync -avzhPp --stats' 37 | alias se='sudo $EDITOR' 38 | alias tssh='TMUX_XPANES_PANE_BORDER_STATUS=" " TMUX_XPANES_PANE_BORDER_FORMAT="#[reverse] #T #[default]" tmux-xpanes --ssh' 39 | alias vi='vim' 40 | alias urlencode='python3 -c "import sys,urllib.parse; print(urllib.parse.quote_plus(sys.stdin.read()));"' 41 | alias urldecode='python3 -c "import sys,urllib.parse; print(urllib.parse.unquote_plus(sys.stdin.read()));"' 42 | alias qpencode='python3 -c "import sys,quopri; print(quopri.encodestring(sys.stdin.read(),quotetabs=True));"' 43 | alias qpdecode='python3 -c "import sys,quopri; print(quopri.decodestring(sys.stdin.read()));"' 44 | alias nsunique='awk '\''!mem[$0]++'\' 45 | 46 | 47 | if [[ "$OSTYPE" == "darwin"* ]]; then 48 | alias ls='ls -G --color=always' 49 | else 50 | alias ls='ls --color=auto' 51 | fi; 52 | 53 | # GRC aliases 54 | if command -v grc &> /dev/null 55 | then 56 | alias ping='grc ping' 57 | alias ping6='grc ping6' 58 | alias make='grc make' 59 | alias gcc='grc gcc' 60 | alias g++='grc g++' 61 | alias as='grc as' 62 | alias ld='grc ld' 63 | alias ldapsearch='grc ldapsearch -x -o ldif-wrap=no -S "" -LLL' 64 | fi 65 | -------------------------------------------------------------------------------- /.neomutt/lua/change_color_scheme.lua: -------------------------------------------------------------------------------- 1 | colors = { 2 | { 88, 24, 28 }, -- 3 | { 89, 29, 28 }, -- not bad 4 | { 90, 29, 100 }, -- not bad 5 | { 91, 34, 142 }, -- 6 | { 92, 40, 184 }, -- nice not bad 7 | { 93, 82, 154 }, -- 8 | { 94, 18, 30 }, -- 9 | { 95, 60, 65 }, -- 10 | { 96, 66, 101 }, -- 11 | { 97, 71, 143 }, -- 12 | { 98, 113, 185 }, -- 13 | { 99, 155, 227 }, -- nice 14 | { 100, 54, 30 }, -- 15 | { 101, 96, 66 }, -- BAD: unreadable 16 | { 103, 108, 138 }, -- 17 | { 104, 150, 174 }, -- 18 | { 105, 192, 210 }, -- nice 19 | { 106, 55, 19 }, -- 20 | { 107, 133, 61 }, -- 21 | { 108, 138, 103 }, -- 22 | { 109, 144, 139 }, -- BAD: unreadable 23 | { 110, 186, 174 }, -- 24 | { 111, 228, 210 }, -- 25 | { 112, 92, 20 }, -- not bad 26 | { 113, 170, 62 }, -- not bad 27 | { 114, 175, 104 }, -- not bad 28 | { 115, 174, 176 }, -- not bad 29 | { 116, 180, 176 }, -- 30 | { 117, 222, 210 }, -- BAD: unreadable 31 | { 118, 129, 57 }, -- 32 | { 119, 207, 135 }, -- 33 | { 120, 212, 105 }, -- not bad 34 | { 121, 211, 213 }, -- not bad 35 | { 122, 210, 213 }, -- not bad 36 | { 123, 216, 213 }, -- 37 | { 51, 202, 201 }, -- 38 | { 196, 45, 50 }, -- nice 39 | { 197, 50, 48 }, -- nice 40 | { 198, 49, 47 }, -- nice 41 | { 199, 48, 46 }, -- nice 42 | { 200, 47, 46 }, -- 43 | { 201, 47, 226 }, -- 44 | { 202, 33, 45 }, -- nice 45 | { 203, 81, 86 }, -- nice 46 | { 204, 87, 85 }, -- nice 47 | { 205, 86, 84 }, -- not bad 48 | { 206, 85, 83 }, -- not bad 49 | { 207, 84, 119 }, -- not bad 50 | { 208, 27, 39 }, -- not bad 51 | { 209, 75, 87 }, -- nice 52 | { 210, 117, 120 }, -- 53 | { 211, 123, 120 }, -- not bad 54 | { 212, 122, 120 }, -- not bad 55 | { 213, 121, 228 }, -- not bad 56 | { 214, 21, 33 }, -- 57 | { 215, 69, 81 }, -- 58 | { 216, 111, 123 }, -- 59 | { 217, 153, 157 }, -- BAD: unreadable 60 | { 218, 159, 157 }, -- 61 | { 219, 158, 229 }, -- 62 | { 220, 21, 27 }, -- 63 | { 221, 63, 75 }, -- 64 | { 222, 105, 123 }, -- not bad 65 | { 223, 147, 159 }, -- BAD: unreadable 66 | { 224, 189, 194 }, -- 67 | { 225, 195, 230 }, -- 68 | { 226, 57, 51 }, -- nice 69 | { 227, 99, 69 }, -- nice 70 | { 228, 141, 123 }, -- 71 | { 229, 183, 159 }, -- 72 | { 230, 225, 195 }, -- 73 | } 74 | 75 | current = mutt.get("my_theme_number") 76 | repeat 77 | i = math.random(#colors) 78 | until current ~= colors[i][1] 79 | 80 | mutt.set("my_theme_number", ''..colors[i][1]) 81 | mutt.set("my_theme_color","color" .. colors[i][2]) 82 | mutt.set("my_theme_color2","color" .. colors[i][3]) 83 | mutt.set("my_theme_color3","color" .. colors[i][1]) 84 | mutt.set("my_textcolor","color" .. colors[i][1]) 85 | if not mutt.get("arrow_cursor") then 86 | mutt.enter("source ~/.neomutt/toggle/neomuttrc.arrow_cursor_off") 87 | end 88 | mutt.enter("source ~/.neomutt/neomuttrc.profile-common") 89 | --mutt.enter("exec refresh;echo 'a'") 90 | --mutt.call("echo","'Color scheme: '" ..i) 91 | -------------------------------------------------------------------------------- /.inputrc: -------------------------------------------------------------------------------- 1 | set blink-matching-paren on 2 | #set colored-completion-prefix on # doesn't work??? 3 | set colored-stats on 4 | set completion-prefix-display-length 10 5 | set echo-control-characters off 6 | set skip-completed-text on 7 | #set operate-and-get-next on # repeat set of commands from history using ^C-o 8 | 9 | "\e,": menu-complete 10 | "\C-x\C-p": dabbrev-expand # complete word (used before) 11 | "\C-x\C-i": dynamic-complete-history 12 | "\C-x\C-m": print-last-kbd-macro # print macro definition 13 | "\C-x\C-f": dump-macros 14 | "\e\C-l": redraw-current-line 15 | "\e[5~": history-search-backward # type part of command, page-up to search in history backward 16 | "\e[6~": history-search-forward # type part of command, page-up to search in history forward 17 | 18 | # Applications 19 | $if bash 20 | Space: magic-space # expand short 21 | "\e\C-d": forward-backward-delete-char 22 | "\C-e\C-w": unix-filename-rubout # kill backward, stop by / and space 23 | "\C-e\C-d": "\e\C-]|\C-f\C-k" # delete to last pipe 24 | "\C-x\C-w": "\C-awhile :;do \C-e\C-e;sleep 60;done" # Wrap current line in while with 60s delay 25 | "\e\C-b": "\e\C-]/" # jump backward to / 26 | "\e\C-f": "\C-]/" # jump forward to / 27 | "\C-xq": "\eb\"\ef\"" # wrap current word in " 28 | "\e\C-m": "\C-a \C-m" # execute, no bash history - ESC-Enter 29 | #"\C-x\C-r": "\C-a#\C-mhistory | sed 'x;$!d' | cut -f 2 -d '#' | pbcopy\C-m" # comments command, executes it and then copies it from history into clipboard 30 | "\C-]": "\C-e\C-u pbcopy < 3 | alias admin Admin 4 | alias devopst DevOps Team 5 | alias airbank AirBank Šanon 6 | alias slack Slack 7 | alias doej Jane Doe 8 | alias doej2 Joe Doe 9 | 10 | # group for matching by %f in message-hooks 11 | group -group fs -rx 'PLACEHOLDER' 12 | group -group fs -addr 'PLACEHOLDER' 13 | group -group bsfl -addr 'PLACEHOLDER' 14 | group -group bsfl -addr 'PLACEHOLDER' 15 | group -group bsfl -addr 'PLACEHOLDER' 16 | 17 | # without group for reverse_alias 18 | alias fs DevOps 19 | alias fsdo Freshservice 20 | alias fsits Freshservice 21 | alias fsitops Freshservice 22 | alias fsitops Freshservice 23 | alias fstasks Freshservice Tasks 24 | alias vendr Vendr 25 | alias vendr Vendr 26 | 27 | alias tp Targetprocess 28 | alias tp Targetprocess 29 | alias offb1 Offboarding 30 | alias offb2 Offboarding 31 | alias offb3 Offboarding 32 | alias jira1 Jira - Emplifi 33 | alias jira2 Jira - Emplifi 34 | alias jira3 Jira - Cookielab 35 | alias conflu1 Confluence - Emplifi 36 | alias conflu2 Confluence - Emplifi 37 | 38 | alternates -group personal 'PLACEHOLDER' 39 | alternates -group personal 'PLACEHOLDER' 40 | alternates -group personal 'PLACEHOLDER' 41 | alternates -group personal 'PLACEHOLDER' 42 | alternates -group personal 'PLACEHOLDER' 43 | alternates -group personal 'PLACEHOLDER' 44 | alternates -group personal 'PLACEHOLDER' 45 | alternates -group family 'PLACEHOLDER' 46 | alternates -group family 'PLACEHOLDER' 47 | alternates -group work 'PLACEHOLDER' 48 | alternates -group work 'PLACEHOLDER' 49 | alternates -group work 'PLACEHOLDER' 50 | alternates -group work 'PLACEHOLDER' 51 | alternates -group work 'PLACEHOLDER' 52 | alternates -group work 'PLACEHOLDER' 53 | alternates -group other 'PLACEHOLDER' 54 | alternates -group other 'PLACEHOLDER' 55 | alternates -group other 'PLACEHOLDER' 56 | alternates -group other 'PLACEHOLDER' 57 | alternates -group local 'PLACEHOLDER' 58 | 59 | lists -group other_lists 'PLACEHOLDER' 60 | lists -group work_lists 'PLACEHOLDER' 61 | lists -group work_lists 'PLACEHOLDER' 62 | lists -group work_lists 'PLACEHOLDER' 63 | lists -group work_lists_team 'PLACEHOLDER' 64 | lists -group work_lists_team 'PLACEHOLDER' 65 | lists -group work_lists_team 'PLACEHOLDER' 66 | subscribe -group work_lists_team 'PLACEHOLDER' 67 | subscribe -group work_lists_team 'PLACEHOLDER' 68 | subscribe -group work_lists_team 'PLACEHOLDER' 69 | subscribe -group work_lists_team 'PLACEHOLDER' 70 | subscribe -group work_lists 'PLACEHOLDER' 71 | subscribe -group work_lists 'PLACEHOLDER' 72 | subscribe -group work_lists 'PLACEHOLDER' 73 | subscribe -group work_lists 'PLACEHOLDER' 74 | 75 | subscribe -group maillists 'PLACEHOLDER' 76 | subscribe -group maillists 'PLACEHOLDER' 77 | subscribe -group maillists 'PLACEHOLDER' 78 | subscribe -group maillists 'PLACEHOLDER' 79 | subscribe -group maillists 'PLACEHOLDER' 80 | subscribe -group maillists 'PLACEHOLDER' 81 | subscribe -group maillists 'PLACEHOLDER' 82 | 83 | # vim:foldmethod=marker:ft=neomuttrc 84 | -------------------------------------------------------------------------------- /.neomutt/bin/sync.d/sync_gitlab: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # deps: [ notmuch, jq, glab, parallel, sort, awk ] 3 | # 4 | # required notmuch config: 5 | # [index] 6 | # header.GitLabProjectPath=X-GitLab-Project-Path 7 | # header.GitLabIssueIID=X-GitLab-Issue-IID 8 | # header.GitLabMergeRequestIID=X-GitLab-MergeRequest-IID 9 | # header.GitLabPipelineId=X-GitLab-Pipeline-Id 10 | # [query] 11 | # gitlab_com=from:gitlab@mg.gitlab.com 12 | # gitlab_example=from:gitlab@example.com 13 | # gitlab=query:gitlab_com OR query:gitlab_example 14 | # gitlab_is_issue=GitLabIssueIID:0* OR GitLabMergeRequestIID:1* OR GitLabMergeRequestIID:2* OR GitLabMergeRequestIID:3* OR GitLabMergeRequestIID:4* OR GitLabMergeRequestIID:5* OR GitLabMergeRequestIID:6* OR GitLabMergeRequestIID:7* OR GitLabMergeRequestIID:8* OR GitLabMergeRequestIID:9* 15 | # gitlab_is_mr=GitLabMergeRequestIID:0* OR GitLabMergeRequestIID:1* OR GitLabMergeRequestIID:2* OR GitLabMergeRequestIID:3* OR GitLabMergeRequestIID:4* OR GitLabMergeRequestIID:5* OR GitLabMergeRequestIID:6* OR GitLabMergeRequestIID:7* OR GitLabMergeRequestIID:8* OR GitLabMergeRequestIID:9* 16 | # [show] 17 | # extra_headers=X-GitLab-Project-Path;X-GitLab-MergeRequest-IID;X-GitLab-Issue-IID 18 | 19 | function get_projects_ids(){ 20 | notmuch show --format=json 'is:inbox AND query:gitlab AND query:gitlab_is_mr' | jq -j '.[] | .[] | .[0].headers|"MR ",."X-GitLab-Project-Path"," ",."X-GitLab-MergeRequest-IID","\n"' 21 | notmuch show --format=json 'is:inbox AND query:gitlab AND query:gitlab_is_issue' | jq -j '.[] | .[] | .[0].headers|"ISSUE ",."X-GitLab-Project-Path"," ",."X-GitLab-Issue-IID","\n"' 22 | } 23 | 24 | function iterate_messages(){ 25 | local gl_host 26 | while read -r type project_path iid 27 | do 28 | gl_host=$(notmuch show --limit=1 "GitLabProjectPath:$project_path AND (GitLabMergeRequestIID:$iid OR GitLabIssueIID:$iid" | awk '/You\047re receiving this email because / {print $NF}' | sed 's/\.$//' | head -n1) 29 | printf '%s %s %s %s\n' "$gl_host" "$project_path" "$type" "$iid" 30 | done 31 | } 32 | 33 | function prepare_notmuch_batch_tag(){ 34 | local project_path iid status token_var pipeline_id 35 | local -x GITLAB_HOST GITLAB_TOKEN 36 | 37 | read -r GITLAB_HOST project_path type iid 38 | token_var="GL_TOKEN_${GITLAB_HOST//./_}" 39 | GITLAB_TOKEN="${!token_var}" 40 | if [[ $type == "MR" ]] 41 | then 42 | # shellcheck disable=SC2016 43 | response=$(glab api graphql -f query='query getMergeRequestPipelines($projectPath: ID!, $mergeRequestIid: String!) { project(fullPath: $projectPath) { mergeRequest(iid: $mergeRequestIid) { state pipelines { nodes { id } } } } }' -F "projectPath=$project_path" -f "mergeRequestIid=$iid") 44 | 45 | printf 1>&2 '[D] Getting info about merge request: https://%s/%s/-/merge_requests/%s\n' "$GITLAB_HOST" "$project_path" "$iid" 46 | status=$(jq -r '.data.project.mergeRequest.state' <<<"$response") 47 | if [[ $status == "closed" || $status == "merged" ]] 48 | then 49 | printf 1>&2 '[I] Archiving https://%s/%s/-/merge_requests/%s\n' "$GITLAB_HOST" "$project_path" "$iid" 50 | printf '%s -- thread:"{GitLabProjectPath:%s AND GitLabMergeRequestIID:%s}"\n' -inbox "$project_path" "$iid" # MR 51 | 52 | for pipeline_id in $(jq -r '.data.project.mergeRequest.pipelines.nodes[].id' <<<"$response" | awk -F / '{print $NF}') 53 | do 54 | printf '%s %s -- thread:"{GitLabProjectPath:%s AND GitLabPipelineId:%s}"\n' -inbox -unread "$project_path" "$pipeline_id" # PIPELINE 55 | done 56 | fi 57 | elif [[ $type == "ISSUE" ]] 58 | then 59 | # shellcheck disable=SC2016 60 | response=$(glab api graphql -f query='query getIssues($projectPath: ID!, $issueIid: String!) { project(fullPath: $projectPath) { issue(iid: $issueIid) { state } } }' -F "projectPath=$project_path" -f "issueIid=$iid") 61 | printf 1>&2 '[D] Getting info about issue: https://%s/%s/-/issues/%s\n' "$GITLAB_HOST" "$project_path" "$iid" 62 | status=$(jq -r '.data.project.issue.state' <<<"$response") 63 | if [[ $status == "closed" ]] 64 | then 65 | printf 1>&2 '[I] Archiving https://%s/%s/-/issues/%s\n' "$GITLAB_HOST" "$project_path" "$iid" 66 | set -x 67 | printf '%s -- thread:"{GitLabProjectPath:%s AND GitLabIssueIID:%s}"\n' -inbox "$project_path" "$iid" # Issue 68 | set +x 69 | fi 70 | fi 71 | } 72 | 73 | export -f prepare_notmuch_batch_tag 74 | 75 | function run(){ 76 | # shellcheck source=/Users/jindraj/.bash_local 77 | source "$HOME/.bash_local" 78 | 79 | get_projects_ids \ 80 | | iterate_messages \ 81 | | sort -u \ 82 | | parallel -P "$(nproc)" -N1 --pipe prepare_notmuch_batch_tag \ 83 | | notmuch tag --batch 84 | } 85 | 86 | run "$@" 87 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export PATH 4 | PATH="/usr/local/opt/ncurses/bin:$PATH" 5 | 6 | export MAIL_WARNING=1 7 | [[ $- != *i* ]] && return 8 | # shellcheck source=.bash_local 9 | [[ -f "$HOME/.bash_local" ]] && source "$HOME/.bash_local" 10 | # shellcheck source=.bash_aliases 11 | [[ -f "$HOME/.bash_aliases" ]] && source "$HOME/.bash_aliases" 12 | # shellcheck source=.bash_functions 13 | [[ -f "$HOME/.bash_functions" ]] && source "$HOME/.bash_functions" 14 | 15 | command -v brew &> /dev/null && BREW_PREFIX=$(brew --prefix 2>/dev/null) 16 | 17 | eval "$(direnv hook bash)" 18 | 19 | # kubectl completion bash > "$HOME/.bash_completion.d/kubectl.bash" 20 | # talosctl completion bash > "$HOME/.bash_completion.d/tallos.bash" 21 | # jira completion bash > "$HOME/.bash_completion.d/jira.bash" 22 | #curl https://raw.githubusercontent.com/notmuch/notmuch/master/completion/notmuch-completion.bash -o "$HOME/.bash_completion.d/notmuch-completion.bash 23 | source_all_files_from_dir "$BREW_PREFIX/etc/profile.d/" '*.sh' 24 | source_all_files_from_dir "$BREW_PREFIX/etc/bash_completion.d/" 25 | source_all_files_from_dir "$HOME/.bash_completion.d/" 26 | [[ -f "$BREW_PREFIX/etc/profile.d/autojump.sh" ]] && source "$BREW_PREFIX/etc/profile.d/autojump.sh" 27 | 28 | [[ -n $PS1 ]] && complete -C "$HOMEBREW_PREFIX/bin/aws_completer" aws 29 | [[ -n $PS1 ]] && complete -F _known_hosts sshmux tssh s curl odjebat nc ,sensu-agent-restart 30 | [[ -n $PS1 ]] && complete -F _gopass_bash_autocomplete totp totpc 31 | [[ -n $PS1 ]] && __wifiqr_complete 32 | complete -o default -F __start_kubectl k 33 | complete -C "$BREW_PREFIX/bin/terraform" terraform 34 | 35 | shopt -s mailwarn 36 | shopt -s checkwinsize 37 | shopt -s cdspell 38 | shopt -s autocd 39 | 40 | export LSCOLORS=ExGxFxdxCxegedhbagacec 41 | export XDG_CONFIG_HOME="$HOME/.config" 42 | 43 | # {{{ History 44 | # unlimited size of history and history file one history file per day 45 | HISTSIZE=5000 46 | HISTFILESIZE=10000 47 | shopt -s histappend 48 | HISTCONTROL=ignoreboth 49 | HISTFILE="${HOME}/.bash_history_files/$(date -u +%Y-%m-%d)" 50 | mkdir -p -m 700 "$(dirname "$HISTFILE")" 51 | ln -sf "$HISTFILE" "$HOME/.bash_history" 52 | # }}} 53 | 54 | # {{{ PROMPT CONFIGS 55 | PROMPT_DIRTRIM=2 56 | export GIT_PS1_SHOWDIRTYSTATE=true 57 | export GIT_PS1_SHOWSTASHSTATE=true 58 | export GIT_PS1_SHOWUPSTREAM=auto 59 | export GIT_PS1_SHOWCOLORHINTS=true 60 | 61 | __c1_normal='\e[1;30m' __c2_normal='\e[1;32m' __c3_normal='\e[1;34m' 62 | __c1_screen='\e[1;34m' __c2_screen='\e[1;33m' __c3_screen='\e[1;32m' 63 | __c2_root='\e[1;31m' 64 | printf -v __c_path '%b' '\e[1;34m' 65 | printf -v crst '%b' '\e[0m' 66 | case $TERM in 67 | iterm2*|xterm*|rxvt*|Eterm|aterm) 68 | __c1=$(printf '%b' "$__c1_normal") __c2=$(printf '%b' "$__c2_normal") __c3=$(printf '%b' "$__c3_normal") 69 | [[ "$UID" -eq 0 ]] && __c2=$(printf '%b' "$__c2_root") 70 | PS1='$(ec)$(nr_sessions)$(aws_session_validity)$(aws_ps1)\[$__c1\][\[$crst\] \[$__c2\]\u@\h\[$crst\] \[$__c_path\]\w\[$crst\]$(__git_ps1) \[$__c1\]]\[$crst\]\[$__c3\]\$\[$crst\] ' 71 | ;; 72 | screen*|tmux*) 73 | __c1=$(printf '%b' "$__c1_screen") __c2=$(printf '%b' "$__c2_screen") __c3=$(printf '%b' "$__c3_screen") 74 | [[ "$UID" -eq 0 ]] && __c2=$(printf '%b' "$__c2_root") 75 | PS1='$(ec)$(nr_sessions)$(aws_session_validity)$(aws_ps1)\[$__c1\][\[$crst\] \[$__c2\]\u@\h\[$crst\] \[$__c_path\]\w\[$crst\]$(__git_ps1) \[$__c1\]]\[$crst\]\[$__c3\]\$\[$crst\] ' 76 | ;; 77 | *) 78 | PS1='[ \u@\h \w ]\$ ' 79 | ;; 80 | esac 81 | # }}} 82 | 83 | # EDITOR, PAGER, MANPAGER {{{ 84 | export EDITOR=vim 85 | if command -v nvim > /dev/null 86 | then 87 | EDITOR=nvim 88 | alias vim=nvim 89 | fi 90 | 91 | export SUDO_EDITOR=$EDITOR 92 | export HOMEBREW_EDITOR=$EDITOR 93 | 94 | export BAT_PAGER=cat 95 | export PAGER=less 96 | export MANPAGER=$PAGER 97 | if [[ -f $HOME/.vim/plugged/vimpager/vimpager ]] 98 | then 99 | PAGER=$HOME/.vim/plugged/vimpager/vimpager 100 | alias vimpager='$PAGER' 101 | MANPAGER="$SHELL -c \"col -b | $PAGER -c 'set ft=man nomod nolist'\"" 102 | fi 103 | # }}} 104 | 105 | # {{{ PERL - spamassassin testing 106 | PATH="$HOME/perl5/bin${PATH:+:${PATH}}"; 107 | PERL5LIB="$HOME/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; 108 | PERL_LOCAL_LIB_ROOT="$HOME/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; 109 | PERL_MB_OPT="--install_base \"$HOME/perl5\""; export PERL_MB_OPT; 110 | PERL_MM_OPT="INSTALL_BASE=$HOME/perl5"; export PERL_MM_OPT; 111 | # }}} 112 | 113 | # vim:foldmethod=marker:foldlevel=0 114 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | cfg_active=$C_THEME2 2 | cfg_inactive=$C_THEME1 3 | cbg_base=$cfg_inactive 4 | cbg_active='' 5 | cbg_inactive='' 6 | 7 | set -g prefix2 C-a # preserve tmux default C-b and add another prefix C-a 8 | bind a send-prefix -2 # to preserve some shortcut for readline C-a (C-a a) sends C-a. 9 | bind-key C-a last-window # More screen-like - switch to last window 10 | bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded" # Reload config 11 | set -g set-titles on # update terminal window title as tmux window title 12 | set -g set-titles-string "#T" # set term-window title to tmux-window title 13 | set -gs escape-time 0 # for faster switching from INSERT mode to NORMAL in vim 14 | set-option -g history-limit 10000 15 | set-option -g status-position top # show status on top, being consistent with neomutt settings + with new session/window I see what I need on top 16 | # the prompt and the status bar 17 | set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION GPG_AGENT_INFO" 18 | set -g default-terminal "tmux-direct" # force tmux TERM 19 | set-option -ga terminal-overrides ",*-direct*:Tc" # true color 20 | 21 | # general binding {{{ 22 | bind-key k confirm kill-window # Kill window 'C-a k' 23 | bind-key K confirm kill-server # Kill session 'C-a K' 24 | #}}} 25 | 26 | # Panes binding and config{{{ 27 | bind s split-window -v # split pane vertical 28 | bind v split-window -h # split pane horizontal 29 | bind b set-window-option synchronize-panes # start pane broadcast in the current window 30 | bind-key -r h select-pane -L # select left pane 31 | bind-key -r j select-pane -D # select down pane 32 | bind-key -r k select-pane -U # select up pane 33 | bind-key -r l select-pane -R # select right pane 34 | bind-key -r C-j resize-pane -D 5 # resize pane down 35 | bind-key -r C-k resize-pane -U 5 # resize pane up 36 | bind-key -r C-h resize-pane -L 5 # resize pane left 37 | bind-key -r C-l resize-pane -R 5 # resize pane right 38 | 39 | set-option -g pane-active-border-style "fg=$cfg_active,bold" # pane border color - active 40 | set-option -g pane-border-style "fg=$cfg_inactive" # pane border color - inactive 41 | 42 | set -g pane-border-status top # pane border status on top 43 | set -g pane-border-format "#[reverse] #P: #T #[none] " # display command name on the top of the pane 44 | #}}} 45 | 46 | # windows, status settings {{{ 47 | set -g window-status-format "#[fg=#000000]#[bg=$cfg_inactive] #I:#T#[fg=#ff0000]#[bold]#F#{?pane_synchronized,B,}#[fg=$cfg_inactive]#[bg=#000000]" 48 | set -g window-status-current-format "#[fg=#000000]#[bg=$cfg_active] #I:#T#[fg=#ff0000]#[bold]#F#{?pane_synchronized,B,}#[fg=$cfg_active]#[bg=#000000]" 49 | set-option -g renumber-windows on # renumber windows if one is closed 50 | setw -g mode-keys vi # key bindings for copy mode 51 | setw -g pane-base-index 1 # number panes starting from 1; I'm human, not a computer 52 | setw -g base-index 1 # number panes starting from 1; I'm human, not a computer 53 | setw -g monitor-activity on # use hash as flag for recent activity in the window 54 | setw -g window-status-current-style 'fg=default,bg=default,bold' # status bar current window 55 | setw -g window-status-style 'fg=cyan,bg=default,none' # status bar other window 56 | setw -g window-status-bell-style none # status bar window bell attr 57 | setw -g window-status-activity-style none # status bar window activity attr 58 | #}}} 59 | 60 | # Status {{{ 61 | set -g status-interval 60 62 | set -g status-left-length 40 63 | set -g status-right-length 90 64 | 65 | set-option -g status-style 'fg=white,bg=#00ff00,default' # IDK what this is 66 | 67 | set -g status-left "#[bg=$cfg_inactive]#[fg=#000000]#[bold] #h  #S  #P #[nobold]#[reverse] " 68 | set -g status-right "#[bg=#000000]#[fg=$cfg_inactive]#[reverse] #(cat /tmp/neomutt_latest_sync) #(pgrep -qf gmi && /bin/echo '🔄')  #(ip addr show|grep -v 127.0.0|awk '/inet /{gsub(/\\/.*/,_,\$2);print \$2 \"  \"}'|sort -g -t .|head -n 5|tr -d '\n')#(curl --connect-timeout 5 --max-time 10 -m 2 -4 -Ns l2.io/ip) " 69 | #}}} 70 | 71 | # Mouse {{{ 72 | # Toggle mouse on with bind-key m 73 | bind m \ 74 | set -g mouse on \;\ 75 | display 'Mouse: ON' 76 | 77 | # Toggle mouse off with bind-key M 78 | bind M \ 79 | set -g mouse off \;\ 80 | display 'Mouse: OFF' 81 | #}}} 82 | 83 | # Plugins {{{ 84 | set -g @plugin 'tmux-plugins/tpm' 85 | set -g @plugin 'tmux-plugins/tmux-sidebar' 86 | run '~/.tmux/plugins/tpm/tpm' 87 | #}}} 88 | 89 | # vim:ft=conf:foldmethod=marker:foldlevel=0 90 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.colors: -------------------------------------------------------------------------------- 1 | # compose menu 2 | color compose header default default 3 | color compose security_encrypt #00FF00 default 4 | color compose security_sign #00FF00 default 5 | color compose security_both bold #00FF00 default 6 | color compose security_none bold #FF0000 default 7 | 8 | # quoted text 9 | color normal #FFFFFF default 10 | color quoted #A0A0A0 default 11 | color quoted1 #808080 default 12 | color quoted2 #606060 default 13 | color quoted3 #303030 default 14 | #color quoted… 15 | #color quoted9 #202020 default 16 | 17 | # generic objects 18 | color error bold #FF5050 default 19 | color tree bold #FF00FF default 20 | color tilde #0000FF default 21 | color attachment bold #FFFF00 default 22 | color markers bold #FF0000 default 23 | color bold bold #FFFF00 default 24 | color signature #00FFFF default 25 | 26 | # INDEX 27 | # Colors based on recipient 28 | ## default index colors 29 | ## WORK 30 | color index #007FFF default "!(%C personal | %C work | %C other) !~u" # probably bcc or forged from header 31 | 32 | color index bold #FFB00D default "%C work_lists_team" # work team lists #787a9e 33 | color index #FFB00D default "%C work_lists" # work general lists 34 | 35 | color index bold #FFCD67 default "%C work" # workincomming 36 | color index #FFCD67 default "%f work" # work outgoing 37 | ## personal 38 | color index bold #00FF00 default "%C personal" # personal incomming 39 | color index #00FF00 default "%f personal" # personal outgoing 40 | # family 41 | color index bold #EC40F5 default "%C family" # family incomming 42 | color index #EC40F5 default "%f family" # family outgoing 43 | # local 44 | color index bold #FFFFFF default "%C local" # local incomming 45 | color index #FFFFFF default "%f local" # local outgoing 46 | ## other (school, hobby, etc) 47 | color index #8760AF default "%f other | %f other_lists" # other outgoing 48 | color index bold #8760AF default "%C other | %C other_lists" # other incomming 49 | 50 | ## infomails and maillists 51 | # github to me 52 | color index bold #BFFF00 default "~C '(mention|author|assign|comment|review_requested|push)@noreply.github.com'" 53 | # ARC 54 | color index default #FFFF00 "~h '^Authentication-Results: .*(spf=fail)'" 55 | color index default #FFA500 "~h '^Authentication-Results: .*(dkim=fail)'" 56 | color index default #5E0000 "~h '^Authentication-Results: .*(dmarc=fail)'" 57 | ## default index colors 58 | #color index default #444444 "(~N | ~O ) !~T !~F !~p !~P" # to lists or bcc or unknown address not specified by alternates 59 | #color index standout default $my_theme_color "(~N | ~O ) !~T !~F !~p !~P" # to lists or bcc or unknown address not specified by alternates 60 | color index bold standout default #444444 "(~N | ~O ) !~T !~F" # ~p !~P" # To me 61 | color index #000000 #FF00FF "~T" # Tagged 62 | color index #FF0000 default "~D" # Deleted 63 | color index_flags bold #FF0000 default "~F" # Flagged 64 | 65 | # Pager 66 | ## headers 67 | set header_color_partial = yes 68 | color hdrdefault bold #00F6F6 default 69 | color header #FFFF00 default "^[[:alpha:]][^:]+:" 70 | color header bold #FFFF00 default "^(From|To|CC|Bcc|Subject):" 71 | color header bold #FF0000 default "(dkim|spf|dmarc)=fail" 72 | color header #00FF00 default "(dkim|spf|dmarc)=pass" 73 | 74 | # dkim/spf/dmarc 1 https://www.mail-archive.com/mutt-users@mutt.org/msg54074.html 75 | #unignore authentication-results 76 | #color header bold red default "(dkim|spf|dmarc)=fail" 77 | #color header green default "(dkim|spf|dmarc)=pass" 78 | # EO dkim/spf/dmarc 2 79 | 80 | # body 81 | # URLs 82 | color body bold #FFFF00 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<>\"]" 83 | 84 | # email addresses 85 | color body bold #FF00FF default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" 86 | 87 | 88 | # Signed messages 89 | color body #00FF00 default "^Good signature from:" 90 | color body bold #FFA500 default "^Problem signature from:" 91 | color body bold #FFFFFF #FF0000 "^\\*BAD\\* signature from:" 92 | 93 | color body bold #9090FF default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" # *bold* 94 | color body underline #9090FF default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" # _underline_ 95 | color body #0000FF default "( *[-+=#*~_]){6,}" #Border lines. 96 | 97 | # Custom highlights 98 | color body bold #00FF00 default "Grant access to .* for .*$" 99 | 100 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 101 | -------------------------------------------------------------------------------- /.notmuch-config: -------------------------------------------------------------------------------- 1 | # .notmuch-config - Configuration file for the notmuch mail system 2 | # 3 | # For more information about notmuch, see https://notmuchmail.org 4 | 5 | # Database configuration 6 | # 7 | # The only value supported here is 'path' which should be the top-level 8 | # directory where your mail currently exists and to where mail will be 9 | # delivered in the future. Files should be individual email messages. 10 | # Notmuch will store its database within a sub-directory of the path 11 | # configured here named ".notmuch". 12 | # 13 | 14 | [database] 15 | path=/Users/jindraj/.mail/gmail 16 | 17 | # User configuration 18 | # 19 | # Here is where you can let notmuch know how you would like to be 20 | # addressed. Valid settings are 21 | # 22 | # name Your full name. 23 | # primary_email Your primary email address. 24 | # other_email A list (separated by ';') of other email addresses 25 | # at which you receive email. 26 | # 27 | # Notmuch will use the various email addresses configured here when 28 | # formatting replies. It will avoid including your own addresses in the 29 | # recipient list of replies, and will set the From address based on the 30 | # address to which the original email was addressed. 31 | # 32 | 33 | [user] 34 | name=Jakub Jindra 35 | primary_email= 36 | other_email= 37 | 38 | # Configuration for "notmuch new" 39 | # 40 | # The following options are supported here: 41 | # 42 | # tags A list (separated by ';') of the tags that will be 43 | # added to all messages incorporated by "notmuch new". 44 | # 45 | # ignore A list (separated by ';') of file and directory names 46 | # that will not be searched for messages by "notmuch new". 47 | # 48 | # NOTE: *Every* file/directory that goes by one of those 49 | # names will be ignored, independent of its depth/location 50 | # in the mail store. 51 | # 52 | 53 | [new] 54 | tags=new 55 | #ignore=*.json;*.bak;.lock 56 | 57 | # 58 | # The following option is supported here: 59 | # 60 | # exclude_tags 61 | # A ;-separated list of tags that will be excluded from 62 | # search results by default. Using an excluded tag in a 63 | # query will override that exclusion. 64 | # 65 | 66 | 67 | [search] 68 | exclude_tags=spam;trash 69 | 70 | # Maildir compatibility configuration 71 | # 72 | # The following option is supported here: 73 | # 74 | # synchronize_flags Valid values are true and false. 75 | # 76 | # If true, then the following maildir flags (in message filenames) 77 | # will be synchronized with the corresponding notmuch tags: 78 | # 79 | # Flag Tag 80 | # ---- ------- 81 | # D draft 82 | # F flagged 83 | # P passed 84 | # R replied 85 | # S unread (added when 'S' flag is not present) 86 | # 87 | # The "notmuch new" command will notice flag changes in filenames 88 | # and update tags, while the "notmuch tag" and "notmuch restore" 89 | # commands will notice tag changes and update flags in filenames 90 | # 91 | 92 | [maildir] 93 | synchronize_flags=true 94 | 95 | # notmuch config set index.header.List List-Id 96 | # just for the record. Need to run: 97 | # `notmuch config set query.QUERYNAME NOTMUCH_QUERY` 98 | # to store query in the db 99 | [index] 100 | decrypt=true 101 | header.List=List-Id 102 | header.MSThread=Thread-Index 103 | header.XOriginalSender=X-Original-Sender 104 | header.AR=Authentication-Results 105 | header.GitLabProjectPath=X-GitLab-Project-Path 106 | header.GitLabPipelineRef=X-GitLab-Pipeline-Ref 107 | header.GitLabMergeRequestIID=X-GitLab-MergeRequest-IID 108 | header.GitLabPipelineId=X-GitLab-Pipeline-Id 109 | header.GitLabNotificationReason=X-GitLab-NotificationReason 110 | 111 | [query] 112 | junk=is:trash OR is:spam OR is:drafts OR from:@linkedin.com OR mimetype:multipart/report OR is tag:dmarc 113 | lists=tag:Newsletters OR tag:Maillists 114 | personal=NOT (query:work OR query:lists OR query:junk OR from:@cd.cz OR from:@chess.com) 115 | others=is:z_golkad OR is:z_irikm OR is:z_petakj OR is:z_hotskyo OR is:z_semyachkinay OR is:z_ververakisi OR is:z_witanekn OR is:z_gerasimovk OR is:z_martino OR is:z_brooksc OR is:z_halewoodj OR is:votocekp 116 | confluence=from:confluence@emplifi.atlassian.net OR from:confluence@astutesolutions.atlassian.net OR from:confluence@mailstep.atlassian.net 117 | cal=(mimetype:text/calendar OR mimetype:application/ics) AND NOT (from:@cd.cz) 118 | ar_fail=AR:" spf=fail " OR AR:" dkim=fail " OR AR:" dmarc=fail " 119 | 120 | work_sysu=is:sysu 121 | work_sbks=is:sbks 122 | work_cklb=is:cklb 123 | work_mstp=is:mstp 124 | work=query:work_sysu OR query:work_sbks OR query:work_cklb OR query:work_mstp 125 | 126 | # ticketing 127 | #ticketing_freshservice=from:devops-ticket@socialbakers.com OR from:itops@emplifi.io OR from:itops@socialbakers.com OR from:itsupport@socialbakers.com OR from:socialbakerscomitsupport@socialbakers.freshservice.com 128 | #ticketing_vendr=from:notifications@blissfully.com OR from:support@vendr.com OR from:notifications@vendr.com 129 | #ticketing_tp=from:dev-support@socialbakers.com OR from:dev-support@tp.socialbakers.com 130 | #ticketing_torii=from:hello@toriihq.com OR XOriginalSender:hello@toriihq.com 131 | ticketing_jira_astute=from:jira@astutesolutions.atlassian.net 132 | ticketing_jira_emplifi=from:jira@emplifi.atlassian.net 133 | ticketing_jira_cookielab=from:jira@cookielab.atlassian.net 134 | ticketing_jira_mailstep=from:jira@mailstep.atlassian.net 135 | ticketing_jira=query:ticketing_jira_astute OR query:ticketing_jira_emplifi OR query:ticketing_jira_cookielab OR query:ticketing_jira_mailstep 136 | # gitlab 137 | gitlab_com=from:gitlab@mg.gitlab.com 138 | gitlab_evenflo=from:gitlab@evenflo.cloud 139 | gitlab_emplifi=from:gitlab@socialbakers.com 140 | gitlab_cookielab=from:gitlab@cookielab.io 141 | gitlab=query:gitlab_com OR query:gitlab_evenflo OR query:gitlab_emplifi OR query:gitlab_cookielab 142 | # gitlab notification type 143 | gitlab_is_mr=GitLabMergeRequestIID:0* OR GitLabMergeRequestIID:1* OR GitLabMergeRequestIID:2* OR GitLabMergeRequestIID:3* OR GitLabMergeRequestIID:4* OR GitLabMergeRequestIID:5* OR GitLabMergeRequestIID:6* OR GitLabMergeRequestIID:7* OR GitLabMergeRequestIID:8* OR GitLabMergeRequestIID:9* 144 | gitlab_is_cicd=GitLabPipelineId:0* OR GitLabPipelineId:1* OR GitLabPipelineId:2* OR GitLabPipelineId:3* OR GitLabPipelineId:4* OR GitLabPipelineId:5* OR GitLabPipelineId:6* OR GitLabPipelineId:7* OR GitLabPipelineId:8* OR GitLabPipelineId:9* 145 | 146 | # renovate 147 | renovate_mailstep=from:'Robot Mailstep (@ms-robot)' AND query:gitlab_com 148 | renovate=query:renovate_mailstep 149 | 150 | gitlab_review=GitLabNotificationReason:review_requested 151 | gitlab_assigned=GitLabNotificationReason:assigned 152 | 153 | p/mstp=GitLabProjectPath:mailstep/.* OR query:ticketing_jira_mailstep 154 | p/jdl=GitLabProjectPath:jidlomat/.* OR (query:ticketing_jira_cookielab AND subject:JID-") 155 | p/tmac=GitLabProjectPath:tmac/.* 156 | p/internal=((GitLabProjectPath:cookielab/.* OR (GitLabProjectPath:infrastructure/.* AND query:gitlab_cookielab) OR (from:notifications@github.com AND List:/cookielab\\/.*/) 157 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc: -------------------------------------------------------------------------------- 1 | # variables 2 | set my_cfgdir = "$HOME/.neomutt" 3 | set my_bindir = "$my_cfgdir/bin" 4 | set my_luadir = "$my_cfgdir/lua" 5 | 6 | # terminal status line and icon 7 | set ts_enabled = yes 8 | set ts_icon_format = "% M%%" 9 | set ts_status_format = "% M%%" 10 | 11 | # layout 12 | set status_on_top = yes 13 | set help = no 14 | 15 | # menu 16 | set menu_scroll = yes # scroll in menus 17 | set menu_move_off = no # keep last entries on the last line of menu 18 | set menu_context = 10 # keep 10 lines above and below when scrolling in menus 19 | 20 | # index 21 | set auto_tag = yes # function in the index menu will be applied to all tagged messages 22 | set collapse_all = yes 23 | set collapse_unread = no 24 | set collapse_flagged = no 25 | set use_threads = reverse 26 | set sort = last-date 27 | set sort_aux = date 28 | set strict_threads = yes 29 | set reverse_alias = yes # display aliases in index 30 | set arrow_string = '❯' 31 | set date_format = "%F %R" 32 | set index_format = "%Z %D %-25.25L %2E %-1.75s %> %g" # {status flags} {date} {from} {# msgs in thread} {subject} {tags} 33 | set pgp_entry_format = "%2n %t%f %[%F] %4l/0x%k %-4a %2c %u" 34 | subjectrx '\[JIRA\] *' '%L%R' # remove [JIRA] subject prefix 35 | subjectrx ' \(Jira\)$' '%L%R' # remove (JIRA) subject suffix 36 | subjectrx '\[Confluence\] *' '%L%R' # remove [Confluence] subject prefix 37 | #subjectrx '\[#(SR|INC)-[[:digit:]]+\] *' '%L%R' # remove Freshservice ticket number 38 | #subjectrx '\(((DEVOPS|EMEA|DOCZ|SMCDO|CDG)-[[:digit:]]+)\)*' '%1%L%R' # remove () around JIRA ticket numbers 39 | subjectrx ' *\[AWS Account( ID)?: [[:digit:]]+\]' '%L%R' # remove info about AWS Account ID 40 | subjectrx '^(Re: )?\[neomutt/.*\] ' '%L%R' # remove repo prefixfrom github messages since it is already present in other field 41 | subjectrx '^(Re: )?\[sensu-plugins/.*\] ' '%L%R' # remove repo prefixfrom github messages since it is already present in other field 42 | subjectrx 'Pozvánka: ' '🗓 %L%R' # replace 'Pozvánka: ' with calendar emoji 43 | subjectrx 'Aktualizovaná pozvánka: ' '🗓 %L%R' # replace 'Aktualizovaná pozvánka: ' with calendar emoji 44 | subjectrx 'Nová událost: ' '🗓 %L%R' # replace 'Nová událost: ' with calendar emoji 45 | 46 | # pager 47 | set pager_index_lines = 10 # number of index lines to show 48 | set pager_context = 3 # number of context lines to show 49 | set pager_stop = yes # don't go to next message automatically 50 | set tilde = yes # fill empty lines from the end of message to bottom of the screen with tilde 51 | set markers = no # no plus sign at the beggining of wrapped lines 52 | 53 | # history 54 | set save_history = 1000 55 | set history_remove_dups = yes 56 | 57 | # behaviour 58 | set quit = ask-no 59 | set wait_key = no # stop asking for pressing key after some actions 60 | set read_inc = 1000 # display progress by 1000 msgs when changing maildir 61 | set pipe_split = yes # when multiple messages tagged and piped, do it separately 62 | 63 | # timers 64 | set mail_check_stats = yes # not really related to sidebar but it makes sense for me 65 | set mail_check_stats_interval = 10 66 | set mail_check = 10 # How often look for new mail 67 | set timeout = 60 # do not wait so long for menu refresh 68 | set sleep_time = 0 # don't sleep between actions 69 | 70 | # commands and paths 71 | set editor = "nvim -c 'set syntax=mail fileencoding=utf-8 ft=mail fo+=aw'" # set editor for composing messages 72 | set ispell = "aspell --mode=email -e -c" 73 | set print_command = "$my_bindir/print.sh" 74 | set mailcap_path = "$my_cfgdir/mailcap" 75 | 76 | auto_view text/html 77 | auto_view text/csv 78 | auto_view application/zip 79 | 80 | # composing, replying and forwarding 81 | set hostname = "caladan.jakubjindra.eu" # set hostname 82 | set content_type = "text/plain" # default content-type for outgoing emails 83 | set preferred_languages = "cz,en" 84 | #set show_multipart_alternative= "info" # display info about other alternatives in pager 85 | set forward_format = "Fwd: %s" # set subject of forwarded messages like shown 86 | set query_command = "notmuch address --format=text0 %s | fzf --border=top -e --read0 -m --height=10 -q %s" 87 | set query_format = "%3c %t %-50.50a %-25.25n %> %?e?(%e)?" 88 | set alias_format = "%4n %2f %t %-30a %r" 89 | set text_flowed = yes 90 | set askcc = yes # ask to fill Cc before composing message 91 | set askbcc = yes # ask to fill Bcc before composing message 92 | set fast_reply = yes # don't ask for subject, etc when replying 93 | set edit_headers = yes # allow editing or setting custom headers when composing 94 | set include = yes # include original message in reply 95 | set user_agent = yes 96 | set dsn_notify = "failure,delay" # request notification for failed and delayed messages 97 | set send_charset = "utf-8" # characterset for outgoing messages 98 | set assumed_charset = "utf-8:windows-1250:iso-8859-2" # characterset for incoming messages if no specified 99 | set attach_keyword = "(attach(ed|ments?)?|p[rř][ií]lo(h([yu]?|a(mi)?|ou|[aá]ch)|ze)?)" # regex for mentioned attachment in body 100 | set abort_noattach = ask-yes # ask to abort with default (yes) when attachment mentioned in body but no files attached 101 | set attach_save_dir = /tmp/ 102 | 103 | set simple_search = "~f %s | ~C %s | ~s %s" # make default search pattern to search in To, Cc and Subject 104 | set search_context = 5 # number of lines to show above matched string in search 105 | set to_chars = "😵👤👥🙋🏠📧" 106 | set status_chars = " 🔄🔒🅰" 107 | 108 | # Header blacklist / whitelist 109 | # care only about these headers 110 | ignore * 111 | unignore \ 112 | From \ 113 | To \ 114 | Cc \ 115 | Bcc \ 116 | Date \ 117 | Subject \ 118 | List-ID \ 119 | List-Archive \ 120 | X-GitLab-Project \ 121 | X-Github-Sender \ 122 | X-GitLab-Pipeline-Ref \ 123 | X-GitLab-MergeRequest-IID \ 124 | X-GitLab-NotificationReason \ 125 | Organization \ 126 | X-Mailer \ 127 | User-Agent \ 128 | Tags 129 | # display headers in this order 130 | unhdr_order * 131 | hdr_order \ 132 | From: \ 133 | To: \ 134 | Cc: \ 135 | Bcc: \ 136 | Date: \ 137 | Subject: \ 138 | List-ID: \ 139 | List-Archive: \ 140 | X-GitLab-Project \ 141 | X-GitLab-MergeRequest-IID \ 142 | X-GitLab-NotificationReason \ 143 | X-Github-Sender: \ 144 | Organization: \ 145 | X-Mailer: \ 146 | User-Agent: \ 147 | Tags: 148 | 149 | # headercache 150 | ifdef hcache "set header_cache = '~/.cache/neomutt/'" 151 | ifdef hcache "set header_cache_backend = 'lmdb'" 152 | ifdef hcache "set header_cache_compress_method = 'zstd'" 153 | ifdef hcache "set header_cache_compress_level = 12" 154 | 155 | # Source other config files 156 | source $my_cfgdir/neomuttrc.myvars # source config my_vars 157 | source $my_cfgdir/neomuttrc.aliases # source config aliases, alternates lists, subscribes and groups 158 | source $my_cfgdir/neomuttrc.sidebar # source config sidebar 159 | source $my_cfgdir/neomuttrc.mailboxes # source config virtualmailboxes 160 | source $my_cfgdir/neomuttrc.hooks # source config hooks 161 | source $my_cfgdir/neomuttrc.bindings # source config shortcuts 162 | source $my_cfgdir/neomuttrc.crypt # source config S/MIME and GPG 163 | source $my_cfgdir/neomuttrc.profile-work # source config work profile 164 | source $my_cfgdir/neomuttrc.colors # source config colors 165 | source $my_cfgdir/toggle/neomuttrc.arrow_cursor_on # source default toggle 166 | source $my_cfgdir/neomuttrc.tmp # source config temporary config 167 | 168 | # vim:foldmethod=marker:foldlevel=0 169 | -------------------------------------------------------------------------------- /.psqlrc: -------------------------------------------------------------------------------- 1 | --\set QUIET 2 | -- 3 | --\set sysuser `/bin/echo $USER` 4 | ---- \set application_name 'p (psql) - ':sysuser 5 | ---- set application_name=:'application_name' 6 | --\set HISTCONTROL ignoreboth 7 | --\set COMP_KEYWORD_CASE upper 8 | --\pset null '[NULL]' 9 | --\timing on 10 | -- 11 | ---- PAGER {{{ 12 | --\setenv PAGER pspg 13 | --\pset border 2 14 | --\pset linestyle unicode 15 | ---- }}} 16 | -- 17 | ---- PROMPT {{{ 18 | --\set PROMPT1 '%[%033[1;30m%][ %[%033[1;97m%]postgres%[%033[1;30m%]://%[%033[1;32m%]%n@%M%[%033[1;30m%]:%[%033[1;97m%]%>%[%033[1;30m%]/%[%033[1;34m%]%/ %[%033[1;97m%]%R%[%033[1;30m%]]%[%033[0m%]\n%[%033[1;34m%]%#%[%033[0m%] ' 19 | --\set PROMPT2 ' ' 20 | ---- }}} 21 | -- 22 | ---- QUERIES {{{ 23 | --\! echo "Type \033[1;36m:help\033[0m to list predefined queries" 24 | --\set blocking 'select bl.pid as blocked_pid, ka.query as blocking_statement, now() - ka.query_start as blocking_duration, kl.pid as blocking_pid, a.query as blocked_statement, now() - a.query_start as blocked_duration from pg_catalog.pg_locks bl join pg_catalog.pg_stat_activity a on bl.pid = a.pid join pg_catalog.pg_locks kl join pg_catalog.pg_stat_activity ka on kl.pid = ka.pid on bl.transactionid = kl.transactionid and bl.pid != kl.pid where not bl.granted;' 25 | --\set cache_hit 'SELECT ''index hit rate'' as name, (sum(idx_blks_hit)) / sum(idx_blks_hit + idx_blks_read) as ratio FROM pg_statio_user_indexes union all SELECT ''cache hit rate'' as name, sum(heap_blks_hit) / (sum(heap_blks_hit) + sum(heap_blks_read)) as ratio FROM pg_statio_user_tables;' 26 | --\set index_usage 'SELECT relname, CASE idx_scan WHEN 0 THEN ''Insufficient data'' ELSE (100 * idx_scan / (seq_scan + idx_scan))::text END percent_of_times_index_used, n_live_tup rows_in_table FROM pg_stat_user_tables ORDER BY n_live_tup DESC;' 27 | --\set replag 'SELECT NOW() - pg_last_xact_replay_timestamp() AS replag;' 28 | --\set replication 'SELECT * FROM pg_stat_replication\\x\\g\\x' 29 | --\set tbloat 'SELECT current_database(),schemaname,tablename,ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat, CASE WHEN relpages0 AND s2.schemaname=s.schemaname AND s2.tablename=s.tablename) AS nullhdr FROM pg_stats s,(SELECT (SELECT current_setting(\'block_size\')::NUMERIC) AS bs, CASE WHEN SUBSTRING(v,12,3) IN (\'8.0\',\'8.1\',\'8.2\') THEN 27 ELSE 23 END AS hdr,CASE WHEN v~\'mingw32\' THEN 8 ELSE 4 END AS ma FROM (SELECT version() AS v) AS foo) AS constants GROUP BY 1,2,3,4,5) AS foo) AS rs JOIN pg_class cc ON cc.relname=rs.tablename JOIN pg_namespace nn ON cc.relnamespace=nn.oid AND nn.nspname=rs.schemaname AND nn.nspname<>\'information_schema\' LEFT JOIN pg_index i ON indrelid = cc.oid LEFT JOIN pg_class c2 ON c2.oid=i.indexrelid) AS sml ORDER BY wastedbytes DESC;' 30 | --\set ibloat 'SELECT current_database(),schemaname,tablename,ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat, CASE WHEN relpages0 AND s2.schemaname=s.schemaname AND s2.tablename=s.tablename) AS nullhdr FROM pg_stats s,(SELECT (SELECT current_setting(\'block_size\')::NUMERIC) AS bs, CASE WHEN SUBSTRING(v,12,3) IN (\'8.0\',\'8.1\',\'8.2\') THEN 27 ELSE 23 END AS hdr,CASE WHEN v~\'mingw32\' THEN 8 ELSE 4 END AS ma FROM (SELECT version() AS v) AS foo) AS constants GROUP BY 1,2,3,4,5) AS foo) AS rs JOIN pg_class cc ON cc.relname=rs.tablename JOIN pg_namespace nn ON cc.relnamespace=nn.oid AND nn.nspname=rs.schemaname AND nn.nspname<>\'information_schema\' LEFT JOIN pg_index i ON indrelid = cc.oid LEFT JOIN pg_class c2 ON c2.oid=i.indexrelid) AS sml ORDER BY wastedibytes DESC;' 31 | --\set nr_tuples 'SELECT schemaname,relname,n_tup_ins,n_tup_upd,n_tup_del,n_tup_hot_upd FROM pg_stat_user_tables ORDER BY n_tup_ins desc,n_tup_upd desc,n_tup_del desc,n_tup_hot_upd DESC;' 32 | --\set show_grants 'SELECT * FROM (SELECT use.usename AS usename,nsp.nspname AS namespace,c.relname AS relname,c.relkind AS relkind,use2.usename AS owner,c.relacl,(use2.usename!=use.usename AND c.relacl::text!~(\'({|,)\'||use.usename||\'=\')) AS public FROM pg_user use CROSS JOIN pg_class c LEFT JOIN pg_namespace nsp ON (c.relnamespace=nsp.oid) LEFT JOIN pg_user use2 ON (c.relowner=use2.usesysid) WHERE c.relowner=use.usesysid or c.relacl::text~(\'({|,)(|\'||use.usename||\')=\') ORDER BY usename, namespace, relname) AS p WHERE p.namespace!=\'information_schema\' AND p.namespace!=\'pg_catalog\';' 33 | --\set show_permissions 'SELECT * FROM (SELECT use.usename AS subject, nsp.nspname AS namespace, c.relname AS item, c.relkind AS type, use2.usename AS owner, c.relacl, (use2.usename!=use.usename AND c.relacl::text!~(\'({|,)\'||use.usename||\'=\')) AS public FROM pg_user use CROSS JOIN pg_class c LEFT JOIN pg_namespace nsp ON (c.relnamespace=nsp.oid) LEFT JOIN pg_user use2 ON (c.relowner=use2.usesysid) WHERE c.relowner=use.usesysid OR c.relacl::text~(\'({|,)(|\'||use.usename||\')=\') ORDER BY subject, namespace, item) AS perms WHERE perms.namespace!=\'information_schema\' AND perms.namespace!=\'pg_catalog\';' 34 | --\set show_create_table1 '\\echo Schema: \\gset \\prompt schema \\echo Table:\\gset \\prompt table\\g' 35 | --\set show_create_table 'SELECT \'CREATE TABLE \' || :\'table\' || \' (\' || E\'\n\' || \'\' || string_agg(column_list.column_expr, \', \' || E\'\n\' || \'\') || \'\' || E\'\n\' || \');\' FROM ( SELECT \' \' || column_name || \' \' || data_type || COALESCE(\'(\' || character_maximum_length || \')\', \'\') || CASE WHEN is_nullable = \'YES\' THEN \'\' ELSE \' NOT NULL\' END AS column_expr FROM information_schema.columns WHERE table_schema = :\'schema\' AND table_name = :\'table\' ORDER BY ordinal_position) column_list\\g' 36 | --\set uptime 'select now() - pg_postmaster_start_time() AS uptime;' 37 | --\set help '\\! echo ":blocking\t\t -- Show blocked queries and blocking one\n:tbloat\t\t\t -- Bloat oredered by wasted table bytes\n:ibloat\t\t\t -- Bloat ordered by wasted index bytes\n:nr_tuples\t\t -- Display tuples stats for tables\n:replag\t\t\t -- Show replication lag\n:replication\t\t -- Show replication info\n:show_create_table1\t -- Set schema and table for show_create_table\n:show_create_table\t -- Display CREATE TABLE statement\n:show_grants\t\t -- Show grants for objects\n:show_permissions\t -- Show permissions for objects\n:uptime\t\t\t -- Display cluster uptime"' 38 | ---- }}} 39 | -- 40 | --\unset QUIET 41 | ---- vim:nowrap:foldmethod=marker:foldlevel=0 42 | -------------------------------------------------------------------------------- /.tigrc: -------------------------------------------------------------------------------- 1 | set main-view-id = true 2 | set line-graphics = utf-8 3 | set mailmap = true 4 | set main-view = date:default author:full id:true commit-title:yes,refs,graph 5 | 6 | # Neonwolf Color Scheme for Tig 7 | # 8 | # Based mostly on the colors from the badwolf airline theme 9 | # 10 | # Github: https://github.com/h3xx/tig-colors-neonwolf 11 | # 12 | 13 | # disable importing colors from git config 14 | # (breaks main-ref coloring, probably others) 15 | set git-colors = no 16 | 17 | color header 121 235 bold 18 | color section 39 235 bold 19 | color search-result black 81 bold 20 | 21 | # diff view 22 | color diff-header 39 235 bold 23 | color diff-index 81 235 bold 24 | color diff-oldmode 81 235 bold 25 | color diff-newmode 81 235 bold 26 | color "rename from " 81 235 bold 27 | color "rename to " 81 235 bold 28 | color "similarity " 81 235 bold 29 | color "dissimilarity " 81 235 bold 30 | color diff-stat 222 235 bold 31 | color diff-chunk 165 235 bold 32 | color diff-add 154 235 bold 33 | color diff-add-highlight 232 154 bold 34 | color diff-del 196 235 bold 35 | color diff-del-highlight 232 196 bold 36 | color " +" 154 default 37 | color " -" 196 default 38 | color "--- " 39 235 bold 39 | color "+++ " 39 235 bold 40 | color "Merge: " 222 235 bold 41 | color "Refs: " 222 235 bold 42 | color "commit " 154 235 bold 43 | color "Commit: " 39 235 bold 44 | color "CommitDate: " 165 235 bold 45 | color "Author: " 39 235 bold 46 | color "AuthorDate: " 165 235 bold 47 | color "Tagger: " 222 235 bold 48 | color "TaggerDate: " 222 235 bold 49 | color "---" 165 default bold 50 | 51 | # log view, mostly 52 | color "Date: " 165 default bold 53 | color " Signed-off-by" 222 default bold 54 | color " Acked-by" 222 default bold 55 | color " Tested-by" 222 default bold 56 | color " Reviewed-by" 222 default bold 57 | 58 | # main view 59 | color author 39 default bold 60 | color date 165 default bold 61 | color graph-commit 154 default bold 62 | color id 154 default bold 63 | color main-remote 222 default bold 64 | color main-tracked 222 default bold 65 | color main-tag 166 default bold 66 | color main-local-tag 166 default bold 67 | color main-head 81 default bold 68 | color main-ref 121 default bold 69 | color overflow 196 default 70 | 71 | # window dressing 72 | color title-blur 39 235 bold 73 | color title-focus 39 232 bold reverse 74 | color cursor 232 154 bold 75 | color status 82 default 76 | 77 | # tree view 78 | color mode 121 default 79 | color directory 121 default bold 80 | color file 255 default 81 | 82 | # status view 83 | color stat-none 82 default 84 | color stat-staged 154 235 bold 85 | color stat-unstaged 166 235 bold 86 | color stat-untracked 81 235 bold 87 | 88 | # lines in digraph 89 | color palette-0 165 default bold 90 | color palette-1 39 default bold 91 | color palette-2 222 default bold 92 | color palette-3 166 default bold 93 | color palette-4 121 default bold 94 | color palette-5 82 default bold 95 | color palette-6 196 default bold 96 | color palette-7 238 default bold 97 | # repeat 98 | color palette-8 165 default 99 | color palette-9 39 default 100 | color palette-10 222 default 101 | color palette-11 166 default 102 | color palette-12 121 default 103 | color palette-13 82 default 104 | 105 | # grep view 106 | color grep.file 39 235 bold 107 | color grep.line-number 165 235 bold 108 | color grep.delimiter 82 235 bold # no effect? 109 | color delimiter 82 235 bold # no effect? 110 | 111 | # help view 112 | color help-group 165 235 bold 113 | color help-action 222 235 bold 114 | 115 | color "---" blue default 116 | color "diff --" yellow default 117 | color "--- " yellow default 118 | color "+++ " yellow default 119 | color "@@" magenta default 120 | color "+" green default 121 | color " +" green default 122 | color "-" red default 123 | color " -" red default 124 | color "index " blue default 125 | color "old file mode " yellow default 126 | color "new file mode " yellow default 127 | color "deleted file mode " yellow default 128 | color "copy from " yellow default 129 | color "copy to " yellow default 130 | color "rename from " yellow default 131 | color "rename to " yellow default 132 | color "similarity " yellow default 133 | color "dissimilarity " yellow default 134 | color "\ No newline at end of file" blue default 135 | color "diff-tree " blue default 136 | color "Author: " cyan default 137 | color "Commit: " magenta default 138 | color "Tagger: " magenta default 139 | color "Merge: " blue default 140 | color "Date: " yellow default 141 | color "AuthorDate: " yellow default 142 | color "CommitDate: " yellow default 143 | color "TaggerDate: " yellow default 144 | color "Refs: " red default 145 | color "Reflog: " red default 146 | color "Reflog message: " yellow default 147 | color "stash@{" magenta default 148 | color "commit " green default 149 | color "parent " blue default 150 | color "tree " blue default 151 | color "author " green default 152 | color "committer " magenta default 153 | color " Signed-off-by:" yellow default 154 | color " Acked-by:" yellow default 155 | color " Reviewed-by:" yellow default 156 | color " Helped-by:" yellow default 157 | color " Reported-by:" yellow default 158 | color " Mentored-by:" yellow default 159 | color " Suggested-by:" yellow default 160 | color " Cc:" yellow default 161 | color " Noticed-by:" yellow default 162 | color " Tested-by:" yellow default 163 | color " Improved-by:" yellow default 164 | color " Thanks-to:" yellow default 165 | color " Based-on-patch-by:" yellow default 166 | color " Contributions-by:" yellow default 167 | color " Co-authored-by:" yellow default 168 | color " Requested-by:" yellow default 169 | color " Original-patch-by:" yellow default 170 | color " Inspired-by:" yellow default 171 | color default default default normal 172 | color cursor white green bold 173 | color status green default 174 | color delimiter magenta default 175 | color date blue default 176 | color mode cyan default 177 | color id magenta default 178 | color overflow red default 179 | color header yellow default 180 | color section cyan default 181 | color directory yellow default 182 | color file default default 183 | color grep.file blue default 184 | color file-size default default 185 | color line-number cyan default 186 | color title-blur white blue 187 | color title-focus white blue bold 188 | color main-commit default default 189 | color main-annotated default default bold 190 | color main-tag magenta default bold 191 | color main-local-tag magenta default 192 | color main-remote yellow default 193 | color main-replace cyan default 194 | color main-tracked yellow default bold 195 | color main-ref cyan default 196 | color main-head cyan default bold 197 | color stat-none default default 198 | color stat-staged magenta default 199 | color stat-unstaged magenta default 200 | color stat-untracked magenta default 201 | color help-group blue default 202 | color help-action yellow default 203 | color diff-stat blue default 204 | color diff-add-highlight green default standout 205 | color diff-del-highlight red default standout 206 | color palette-0 magenta default 207 | color palette-1 yellow default 208 | color palette-2 cyan default 209 | color palette-3 green default 210 | color palette-4 default default 211 | color palette-5 white default 212 | color palette-6 red default 213 | color palette-7 magenta default bold 214 | color palette-8 yellow default bold 215 | color palette-9 cyan default bold 216 | color palette-10 green default bold 217 | color palette-11 default default bold 218 | color palette-12 white default bold 219 | color palette-13 red default bold 220 | color graph-commit blue default 221 | color search-result black yellow 222 | 223 | # Mappings for colors read from git configuration. 224 | # Set to "no" to disable. 225 | set git-colors = \ 226 | branch.current=main-head \ 227 | branch.local=main-ref \ 228 | branch.plain=main-ref \ 229 | branch.remote=main-remote \ 230 | \ 231 | diff.meta=diff-header \ 232 | diff.meta=diff-index \ 233 | diff.meta=diff-oldmode \ 234 | diff.meta=diff-newmode \ 235 | diff.frag=diff-chunk \ 236 | diff.old=diff-del \ 237 | diff.new=diff-add \ 238 | \ 239 | diff-highlight.oldHighlight=diff-del-highlight \ 240 | diff-highlight.newHighlight=diff-add-highlight \ 241 | \ 242 | grep.filename=grep.file \ 243 | grep.linenumber=grep.line-number \ 244 | grep.separator=grep.delimiter \ 245 | \ 246 | status.branch=status.header \ 247 | status.added=stat-staged \ 248 | status.updated=stat-staged \ 249 | status.changed=stat-unstaged \ 250 | status.untracked=stat-untracked 251 | 252 | # vi: ts=8 sts=8 sw=8 noet 253 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.mailboxes: -------------------------------------------------------------------------------- 1 | #set folder = "~/.mail/gmail" 2 | set my_notmuch_db_path = `notmuch config get database.path` 3 | set nm_default_url = notmuch://$my_notmuch_db_path 4 | set mbox_type = maildir 5 | unset record 6 | set postponed = "${my_notmuch_db_path}/drafts" 7 | set nm_exclude_tags = "spam" 8 | set hidden_tags = "unread,passed" 9 | set virtual_spoolfile = yes 10 | set spoolfile = "GMail/INBOX" 11 | set nm_record = yes 12 | #set nm_record_tags = "-inbox,sent" 13 | #set nm_query_window_timebase = "week" 14 | 15 | named-mailboxes \ 16 | "test" "$HOME/.mail/sample-mail/f1/fruit/lemon/" \ 17 | "local" "/var/mail/jindraj" \ 18 | "GMail" "/dev/null" \ 19 | "GMail/INBOX" "notmuch://?query=is:inbox AND NOT (query:cal OR query:lists OR query:junk OR query:renovate) " \ 20 | "GMail/INBOX/personal" "notmuch://?query=is:inbox NOT query:work " \ 21 | "GMail/INBOX/personal/🏠" "notmuch://?query=is:inbox AND is:byt " \ 22 | "GMail/INBOX/personal/🚗" "notmuch://?query=is:inbox AND is:car " \ 23 | "GMail/INBOX/personal/📆" "notmuch://?query=is:inbox AND query:cal AND NOT query:work " \ 24 | "GMail/INBOX/osvc" "notmuch://?query=is:inbox AND (is:osvc OR query:osvc OR qesx2az) " \ 25 | "GMail/INBOX/osvc/DS" "notmuch://?query=from:notifikace@mojedatovaschranka.cz AND qesx2az " \ 26 | "GMail/INBOX/kids" "notmuch://?query=is:inbox AND is:kids " \ 27 | "GMail/INBOX/💻" "notmuch://?query=is:inbox AND query:work AND NOT (query:personal OR query:lists OR query:junk OR query:renovate)" \ 28 | "GMail/INBOX/💻/📆" "notmuch://?query=is:inbox AND query:work AND query:cal " \ 29 | "GMail/INBOX/💻/🎫" "notmuch://?query=is:inbox AND query:work AND is:ticketing " \ 30 | "GMail/INBOX/💻/jidlomat" "notmuch://?query=is:inbox AND query:work AND query:p/jdl " \ 31 | "GMail/INBOX/💻/tmac" "notmuch://?query=is:inbox AND query:work AND query:p/tmac " \ 32 | "GMail/INBOX/💻/internal" "notmuch://?query=is:inbox AND query:work AND query:p/internal " \ 33 | "GMail/INBOX/💻/mailstep" "notmuch://?query=is:inbox AND query:work AND query:p/mstp " \ 34 | "GMail/INBOX/💻/git" "notmuch://?query=is:inbox AND query:work AND query:gitlab " \ 35 | "GMail/INBOX/💻/git/assigned" "notmuch://?query=is:inbox AND query:work AND query:gitlab AND query:gitlab_assigned " \ 36 | "GMail/INBOX/💻/git/review" "notmuch://?query=is:inbox AND query:work AND query:gitlab AND query:gitlab_review " \ 37 | "GMail/INBOX/💻/git/renovate" "notmuch://?query=is:inbox AND query:work AND query:gitlab AND query:renovate " \ 38 | "GMail/INBOX/💻/git/MR" "notmuch://?query=is:inbox AND query:work AND query:gitlab AND query:gitlab_is_mr " \ 39 | "GMail/INBOX/💻/git/CICD" "notmuch://?query=is:inbox AND query:work AND query:gitlab AND query:gitlab_is_cicd " 40 | 41 | # source git repos mailboxes 42 | source $my_bindir/helpers/mailboxes.sh| 43 | 44 | # rest of the mailboxes 45 | named-mailboxes \ 46 | "GMail/unread" "notmuch://?query=is:unread NOT query:junk " \ 47 | "GMail/flagged" "notmuch://?query=is:flagged " \ 48 | "GMail/sent" "notmuch://?query=is:sent NOT is:trash " \ 49 | "GMail/drafts" $postponed \ 50 | "GMail/spam" "notmuch://?query=is:spam " \ 51 | "GMail/trash" "notmuch://?query=is:trash " \ 52 | "GMail/personal" "notmuch://?query=query:personal AND NOT (is:maillists OR is:newsletters OR is:dmarc) " \ 53 | "GMail/personal/DS" "notmuch://?query=from:notifikace@mojedatovaschranka.cz AND 8c4icau " \ 54 | "GMail/orders" "notmuch://?query=is:orders NOT (is:done OR is:invalid) " \ 55 | "GMail/newsletters" "notmuch://?query=is:newsletters " \ 56 | "GMail/linkedin" "notmuch://?query=from:@linkedin.com " \ 57 | "reports" "/dev/null" \ 58 | "reports/receipts" "notmuch://?query=mimetype:message/disposition-notification " \ 59 | "reports/delivery-status" "notmuch://?query=mimetype:message/delivery-status " \ 60 | "reports/dmarc" "notmuch://?query=mimetype:message/feedback-report OR tag:dmarc " \ 61 | "lists" "notmuch://?query=is:maillists " \ 62 | "lists/neomutt" "notmuch://?query=List:neomutt.org " \ 63 | "lists/neomutt/users" "notmuch://?query=List:neomutt-users-neomutt.org " \ 64 | "lists/neomutt/developers" "notmuch://?query=List:neomutt-devel-neomutt.org " \ 65 | "lists/github" "notmuch://?query=List:github.com " \ 66 | "lists/github/neomutt" "notmuch://?query=List:neomutt.github.com " \ 67 | "lists/github/neomutt/neomutt" "notmuch://?query=List:neomutt/neomutt NOT List:neomutt/homebrew-neomutt " \ 68 | "lists/github/neomutt/management" "notmuch://?query=List:neomutt/management " \ 69 | "lists/github/neomutt/homebrew" "notmuch://?query=List:neomutt/homebrew-neomutt " \ 70 | "lists/github/neomutt/translators" "notmuch://?query=List:neomutt/translators " \ 71 | "lists/github/other" "notmuch://?query=List:github.com NOT (List:neomutt OR List:sensu-plugins) " \ 72 | "lists/github/about-me" "notmuch://?query=to:@noreply.github.com (to:mention@ OR to:author@ OR to:assign@ OR to:comment@ OR to:review_requested@)" \ 73 | "archives" "notmuch://?query=NOT query:junk " \ 74 | "archives/today" "notmuch://?query=NOT query:junk AND date:today " \ 75 | "archives/yesterday" "notmuch://?query=NOT query:junk AND date:yesterday " \ 76 | "archives/this week" "notmuch://?query=NOT query:junk AND date:this_week " \ 77 | "archives/last week" "notmuch://?query=NOT query:junk AND date:last_week " \ 78 | "archives/this month" "notmuch://?query=NOT query:junk AND date:this_month " \ 79 | "archives/last month" "notmuch://?query=NOT query:junk AND date:last_month " \ 80 | "archives/this year" "notmuch://?query=NOT query:junk AND date:this_year " \ 81 | "archives/last year" "notmuch://?query=NOT query:junk AND date:last_year " 82 | 83 | tag-transforms \ 84 | "inbox" "📥" \ 85 | "sent" "📤" \ 86 | "important" "‼️" \ 87 | "trash" "🗑 " \ 88 | "spam" "💩" \ 89 | "replied" "↺" \ 90 | "flagged" "🌟" \ 91 | "signed" "📝" \ 92 | "encrypted" "🔐" \ 93 | "attachment" "📁" \ 94 | "new" "🔔" \ 95 | "tickets" "🎟" \ 96 | "travelling" "✈️" \ 97 | "work" "💻" \ 98 | "sbks" "🥖" \ 99 | "cklb" "🍪" \ 100 | "ticketing" "🎫" \ 101 | "newsletters" "📰" \ 102 | "maillists" "📧"\ 103 | "my_tech_stuff" "🔧" \ 104 | "finance" "💵" \ 105 | "payroll" "🤑" \ 106 | "doc" "📄" \ 107 | "car" "🚘" \ 108 | "bydleni" "🏠" \ 109 | "photos" "📷" \ 110 | "print" "🖨 " \ 111 | "orders" "📦" \ 112 | "vypis" "🔠" \ 113 | "done" "☑️" \ 114 | "invalid" "🚫" \ 115 | "bookmarks" "🔖" \ 116 | "covid" "🦠" \ 117 | "xmas" "🎄" \ 118 | "wedding" "💍" \ 119 | "pets" "😻" \ 120 | "health" "🏥" 121 | 122 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 123 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " settings basic {{{ 2 | set nocompatible " be iMproved, needed by a lot of plugins 3 | set shortmess=I " Hide splash screen 4 | filetype off " required! 5 | " }}} 6 | 7 | let g:ale_lint_on_text_changed = 'always' 8 | let g:ale_puppet_languageserver_executable = '~/.config/nvim/plugged/puppet-editor-services/puppet-languageserver' 9 | 10 | let g:editorconfig = v:false 11 | " Plug configuration {{{ 12 | let plug_installed=expand('~/.vim/autoload/plug.vim') 13 | if !filereadable(plug_installed) 14 | echo "Installing plug.." 15 | echo "" 16 | silent !curl -NsfLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 17 | endif 18 | call plug#begin() 19 | Plug 'muhmud/qsh', { 'dir': '~/.qsh/editors/vim' } 20 | Plug 'lingua-pupuli/puppet-editor-services' 21 | Plug 'Shougo/deoplete.nvim', { 'do': 'UpdateRemotePlugins' } 22 | Plug 'airblade/vim-gitgutter' 23 | Plug 'luochen1990/rainbow' 24 | Plug 'neomutt/neomutt.vim' 25 | Plug 'adborden/vim-notmuch-address' 26 | Plug 'vim-scripts/AnsiEsc.vim' 27 | Plug 'rodjek/vim-puppet' 28 | Plug 'junegunn/fzf' 29 | Plug 'junegunn/fzf.vim' 30 | Plug 'scrooloose/nerdtree' 31 | "Plug 'editorconfig/editorconfig-vim' 32 | Plug 'tpope/vim-fugitive' 33 | Plug 'rkitover/vimpager' 34 | Plug 'hashivim/vim-terraform' 35 | Plug 'hashicorp/terraform-ls' 36 | Plug 'juliosueiras/vim-terraform-completion' 37 | Plug 'vim-syntastic/syntastic' 38 | Plug 'morhetz/gruvbox' 39 | Plug 'speshak/vim-cfn' 40 | Plug 'vim-airline/vim-airline' 41 | Plug 'vim-airline/vim-airline-themes' 42 | Plug 'vim-scripts/applescript.vim' 43 | Plug 'vim-scripts/gitvimdiff' 44 | Plug 'vim-scripts/haproxy' 45 | Plug 'vim-scripts/ldap_schema.vim' 46 | Plug 'vim-scripts/ldif.vim' 47 | Plug 'mechatroner/rainbow_csv' 48 | Plug 'w0rp/ale' 49 | Plug 'wincent/command-t' 50 | call plug#end() 51 | " }}} 52 | 53 | " qsh 54 | vnoremap :call QshExecuteSelection() 55 | 56 | " {{{ functions 57 | " func DoPrettyXML {{{ 58 | function! DoPrettyXML() 59 | let l:origft = &ft " save the filetype so we can restore it later 60 | set ft= 61 | " delete the xml header if it exists. This will 62 | " permit us to surround the document with fake tags 63 | " without creating invalid xml. 64 | 1s///e 65 | " insert fake tags around the entire document. 66 | " This will permit us to pretty-format excerpts of 67 | " XML that may contain multiple top-level elements. 68 | 0put ='' 69 | $put ='' 70 | silent %!xmllint --format - 71 | " xmllint will insert an header. it's easy enough to delete 72 | " if you don't want it. 73 | " delete the fake tags 74 | 2d 75 | $d 76 | " restore the 'normal' indentation, which is one extra level 77 | " too deep due to the extra tags we wrapped around the document. 78 | silent %< 79 | " back to home 80 | 1 81 | " restore the filetype 82 | exe "set ft=" . l:origft 83 | endfunction 84 | command! PrettyXML call DoPrettyXML() 85 | " }}} 86 | 87 | " func ListToggle {{{ 88 | function! ListToggle() 89 | set list! 90 | endfunction 91 | " }}} 92 | 93 | " func NumberToggle {{{ 94 | function! NumberToggle() 95 | set nonu! 96 | set nornu! 97 | if &number 98 | GitGutterDisable 99 | else 100 | GitGutterEnable 101 | endif 102 | endfunction 103 | " }}} 104 | 105 | " func LineWrapToggle {{{ 106 | function! LineWrapToggle() 107 | set wrap! 108 | endfunction 109 | " }}} 110 | 111 | " func PasteToggle {{{ 112 | function! PasteToggle() 113 | set paste! 114 | endfunction 115 | " }}} 116 | 117 | " func CopyToSystemClipboardToggle {{{ 118 | function! CopyToSystemClipboardToggle() 119 | if &clipboard == 'unnamed' 120 | set clipboard= 121 | echo "System clipboard unset" 122 | else 123 | set clipboard=unnamed 124 | echo "System clipboard set" 125 | endif 126 | endfunction 127 | " }}} 128 | 129 | " func MouseToggle {{{ 130 | function! MouseToggle() 131 | if &mouse == 'a' 132 | set mouse= 133 | else 134 | set mouse=a 135 | endif 136 | endfunction 137 | " }}} 138 | " }}} 139 | " 140 | 141 | let g:loaded_node_provider = 0 142 | let g:loaded_perl_provider = 0 143 | 144 | " {{{ naseptavani 145 | let g:deoplete#enable_at_startup = 1 146 | " let g:deoplete#omni_patterns = {} 147 | " call deoplete#custom#option('omni_patterns', { 148 | " \ 'complete_method': 'omnifunc', 149 | " \ 'terraform': '[^ *\t"{=$]\w*', 150 | " \}) 151 | call deoplete#custom#option('sources', { 152 | \ '_': ['ale'], 153 | \}) 154 | call deoplete#initialize() 155 | set completeopt=menu,menuone,preview,noselect,noinsert 156 | 157 | 158 | let g:notmuch_address_tag = 'sent' 159 | 160 | " syntastic 161 | "set statusline+=%#warningmsg# 162 | "set statusline+=%{SyntasticStatuslineFlag()} 163 | "set statusline+=%* 164 | "let g:syntastic_always_populate_loc_list = 1 165 | "let g:syntastic_auto_loc_list = 1 166 | "let g:syntastic_check_on_open = 1 167 | "let g:syntastic_check_on_wq = 0 168 | " 169 | "set completeopt-=preview 170 | " 171 | "" (Optional)Hide Info(Preview) window after completions 172 | "autocmd CursorMovedI * if pumvisible() == 0|pclose|endif 173 | "autocmd InsertLeave * if pumvisible() == 0|pclose|endif 174 | " 175 | "" (Optional) Enable terraform plan to be include in filter 176 | "let g:syntastic_terraform_tffilter_plan = 1 177 | " 178 | "" (Optional) Default: 0, enable(1)/disable(0) plugin's keymapping 179 | "let g:terraform_completion_keys = 1 180 | " 181 | "" (Optional) Default: 1, enable(1)/disable(0) terraform module registry completion 182 | "let g:terraform_registry_module_completion = 0 183 | " }}} 184 | 185 | 186 | if exists('+termguicolors') 187 | set termguicolors 188 | endif 189 | let g:airline = {} 190 | let g:airline.colorscheme = 'gruvbox' 191 | colorscheme gruvbox 192 | " Powerline Airline {{{ 193 | let g:Powerline_symbols = 'fancy' 194 | let g:airline_theme='gruvbox' 195 | let g:airline_powerline_fonts = 1 196 | let g:airline#extensions#tabline#enabled = 1 197 | 198 | let $NVIM_TUI_ENABLE_TRUE_COLOR=1 199 | " }}} 200 | 201 | " settings misc {{{ 202 | filetype plugin indent on " required! 203 | "set background=dark " i have dark background 204 | "colorscheme neodark " set color scheme 205 | " let g:neodark#terminal_transparent = 1 " default: 0 206 | " let g:neodark#solid_vertsplit = 1 207 | " let g:neodark#background = '#000000' 208 | syntax enable " enable syntax highliting 209 | hi CursorLine cterm=NONE ctermbg=233 " highlight cursorline with 210 | hi LineNr ctermfg=16 cterm=bold ctermbg=240 211 | set cursorline " display line with cursor 212 | set enc=utf-8 " Set encoding to UTF-8. Needed by powerline/airline 213 | set termencoding=utf-8 " Set encoding to UTF-8. Needed by powerline/airline 214 | set novisualbell " Disable window blinking 215 | set title " show filename in terminal title 216 | set ruler " Shows ruler in the bottom (not needed if 'vim-powerline is on' 217 | set number " Display line numbers on the left 218 | set rnu " relative numbers 219 | set numberwidth=5 " Fix width for 5 digits number 220 | set laststatus=2 " To see powerline/airline everytime (not only in split windows). 221 | set scrolloff=20 " Preserve 20 visible lines up/down when moving vertical 222 | set showmatch " Show matching bracets whern text indicator is over them 223 | set sidescrolloff=20 " Preserve at least 10 columns on both sides of cursor? 224 | set undolevels=200 " Number of possible undo actions 225 | set wildignore=*.o,*.obj,*.exe,*.pyc,*.jpg,*.gif,*.png 226 | set wildmenu " Set command completion 227 | set wildmode=list:longest 228 | set autowrite " automatically save before :next and similar commands 229 | "set clipboard=unnamed " s 230 | let mapleader="," " mapleader 231 | set lazyredraw " redraw only when we need to. This should lead to faster macros 232 | set whichwrap+=<,>,[,] " don't stop at the EOL when using arrow keys, preserved stop using 'h' and 'l' 233 | set modeline " Last lines in document sets vim mode 234 | set modelines=3 " Number lines checked for modelines 235 | " }}} 236 | 237 | " Searching {{{ 238 | set ignorecase smartcase " Case insensitive search, but if used uppercase use case sensitive 239 | set hlsearch " Highlight every presence of search prhrase 240 | set incsearch " Highlight search phrase on the fly 241 | 242 | nnoremap :nohlsearch " turn off search highlight 243 | " }}} 244 | 245 | set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_ 246 | set ttyfast 247 | 248 | " TABS & IDNENTS 249 | """"""""""""""""""" 250 | set noexpandtab " Don't expand TABs into SPACEs 251 | set matchtime=5 " blink matching paren for 500ms 252 | 253 | " leader shortcuts {{{ 254 | map t :CommandT " commandt 255 | map n :next " next window 256 | map p :prev " prev window 257 | map tc :tabnew! % " new tab 258 | map tn :tabnext " next tab 259 | map tp :tabprev " prev tab 260 | map te :tabedit " open tab and edit file 261 | map tq :tabclose " close tab 262 | map tm :tabmove " move tab 263 | nmap c :cal CopyToSystemClipboardToggle() " toggle system clipboard 264 | nmap p :cal PasteToggle() " toggle paste 265 | nmap l :cal ListToggle() " toggle list 266 | nmap n :cal NumberToggle() " toggle number 267 | nmap w :cal LineWrapToggle() " toggle line 268 | nmap m :cal MouseToggle() " toggle mouse 269 | noremap W :w !sudo tee % > /dev/null " save file as root 270 | vnoremap s :sort 271 | " }}} 272 | 273 | vmap gs y'>p:'[,']-1s/$/+/\|'[,']+1j!'[0"wy$:.s§.*§\=w§'[yyP:.s/./=/g_j 274 | 275 | "{{{ vimpager only settings and overwrites 276 | if exists('g:vimpager.enabled') 277 | let vimpager_passthrough=1 278 | "let g:less = { 'enabled': 1 } " less compatibility mode 279 | let g:vimpager.ansiesc = 1 280 | autocmd BufRead * AnsiEsc 281 | set nornu 282 | set nu 283 | endif 284 | "}}} 285 | 286 | set t_BE= 287 | 288 | let g:CommandTPreferredImplementation='lua' 289 | let g:rainbow_active = 0 "0 if you want to enable it later via :RainbowToggle 290 | let g:rainbow_conf={ 291 | \ 'guifgs': ['royalblue3', 'darkorange3', 'seagreen3', 'firebrick'], 292 | \ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], 293 | \ 'operators': '_,_', 294 | \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'], 295 | \ 'separately': { 296 | \ '*': {}, 297 | \ } 298 | \} 299 | 300 | " vim:foldmethod=marker:foldlevel=0 301 | -------------------------------------------------------------------------------- /.xmonad/xmonad.hs: -------------------------------------------------------------------------------- 1 | import XMonad 2 | import XMonad.Hooks.DynamicLog 3 | import XMonad.Hooks.ManageDocks 4 | import XMonad.Layout.NoBorders 5 | import XMonad.Layout.Circle -- circle layout 6 | import XMonad.Layout.Tabbed -- tabbed layout 7 | import XMonad.Layout.ShowWName -- shows workspace name 8 | --import DBus.Client.Simple 9 | --mport System.Taffybar.XMonadLog (dbusLogWithPP, taffybarPP) 10 | import System.IO 11 | import System.Exit 12 | import System.Process 13 | 14 | import qualified XMonad.StackSet as W 15 | import qualified Data.Map as M 16 | 17 | import XMonad.Util.Run(spawnPipe) 18 | 19 | myTerminal = "uxterm" 20 | myBorderWidth = 2 21 | myModMask = mod4Mask 22 | 23 | -- The mask for the numlock key. Numlock status is "masked" from the 24 | -- current modifier status, so the keybindings will work with numlock on or 25 | -- off. You may need to change this on some systems. 26 | -- You can find the numlock modifier by running "xmodmap" and looking for a 27 | -- modifier with Num_Lock bound to it: 28 | -- > $ xmodmap | grep Num 29 | -- > mod2 Num_Lock (0x4d) 30 | -- Set numlockMask = 0 if you don't have a numlock key, or want to treat 31 | -- numlock status separately. 32 | myNumlockMask = mod2Mask 33 | 34 | -- The default number of workspaces (virtual screens) and their names. 35 | -- By default we use numeric strings, but any string may be used as a 36 | -- workspace name. The number of workspaces is determined by the length 37 | -- of this list. 38 | -- 39 | -- A tagging example: 40 | -- > workspaces = ["web", "irc", "code" ] ++ map show [4..9] 41 | myWorkspaces = ["1","2","3","4","5","6","7","8","9"] 42 | 43 | -- Border colors for unfocused and focused windows, respectively. 44 | -- 45 | myNormalBorderColor = "#bd96bd" 46 | myFocusedBorderColor = "#ff208c" 47 | 48 | ------------------------------------------------------------------------ 49 | -- Key bindings. Add, modify or remove key bindings here. 50 | myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ 51 | [ ((modMask .|. shiftMask , xK_Return ), spawn $ XMonad.terminal conf) -- launch a terminal 52 | , ((modMask , xK_p ), spawn "gmrun") -- launch gmrun 53 | , ((modMask .|. shiftMask , xK_p ), spawn "exe=`dmenu_run` && eval \"exec $exe\"") -- launch dmenu 54 | , ((modMask .|. shiftMask , xK_c ), kill) -- Close focused window 55 | , ((modMask , xK_space ), sendMessage NextLayout) -- Rotate through the available layout algorithms 56 | , ((modMask .|. shiftMask , xK_space ), setLayout $ XMonad.layoutHook conf) -- Reset the layouts on the current workspace to default 57 | , ((modMask , xK_n ), refresh) -- Resize viewed windows to the correct size 58 | , ((mod1Mask , xK_Tab ), windows W.focusDown) -- Move focus to the next window 59 | , ((modMask , xK_j ), windows W.focusDown) -- Move focus to the next window 60 | , ((modMask , xK_k ), windows W.focusUp) -- Move focus to the previous window 61 | , ((mod1Mask .|. shiftMask , xK_Tab ), windows W.focusUp) -- Move focus to the previous window 62 | , ((modMask , xK_m ), windows W.focusMaster) -- Move focus to the master window 63 | , ((modMask , xK_Return ), windows W.swapMaster) -- Swap the focused window and the master window 64 | , ((modMask .|. shiftMask , xK_j ), windows W.swapDown) -- Swap the focused window with the next window 65 | , ((modMask .|. shiftMask , xK_k ), windows W.swapUp) -- Swap the focused window with the previous window 66 | , ((modMask , xK_h ), sendMessage Shrink) -- Shrink the master area 67 | , ((modMask , xK_l ), sendMessage Expand) -- Expand the master area 68 | , ((modMask , xK_t ), withFocused $ windows . W.sink) -- Push window back into tiling 69 | , ((modMask , xK_comma ), sendMessage (IncMasterN 1)) -- Increment the number of windows in the master area 70 | , ((modMask , xK_period ), sendMessage (IncMasterN (-1))) -- Deincrement the number of windows in the master area 71 | , ((modMask , xK_q ), restart "xmonad" True) -- XMonad restart 72 | , ((modMask .|. shiftMask , xK_q ), io (exitWith ExitSuccess)) -- XMonad quit 73 | , ((modMask .|. shiftMask , xK_b ), spawn "killall -s SIGUSR1 xmobar &> /dev/null") -- Switch xmobar to next screen 74 | , ((modMask , xK_x ), spawn "xscreensaver-command -lock") -- lock session with xscreensaver 75 | , ((0 , 0x1008ff2f), spawn "sudo hibernate-ram &> /dev/null") -- hibernate 76 | -- , ((modMask , xK_w ), spawn "wpa_cli scan reassociate") -- scan for wi-fi networks and reassociate 77 | , ((modMask .|. shiftMask , xK_v ), spawn "pavucontrol &> /dev/null") -- run pavucontrol 78 | , ((0 , xK_Print ), spawn "scrot -q 100 /tmp/screen_%Y-%m-%d.png -d 1") -- Take screenshot 79 | -- Audio control: lower,raise,mute 80 | , ((0 , 0x1008FF11), spawn "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system (\"pacmd \"$1\" \"$2\" \"$3-1000)}'") 81 | , ((0 , 0x1008FF13), spawn "pacmd dump|awk --non-decimal-data '$1~/set-sink-volume/{system (\"pacmd \"$1\" \"$2\" \"$3+1000)}'") 82 | , ((0 , 0x1008FF12), spawn "pacmd dump|awk --non-decimal-data '$1~/set-sink-mute/{system (\"pacmd \"$1\" \"$2\" \"($3==\"yes\"?\"no\":\"yes\"))}'") 83 | ] 84 | ++ 85 | 86 | -- mod-[1..9], Switch to workspace N 87 | -- mod-shift-[1..9], Move client to workspace N 88 | [((m .|. modMask, k), windows $ f i) 89 | | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] 90 | , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] 91 | ++ 92 | 93 | -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 94 | -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 95 | [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f)) 96 | | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..] 97 | , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] 98 | 99 | 100 | ------------------------------------------------------------------------ 101 | -- Mouse bindings: default actions bound to mouse events 102 | myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ 103 | 104 | [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w)) -- mod-button1, Set the window to floating mode and move by dragging 105 | , ((modMask, button2), (\w -> focus w >> windows W.swapMaster)) -- mod-button2, Raise the window to the top of the stack 106 | , ((modMask, button3), (\w -> focus w >> mouseResizeWindow w)) -- mod-button3, Set the window to floating mode and resize by dragging 107 | ] 108 | 109 | ------------------------------------------------------------------------ 110 | -- Layouts: 111 | myLayout = tiled ||| Mirror tiled ||| smartBorders Full ||| Circle ||| simpleTabbed 112 | where 113 | tiled = Tall nmaster delta ratio -- default tiling algorithm partitions the screen into two panes 114 | nmaster = 1 -- The default number of windows in the master pane 115 | ratio = 3/4 -- Default proportion of screen occupied by master pane 116 | delta = 25/1000 -- Percent of screen to increment by when resizing panes 117 | 118 | ------------------------------------------------------------------------ 119 | -- Window rules: 120 | myManageHook = composeAll 121 | [ className =? "MPlayer" --> doFloat -- Mplayer 122 | , title =? "Firefox Preferences" --> doFloat -- Firefox Preferences 123 | , title =? "Firefox Add-on Updates" --> doFloat -- Firefox Add-ons 124 | , title =? "Clear Private Data" --> doFloat -- Firefox Clear private data 125 | , title =? "Certificate Manager" --> doFloat -- Firefox Certificate manager 126 | , className =? "Gimp" --> doFloat -- Gimp 127 | , className =? "serverpropertiesdialog" --> doFloat -- Opera Site Preferences 128 | , className =? "ApacheDirectoryStudio" --> doFloat -- Apache Directory Studio splash 129 | , resource =? "desktop_window" --> doIgnore 130 | , resource =? "kdesktop" --> doIgnore 131 | , className =? "opera" --> doShift "1" ] -- Start opera at 1st desktop 132 | 133 | -- Whether focus follows the mouse pointer. 134 | myFocusFollowsMouse :: Bool 135 | myFocusFollowsMouse = True 136 | 137 | ------------------------------------------------------------------------ 138 | -- Status bars and logging 139 | myLogHook = dynamicLogWithPP $ xmobarPP { 140 | ppTitle = xmobarColor "green" "" . shorten 70, 141 | ppHiddenNoWindows = xmobarColor "grey" "" 142 | } 143 | ------------------------------------------------------------------------ 144 | -- Startup hook 145 | 146 | -- Perform an arbitrary action each time xmonad starts or is restarted 147 | -- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize 148 | -- per-workspace layout choices. 149 | 150 | myStartupHook = return () 151 | 152 | ------------------------------------------------------------------------ 153 | -- Now run xmonad with all the defaults we set up. 154 | 155 | -- Run xmonad with the settings you specify. No need to modify this. 156 | -- main = xmonad defaults 157 | -- myBar = "xmobar" 158 | main = xmonad =<< xmobar defaults 159 | 160 | -- A structure containing your configuration settings, overriding 161 | -- fields in the default config. Any you don't override, will 162 | -- use the defaults defined in xmonad/XMonad/Config.hs 163 | defaults = defaultConfig { 164 | terminal = myTerminal, 165 | focusFollowsMouse = myFocusFollowsMouse, 166 | borderWidth = myBorderWidth, 167 | modMask = myModMask, 168 | workspaces = myWorkspaces, 169 | normalBorderColor = myNormalBorderColor, 170 | focusedBorderColor = myFocusedBorderColor, 171 | keys = myKeys, 172 | mouseBindings = myMouseBindings, 173 | layoutHook = showWName myLayout, 174 | manageHook = myManageHook, 175 | logHook = myLogHook, 176 | startupHook = myStartupHook 177 | } 178 | -------------------------------------------------------------------------------- /.neomutt/neomuttrc.bindings: -------------------------------------------------------------------------------- 1 | #macro compose ,m \ 2 | #"set pipe_decode\ 3 | #pandoc -f gfm -t plain -o /tmp/msg.txt\ 4 | #pandoc -s -f gfm -t html5 -o /tmp/msg.html\ 5 | #unset pipe_decode\ 6 | #/tmp/msg.txt\ 7 | #/tmp/msg.html\ 8 | #\ 9 | #\ 10 | #" \ 11 | #"Convert markdown gfm to HTML and MIME" #attach plain toggled inline,attach html, toggle inline,change MIME,delete original, merge both parts, delete description 12 | 13 | # 14 | # # this should replace the other ,m macro 15 | #macro compose ,m \ 16 | # "set pipe_decode\ 17 | # pandoc -f gfm -t plain -o /tmp/msg.txt\ 18 | # pandoc -s -f gfm -t html5 -o /tmp/msg.html\ 19 | # unset pipe_decode\ 20 | # /tmp/msg.txt\ 21 | # /tmp/msg.html\ 22 | # " \ 23 | # "markdown to html" 24 | 25 | macro compose ,m \ 26 | "set pipe_decode\ 27 | pandoc -f gfm -t plain -o /tmp/msg.txt\ 28 | pandoc -s -f gfm -t html5 -o /tmp/msg.html\ 29 | set pipe_decode=$my_pipe_decodea^U/tmp/msg.txt\n^Da^U/tmp/msg.html\n^D^T^Utext/html; charset=utf-8\n=DTT&d^U\n" \ 30 | "Convert markdown gfm to HTML and MIME" #attach plain toggled inline,attach html, toggle inline,change MIME,delete original, merge both parts, delete description 31 | 32 | macro index,pager,attach,compose \cb \ 33 | "set pipe_decode \ 34 | lynx -dump -listonly -stdin \ 35 | set pipe_decode=$my_pipe_decode" \ 36 | "call urlview to extract URLs out of a message" 37 | #urlview \ 38 | 39 | macro index,pager \ 40 | "source $my_bindir/search_glab_n_jira.sh|" \ 41 | "Search term in headers" 42 | 43 | macro index,pager \ 44 | "set my_tmp_search=/tmp/.neomutt_search \ 45 | setenv MY_TMP_SEARCH=$my_tmp_search \ 46 | $my_bindir/search_similar.sh \ 47 | source $my_tmp_search \ 48 | rm $MY_TMP_SEARCH \ 49 | unset my_tmp_search \ 50 | unsetenv MY_TMP_SEARCH" \ 51 | "Search messages like this" 52 | 53 | macro index,pager,browser _ \ 54 | "read" \ 55 | "Display normal screen" 56 | 57 | macro index,pager,browser \\ \ 58 | "$my_bindir/sync.d/sync verbose" \ 59 | "Sync mail" 60 | 61 | # Neomutt sidecar {{{ 62 | macro attach ,te \ 63 | "set pipe_decode \ 64 | tmux splitw -h -p 50 -I \ 65 | set pipe_decode=$my_pipe_decode" \ 66 | "pipe message to sidecar" 67 | 68 | macro index,pager ,te \ 69 | "set pipe_decode \ 70 | $my_bindir/sidecar_router.sh \ 71 | set pipe_decode=$my_pipe_decode" \ 72 | "run action and display in sidear" 73 | 74 | macro attach,index,pager ,tq \ 75 | "tmux killp -t :1.2" \ 76 | "close neomutt sidecar" 77 | # }}} 78 | 79 | # Jira macros {{{ 80 | macro index,pager ,jO \ 81 | "set pipe_decode \ 82 | $my_bindir/jira.sh open \ 83 | set pipe_decode=$my_pipe_decode" \ 84 | "Jira open task referenced in the message in the browser" 85 | 86 | macro index,pager ,jv \ 87 | "set pipe_decode \ 88 | $my_bindir/jira.sh view \ 89 | set pipe_decode=$my_pipe_decode" \ 90 | "Jira view task referenced in the message in tmux split" 91 | 92 | macro index,pager ,jd "+jindraj +done -inbox -unread" "Mark jira ticket done" 93 | macro index,pager ,ji "+jindraj +invalid -inbox -unread" "Mark jira ticket invalid" 94 | # }}} 95 | 96 | # {{{ GitLab macros 97 | macro index,pager ,gp \ 98 | "set pipe_decode \ 99 | $my_bindir/gitlab.sh cicd_view \ 100 | set pipe_decode=$my_pipe_decode" \ 101 | "open gitlab project in web browser" 102 | 103 | macro index,pager ,go \ 104 | "set pipe_decode \ 105 | $my_bindir/gitlab.sh open \ 106 | set pipe_decode=$my_pipe_decode" \ 107 | "display gitlab CI/CD pipeline" 108 | # }}} 109 | 110 | # Account switching {{{ 111 | macro compose,index,pager \ 112 | "source $my_cfgdir/neomuttrc.profile-personal\ 113 | echo ' Switched to personal profile '" \ 114 | "switch to personal profile" 115 | 116 | macro compose,index,pager \ 117 | "source $my_cfgdir/neomuttrc.profile-personal-jj\ 118 | echo ' Switched to jj profile '" \ 119 | "switch to personal jj profile" 120 | 121 | macro compose,index,pager \ 122 | "source $my_cfgdir/neomuttrc.profile-personal-cockli\ 123 | echo ' Switched to cock.li profile '" \ 124 | "switch to cock-li imap profile" 125 | 126 | macro compose,index,pager \ 127 | "source $my_cfgdir/neomuttrc.profile-work\ 128 | echo ' Switched to work profile [cookielab] '" \ 129 | "switch to work profile [cookielab]" 130 | 131 | macro compose,index,pager \ 132 | "source $my_cfgdir/neomuttrc.profile-work-mailstep\ 133 | echo ' Switched to work profile [mailstep] '" \ 134 | "switch to work profile [mailstep]" 135 | # }}} 136 | 137 | # notmuch window search {{{ 138 | macro index 0 \ 139 | "reset nm_query_window_duration\ 140 | reset nm_query_window_enable\ 141 | ^\ 142 | echo \"Notmuch query window turned off\"" \ 143 | "Turn off window duration" 144 | 145 | macro index \' \ 146 | "set nm_query_window_duration+=1\ 147 | source $my_cfgdir/neomuttrc.profile-common\ 148 | ^\ 149 | echo \"Incread query window\"" \ 150 | "Increase window duration" 151 | 152 | macro index \" \ 153 | "set nm_query_window_duration-=1\ 154 | source $my_cfgdir/neomuttrc.profile-common\ 155 | ^\ 156 | echo \"Decreased query window\"" \ 157 | "Decrease window duration" 158 | 159 | macro index > \ 160 | "\ 161 | source $my_cfgdir/neomuttrc.profile-common\ 162 | echo \"Shifted window forwards\"" \ 163 | "shifts virtual folder time window backwards" 164 | 165 | macro index < \ 166 | "\ 167 | source $my_cfgdir/neomuttrc.profile-common\ 168 | echo \"Shifted window backwards\"" \ 169 | "shifts virtual folder time window forwards" 170 | 171 | macro index,pager ,< \ 172 | 'lua-source $my_cfgdir/lua/rotate_window_timebase.lua' \ 173 | "rotate over window search timebases" 174 | # }}} 175 | 176 | bind index,pager a group-reply 177 | bind index,pager g noop 178 | bind index gg first-entry 179 | bind index G last-entry 180 | bind index,pager j next-entry 181 | bind index,pager k previous-entry 182 | bind index,pager K extract-keys 183 | bind index collapse-thread 184 | bind index,pager + entire-thread 185 | 186 | bind editor complete 187 | #bind editor complete-query 188 | bind editor \CT transpose-chars 189 | 190 | bind index,pager vfolder-from-query 191 | bind index,pager ,l modify-tags 192 | macro index,pager ,a "-unread -inbox" "Archive message" 193 | macro index,pager ,s "-unread -inbox -deleted +spam" "Mark message as spam" 194 | macro index,pager H "" "Hide message" 195 | macro index,pager gc "^" "Go to current mailbox" 196 | macro index,pager gi "!" "Go to Inbox" 197 | macro index,pager gs "GMail/flagged" "Go to starred" 198 | macro index,pager gt "GMail/sent" "Go to sent" 199 | macro index,pager gd "$postponed" "Go to drafts" 200 | macro index,pager ga "archives/today" "Go to archives" 201 | macro index - "-" "Go to previous folder" 202 | 203 | macro index,pager S "mailboxes ^" "Add current mailbox (vfolder-from-query) to the sidebar for this session" 204 | 205 | macro index,pager go \ 206 | "formail -x message-id -z | sed 's,^,https://mail.google.com/mail/u/0/#search/rfc822msgid:,' | xargs open" \ 207 | "Open message in GMail" 208 | 209 | folder-hook !notmuch ' \ 210 | unmacro index,pager d; \ 211 | bind index,pager d delete-message' 212 | 213 | folder-hook notmuch ' \ 214 | unbind index,pager d; \ 215 | macro index,pager d \ 216 | "-unread -inbox -spam +trash" \ 217 | "Move message to trash"' 218 | 219 | macro index,pager gn \ 220 | "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" $(formail -x message-id -z | tr -d '<>' | python3 -c 'import sys,urllib.parse; print(urllib.parse.quote_plus(sys.stdin.read()));' | sed 's,^,https://localhost:3443/show?query=id:,') &>/dev/null" \ 221 | "Open message in noservice" 222 | 223 | # vim:foldmethod=marker:foldlevel=0:ft=neomuttrc 224 | -------------------------------------------------------------------------------- /.bash_functions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function aws_session_validity(){ 4 | local expiration_ts now_ts expires_in 5 | [[ $AWS_SESSION_EXPIRATION ]] || return 6 | expiration_ts=$(date -j -f "%FT%T%z" "${AWS_SESSION_EXPIRATION%:*}${AWS_SESSION_EXPIRATION##*:}" '+%s') 7 | now_ts=$(date +%s) 8 | 9 | expires_in=$((expiration_ts - now_ts)) 10 | 11 | if [[ $expires_in -ge 1800 ]] 12 | then 13 | printf ✅ 14 | elif [[ $expires_in -lt 1800 && $expires_in -gt 300 ]] 15 | then 16 | printf ⚠️ 17 | elif [[ $expires_in -lt 300 && $expires_in -gt 0 ]] 18 | then 19 | printf ‼️ 20 | else 21 | printf ❌ 22 | fi 23 | } 24 | 25 | function _jj(){ 26 | find . -type f -name '_jj*' | fzf --exact --select-1 -i ${@:+--query "$*"} | xargs view 27 | } 28 | 29 | function webcamsnap(){ 30 | local outputfile 31 | outputfile="$(mktemp).jpg" 32 | ffmpeg -ss 00:00:00 -f avfoundation -r 30.000030 -i "0" -t 1 -frames:v 1 -q:v 2 "$outputfile" 33 | printf 'Snapshot saved to:\n%s\n' "$outputfile" 34 | } 35 | 36 | function functionfinder(){ 37 | shopt -s extdebug 38 | declare -F "$1" 39 | shopt -u extdebug 40 | } 41 | 42 | function doh(){ 43 | local doh_url="${DOH_BASE_URL:-https://cloudflare-dns.com/dns-query}" 44 | 45 | doh_url=$(trurl --url "$doh_url" --append "query=name=$1") 46 | [[ -n $2 ]] && doh_url=$(trurl --url "$doh_url" --append "query=type=$2") 47 | 48 | curl -H "accept: application/dns-json" "$doh_url" 49 | } 50 | 51 | function cdfzf(){ 52 | local __projectdir 53 | __projectdir=$( 54 | find "$HOME/$__rootdir" -type d -execdir test -d {}/.git \; -prune -print \ 55 | | fzf --exact --select-1 -i ${@:+--query "$*"} 56 | ) 57 | cd "$__projectdir" || return 58 | } 59 | 60 | function ,mstp(){ 61 | ,cklb "gitlab.com/mailstep" "${@:-}" 62 | } 63 | 64 | function ,cklb(){ 65 | local -x __rootdir="${FUNCNAME[0]/,/}" 66 | cdfzf "$@" 67 | } 68 | 69 | function ,projects(){ 70 | local -x __rootdir="${FUNCNAME[0]/,/}" 71 | cdfzf "$@" 72 | } 73 | 74 | function ,sbks(){ 75 | local -x __rootdir="${FUNCNAME[0]/,/}" 76 | cdfzf "$@" 77 | } 78 | 79 | # {{{ terraform 80 | function tfkubeconfig(){ # get kubeconfig from terraform output and save it as .kubeconfig.NAME 81 | terraform output --json "$1" | jq .kubeconfig | yq e . > ".kubeconfig.$1" 82 | } 83 | 84 | function tf(){ # terraform wrapper with environment picker 85 | local TF_cmd=$1 86 | shift 87 | local -x TF_CLI_ARGS 88 | 89 | if [[ -d ./variables ]] 90 | then 91 | var_file=$(find ./variables -type f | fzf -1 -q "$@") 92 | tf_environment=$(awk -F '"' '/^environment[[:space:]]/ { print $2}' "$var_file") 93 | TF_CLI_ARGS+=" -var-file=$var_file" 94 | export TF_WORKSPACE=$tf_environment 95 | direnv allow 96 | eval "$(direnv export bash)" 97 | unset TF_WORKSPACE 98 | fi 99 | terraform "$TF_cmd" 100 | unset TF_CLI_ARGS 101 | } 102 | 103 | function tfa(){ # terraform apply wrapper utilizing tf() 104 | tf apply "$@" 105 | } 106 | 107 | function tfp(){ # terraform plan wrapper utilizing tf() 108 | tf plan "$@" 109 | } 110 | 111 | function tfpnl(){ # terraform plan -lock=false wrapper utilizing tf() 112 | local -x TF_CLI_ARGS_plan="-lock=false" 113 | tfp "$@" 114 | } 115 | # }}} 116 | 117 | __local_getMFA () { 118 | totp "$1" 119 | } 120 | export -f __local_getMFA 121 | 122 | # {{{ Functions used in PS1. 123 | function ec(){ # get exitcode 124 | local EC=$? 125 | [[ "$EC" -eq 0 || "$EC" -eq 130 ]] && return 126 | printf '\x01%b\x02[\x01%b\x02\x01%b\x02%d\x01%b\x02\x01%b\x02]\x01%b\x02' "$__c1" "$crst" '\e[1;31m' "$EC" "$crst" "$__c1" "$crst" 127 | } 128 | 129 | function aws_ps1(){ 130 | [[ -z $AWS_PROFILE || $AWS_PROFILE == 'default' || ${AWS_PROFILE@a} != *x* ]] && return 131 | printf "\x01%b\x02[\x01%b\x02\x01%b\x02%s\x01%b\x02\x01%b\x02]\x01%b\x02" "$__c1" "$crst" '\e[1;31m' "$AWS_PROFILE" "$crst" "$__c1" "$crst" 132 | } 133 | 134 | function nr_sessions(){ # get number of tmux+screen sessions 135 | local TMUX_SESSIONS SCREEN_SESSIONS 136 | TMUX_SESSIONS=$(tmux list-sessions 2> /dev/null | wc -l) 137 | SCREEN_SESSIONS=$(screen -list 2> /dev/null | grep -c $'\t') 138 | [[ $TERM == screen* ]] && SCREEN_SESSIONS=$(( SCREEN_SESSIONS - 1 )) 139 | (( SCREEN_SESSIONS + TMUX_SESSIONS == 0 )) && return 140 | printf '\x01%b\x02[\x01%b\x02%d\x01%b\x02]\x01%b\x02' "$__c1" "$crst" "$(( SCREEN_SESSIONS + TMUX_SESSIONS ))" "$__c1" "$crst" 141 | } 142 | # }}} 143 | 144 | function source_all_files_from_dir(){ 145 | [[ ! -d "$1" ]] && return 146 | local comp 147 | for comp in "$1/"${2:-*} 148 | do 149 | # shellcheck source=/dev/null 150 | [[ -f $comp ]] && source "$comp" 151 | done 152 | } 153 | 154 | function totp(){ gopass totp -o "$1" ; } 155 | export -f totp 156 | 157 | function totpc(){ gopass totp -c "$1" ; } 158 | 159 | function aws_pick_profile(){ 160 | export AWS_PROFILE 161 | AWS_PROFILE=$(aws configure list-profiles | fzf --sort) 162 | } 163 | 164 | function aws_add_creds(){ 165 | aws configure set "profile.$1.aws_access_key_id" "$2" 166 | aws configure set "profile.$1.aws_secret_access_key" "$3" 167 | printf 1>&2 'Created aws profile %s and swithced to it temporarily' "$1" 168 | aws sts get-caller-identity && export AWS_PROFILE=$1 169 | } 170 | 171 | function aws_ips(){ 172 | local region=$1 service=$2 filter 173 | if [[ $region && $service ]] 174 | then 175 | filter=".prefixes[]|select((.network_border_group==\"$region\") and .service==\"$service\")" 176 | elif [[ $service ]] 177 | then 178 | filter=".prefixes[]|select(.service==\"$service\")" 179 | elif [[ $region ]] 180 | then 181 | filter=".prefixes[]|select(.network_border_group==\"$region\")" 182 | else 183 | filter="" 184 | fi 185 | curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq "$filter" 186 | } 187 | 188 | function gl_path(){ 189 | p 627f2c5 <<<" 190 | \set QUIET on 191 | \timing off 192 | \t 193 | \a 194 | \f '\t' 195 | \set QUIET off 196 | SELECT n.path AS namespace, 197 | p.path AS project, 198 | concat('/srv/git/repositories/'||disk_path||'.git') AS path 199 | FROM project_repositories pr 200 | LEFT JOIN projects p ON p.id=pr.project_id 201 | LEFT JOIN namespaces n ON n.id=p.namespace_id 202 | WHERE concat(n.path||'/'||p.path) LIKE '%$1%' ORDER BY 1,2" | column -t 203 | } 204 | 205 | function hf(){ # history fuzzy search 206 | local -a cmds 207 | local cmd 208 | local -x FZF_DEFAULT_OPTS 209 | FZF_DEFAULT_OPTS+='--preview "/bin/echo {} | fold -w $COLUMNS" ' 210 | FZF_DEFAULT_OPTS+='--preview-window=down:33% ' 211 | FZF_DEFAULT_OPTS+='--multi ' 212 | FZF_DEFAULT_OPTS+='--print0 ' 213 | FZF_DEFAULT_OPTS+='--tac ' 214 | FZF_DEFAULT_OPTS+='--bind="esc:execute(pbcopy <<<{})" ' 215 | FZF_DEFAULT_OPTS+='--header="When multiple commands selected with [TAB] they'\''re executed in the same oreder as selected"' 216 | readarray -d '' -t cmds < <(cat ~/.bash_history_files/* | fzf) 217 | for cmd in "${cmds[@]}" 218 | do 219 | $cmd 220 | done 221 | } 222 | 223 | function kk(){ ps -ef | fzf -m --preview='cat {}' --preview-window down,wrap | awk '{print $2}' | xargs kill; } 224 | 225 | function dt(){ date -j -f %Y%m%d%H%M%S "$1" +%s; } # date time to ts 226 | 227 | function td(){ date -j -f %s "$1" +'%F %R:%S'; } # ts to date time 228 | 229 | function cd_wifi(){ 230 | local ip 231 | ip=$(dig +short cdwifi.cz "@$(route -n get default | awk '/gateway/{printf $2}')") 232 | curl "http://$ip/portal/api/vehicle/gateway/user/authenticate?category=internet&url=http%3A%2F%2Fcdwifi.cz%2Fportal%2Fapi%2Fvehicle%2Fgateway%2Fuser%2Fsuccess&onerror=http%3A%2F%2Fcdwifi.cz%2Fportal%2Fapi%2Fvehicle%2Fgateway%2Fuser%2Ferror" \ 233 | -H 'Host: cdwifi.cz' \ 234 | -H 'Accept: application/json' \ 235 | -H 'Referer: http://cdwifi.cz/captive' \ 236 | --compressed \ 237 | -INSsk 238 | 239 | while : 240 | do 241 | curl "http://$ip/portal/api/vehicle/gateway/user" | jq 242 | sleep 300 243 | done 244 | } 245 | 246 | function zlatestranky(){ 247 | local pattern=$1 248 | [[ -z $pattern ]] && { cat -; return; } 249 | shift 250 | [[ ${#FUNCNAME[*]} -eq 1 ]] && { 251 | rg -z -i "$pattern" "$HOME/Downloads/fb_cz.txt.gz" | zlatestranky "$@" 252 | return 253 | } 254 | rg -i "$pattern" | zlatestranky "$@" 255 | } 256 | 257 | function __wifiqr_complete(){ 258 | readarray -t ssids < <( 259 | security dump-keychain | \ 260 | grep 'AirPort network password' -B4 | \ 261 | awk -F= '/acct/ {print $2}' 262 | ) 263 | complete -W "${ssids[*]}" wifiqr 264 | } 265 | 266 | function wifiqr(){ qrencode -t ANSIUTF8 -o - "WIFI:T:WPA;S:$*;P:$(security find-generic-password -D 'AirPort network password' -a "$*" -w);;"; } 267 | 268 | function ldapaudit(){ 269 | local filter 270 | [[ "$#" -eq 0 ]] && printf 'usage: %s timeRangeHigherThen [timeRangeLowerThen] [filter]\ntimeRanges are in YYYYMMDDHHMMSS.uuuuuuZ\nFilter is &ed with the timeranges filter (&(timeRangeHigherThen)(timeRangeLowerThen)(filter))\a\n' "$0" && return 271 | [[ "$#" -eq 1 ]] && filter="reqStart>=$1" 272 | [[ "$#" -eq 2 ]] && filter="(&(reqstart>=$1)(reqStart<=$2))" 273 | [[ "$#" -ge 3 ]] && filter="(&(reqstart>=$1)(reqStart<=$2)$3)" 274 | ldapsearch -W -S reqStart -bcn=accesslog "$filter" reqStart reqMod reqDn reqType 275 | } 276 | 277 | function sshmux(){ ssh -vt "${1:-hopnode}" 'tmux attach || tmux'; } 278 | 279 | function moshmux(){ TERM=xterm-256color mosh "${1:-hopnode}" tmux attach; } 280 | 281 | function removedia(){ iconv -f utf8 -t ascii//TRANSLIT | sed 's/[^a-zA-Z 0-9,]//g'; } 282 | 283 | function hst2(){ # create histogram from output of `uniq -c` 284 | local -x RATIO=${1:-1} 285 | awk '{print $1" "$2}' | perl -e ' 286 | use POSIX; 287 | while(<>){ 288 | chomp; 289 | my @a=split(/ /); 290 | print $a[1] . " " . "█" x (ceil($a[0]/$ENV{'RATIO'})) . "\n"; 291 | }' 292 | } 293 | 294 | function hst(){ 295 | local -x RATIO=${1:-1} 296 | awk '{print $1" "$2}' | perl -e ' 297 | use POSIX; 298 | while(<>){ 299 | chomp; 300 | my @a=split(/ /); 301 | print $a[1] . " " . "+" x (ceil($a[0]/$ENV{'RATIO'})) . "\n"; 302 | }' 303 | } 304 | 305 | function psg(){ pgrep -i -a -l -f "$@"; } 306 | 307 | function odjebat(){ ssh-keygen -R "$1" && ssh -o 'StrictHostKeyChecking=no' "$1"; } 308 | 309 | function genpasswd(){ LC_CTYPE=C tr -dc '[:print:]' < /dev/urandom | head -c "${1:-20}"; } # password generator 310 | 311 | function rpbcopy(){ # copy to system clipboard from remote hosts 312 | printf '\033]1337;CopyToClipboard=;\a' 313 | cat - 314 | pintf '\033]1337;EndCopy\a' 315 | } 316 | 317 | function prefix(){ # prefix stdout with date,time or whatever you want 318 | local prefix= 319 | function __prefix_helper(){ 320 | case $1 in 321 | "ts") prefix=$(date +%s) ;; 322 | "date") prefix=$(date +%Y-%m-%dT%H:%M:%S) ;; 323 | "time") prefix=$(date +%H:%M:%S) ;; 324 | *) prefix="$1" ;; 325 | esac 326 | [[ "$2" = "-n" ]] || prefix="$(echo -e "\\x01\\e[1;37m\\x02${prefix}\\x01\\e[0m\\x02:\t")" 327 | } 328 | 329 | while read -r 330 | do 331 | __prefix_helper "$@" 332 | printf '%s%s\n' "$prefix" "$REPLY" 333 | done 334 | } 335 | 336 | function keychain_get_internet_password(){ # not using anymore 337 | [[ $# -ne 2 ]] && { printf 'usage:\n %s \n' "${FUNCNAME[0]}"; return 1; } 338 | security find-internet-password -gs "$1" -a "$2" -w | tr -d '\n' 339 | } 340 | 341 | function proxy(){ 342 | local proxyport=1080 343 | local proxyhost=127.0.0.1 344 | local sshhost=hopnode 345 | 346 | function __proxy_unset(){ 347 | unset all_proxy no_proxy 348 | sed -i "" '/_proxy=/d' ~/.bash_local 349 | } 350 | 351 | function __proxy_export(){ 352 | export all_proxy=socks://$proxyhost:$proxyport/ 353 | export no_proxy=localhost,127.0.0.1,::1,ccl 354 | cat <<-EOF >> ~/.bash_local 355 | export all_proxy=socks://$proxyhost:$proxyport/ 356 | export no_proxy=localhost,127.0.0.1,::1,ccl 357 | EOF 358 | } 359 | 360 | function __proxy_start(){ 361 | ssh $sshhost -o VisualHostKey=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PermitLocalCommand=no -Nfnaxqv -M -S /tmp/ssh_proxy_sock -D $proxyport 2>/tmp/ssh_proxy_stats && \ 362 | networksetup -setsocksfirewallproxy Wi-Fi $proxyhost $proxyport # -setproxybypassdomains localhost 127.0.0.1 ::1 ccl&& \ 363 | printf '\e[1;32mProxy started\e[0m\n' 364 | } 365 | 366 | function __proxy_stop(){ 367 | ssh $sshhost -o VisualHostKey=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PermitLocalCommand=no -q -S /tmp/ssh_proxy_sock -O exit > /dev/null && \ 368 | networksetup -setsocksfirewallproxystate Wi-Fi off -setproxybypassdomains Empty && \ 369 | printf '\e[0;33mProxy statistics:\e[0m\n' 370 | tail /tmp/ssh_proxy_stats | grep -e second -e compress --color=no 371 | rm /tmp/ssh_proxy_stats 372 | printf '\e[1;31mProxy stopped\e[0m\n' 373 | } 374 | 375 | function __proxy_status(){ 376 | printf '\e[0;33mSystem SOCKS5 configuration:\e[0m\n' 377 | networksetup -getsocksfirewallproxy Wi-Fi 378 | printf '\e[0;33mbash environment variables:\e[0m\n' 379 | env | grep --colour=never "_proxy=" || true 380 | printf '\e[0;33mssh dynamic tunnel:\e[0m\n' 381 | ssh $sshhost -o VisualHostKey=no -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PermitLocalCommand=no -q -S /tmp/ssh_proxy_sock -O check || true 382 | } 383 | 384 | function __proxy_help(){ 385 | cat <<-EOF 386 | proxy 387 | 388 | start: start ssh dynamic tunnel, enable socks5 proxy, export variables 389 | stop: stop ssh tunnel, disable socks5 proxy , unset variables 390 | status: print information about proxying 391 | clean: unset variables 392 | EOF 393 | } 394 | 395 | case "$1" in 396 | "status") 397 | __proxy_status;; 398 | "clean") 399 | __proxy_unset;; 400 | "start") 401 | __proxy_start 402 | __proxy_export 403 | __proxy_status;; 404 | "stop") 405 | __proxy_stop 406 | __proxy_unset 407 | __proxy_status;; 408 | *) 409 | __proxy_help;; 410 | esac 411 | __proxy_help 412 | printf "\a" 413 | return 1 414 | } 415 | export -f \ 416 | ec \ 417 | nr_sessions 418 | # vim:foldmethod=indent:foldlevel=0:tabstop=4:shiftwidth=4:softtabstop=0:noexpandtab 419 | --------------------------------------------------------------------------------