Commit 5c5f36b8 authored by Joris's avatar Joris

Set up ssh with gpg agent

parent 06f5c846
#!/usr/bin/env bash
PID=$(ps -ef | sed 1d | eval "fzf ${FZF_DEFAULT_OPTS} -m --header='[kill:process]'" | awk '{print $2}')
if [ "x$PID" != "x" ]
then
echo $PID | xargs kill -${1:-9}
kp
fi
#!/bin/sh
#!/usr/bin/env bash
function type_password() {
KEY="$1"
PASSWORD=$(pass show "$KEY" 2>/dev/null)
......
......@@ -3,8 +3,7 @@ for FILEPATH in ~/pictures/capture/*
do
FILE_OLD=$(expr $(date +%s) - $(stat -c %Y "$FILEPATH"))
DAY_DURATION="$((24 * 60 * 60))"
if [[ "$FILE_OLD" -gt "$DAY_DURATION" ]]
then
if [[ "$FILE_OLD" -gt "$DAY_DURATION" ]]; then
rm "$FILEPATH"
fi
done
urxvt*scrollBar: false
! Use Nerd Font variants ?
! urxvt*font: xft:source code pro:size=12
urxvt*font: xft:Inconsolata:size=13
! urxvt*font: xft:Hasklig:size=10
! urxvt*font: xft:Fira Code:size=11
urxvt*intensityStyles: false
urxvt*perl-ext-common: font-size
urxvt*keysym.C-minus: perl:font-size:decrease
urxvt*keysym.C-plus: perl:font-size:increase
urxvt*font-size.step: 4
urxvt.perl-ext: default,url-select
urxvt.keysym.C-i: perl:url-select:select_next
urxvt.url-select.launcher: qutebrowser
urxvt.url-select.underline: true
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintlight
! Xft.dpi: 120
! Solarized color theme
#define S_yellow #b58900
......@@ -31,22 +53,6 @@
#define S_base2 #073642
#define S_base3 #002b36
! Urxvt
urxvt*scrollBar: false
urxvt*font: xft:Inconsolata:size=13
! urxvt*font: xft:Hasklig:size=10
! urxvt*font: xft:Fira Code:size=11
urxvt*intensityStyles: false
urxvt*perl-ext-common: font-size
urxvt*keysym.C-minus: perl:font-size:decrease
urxvt*keysym.C-plus: perl:font-size:increase
urxvt*font-size.step: 4
urxvt.perl-ext: default,url-select
urxvt.keysym.C-i: perl:url-select:select_next
urxvt.url-select.launcher: qutebrowser
urxvt.url-select.underline: true
urxvt*background: S_base03
urxvt*foreground: S_base0
urxvt*fadeColor: S_base03
......@@ -70,9 +76,3 @@ urxvt*color12: S_base0
urxvt*color13: S_violet
urxvt*color14: S_base1
urxvt*color15: S_base3
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintlight
! Xft.dpi: 120
fish_vi_key_bindings
fish_vi_key_bindings 2>/dev/null # Prevent projectile errors in spacemacs
set fish_greeting
......@@ -7,15 +7,27 @@ set PATH ~/.bin ~/.cargo/bin $PATH
set -x LANG "en_US.UTF-8"
set -x EDITOR "nvim"
set -x TZ "Europe/Paris"
set -x GPG_TTY '(tty)'
set -x SSH_AUTH_SOCK '(gpgconf --list-dirs agent-ssh-socket)'
set -x GPG_AGENT_INFO ""
set -x FZF_DEFAULT_COMMAND 'ag --hidden --ignore .git -g ""'
set -x PASSWORD_STORE_DIR "$HOME/passwords"
set -x FZF_DEFAULT_COMMAND 'rg --files --hidden -g "!**/{.git,.git-crypt}/*"'
alias edit "nvim"
alias open "rifle"
alias abook "abook --datafile $HOME/documents/backup/contacts"
alias hl "highlight -O ansi --force"
gpgconf --launch gpg-agent
direnv hook fish | source
# Reload gpg agent with: gpg-connect-agent reloadagent /bye
#######
# GPG #
#######
# Bind gpg-agent to this TTY if gpg commands are used.
set -x GPG_TTY (tty)
# SSH agent protocol doesn't support changing TTYs, so bind the agent to every new TTY.
gpg-connect-agent --quiet updatestartuptty /bye > /dev/null
# SSH support
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
# Exec at startup
exec --no-startup-id hsetroot -solid "#FDF6E3"
exec --no-startup-id wmname LG3D
# exec --no-startup-id wmname LG3D
exec --no-startup-id xset -dpms && xset s off
exec --no-startup-id mpd
exec --no-startup-id xss-lock -- i3lock -n -c 222222
# TODO: Ask at startup for GPG-password
......@@ -108,7 +107,7 @@ new_window pixel 4
hide_edge_borders both
# Disable floating windows (use [.]* to disable every floating window)
# for_window [class="Connman System Tray"] floating disable
for_window [class="Connman System Tray"] floating disable
bar {
font pango:Monospace 9
......@@ -133,15 +132,16 @@ bindsym $mod+q mode $mode_system
# bindsym $mod+e mode "resize"
bindsym $mod+l mode "light"
set $mode_application "(t)erm (f)irefox (q)utebrowser (g)imp (r)anger (m)ail (p)layer (c)apture (u)pdate (d)ownload (s)wap (n)etwork"
set $mode_application "(t)erm (e)ditor (f)irefox (q)utebrowser (g)imp (r)anger (m)ail (p)layer (c)apture (u)pdate (d)ownload (s)wap (n)etwork"
mode $mode_application {
bindsym t exec --no-startup-id $term; mode "default"
bindsym e exec --no-startup-id $termCommand nvim; mode "default"
bindsym f exec --no-startup-id firefox; mode "default"
bindsym q exec --no-startup-id qutebrowser; mode "default"
bindsym g exec --no-startup-id gimp; mode "default"
bindsym r exec --no-startup-id $termCommand ranger; mode "default"
bindsym m exec --no-startup-id $termCommand neomutt; mode "default"
bindsym n exec --no-startup-id cmst --disable-tray-icon --disable-minimize; mode "default"
bindsym n exec --no-startup-id $termCommand nmtui; mode "default"
# bindsym p exec gmpc; mode "default"
# Volume control
......
......@@ -9,18 +9,18 @@ interval=1
# [song]
# command=~/.systray/current-song
# [wifi]
# command=~/.systray/wifi
[radio]
command=~/.systray/radio
[ethernet]
command=~/.systray/ethernet
# [ethernet]
# command=~/.systray/ethernet
[wifi]
command=~/.systray/wifi
[caps-lock]
command=~/.systray/caps-lock
[radio]
command=~/.systray/radio
[screencast]
command=~/.systray/screencast-status
......
......@@ -103,5 +103,4 @@ set editor="/run/current-system/sw/bin/nvim"
# Colorscheme
# source colors/gruvbox.muttrc
source colors/solarized.muttrc
source colors.muttrc
......@@ -45,27 +45,27 @@ noremap gÉ :exe "silent! tablast"<CR>
" optionnel : {g"} pour aller au début de la ligne écran
noremap g" g0
" Chiffres en accès direct
noremap " 1
noremap 1 "
noremap « 2
noremap 2 <
noremap » 3
noremap 3 >
noremap ( 4
noremap 4 (
noremap ) 5
noremap 5 )
noremap @ 6
noremap 6 @
noremap + 7
noremap 7 +
noremap - 8
noremap 8 -
noremap / 9
noremap 9 /
noremap * 0
noremap 0 *
" " Chiffres en accès direct
" noremap " 1
" noremap 1 "
" noremap « 2
" noremap 2 <
" noremap » 3
" noremap 3 >
" noremap ( 4
" noremap 4 (
" noremap ) 5
" noremap 5 )
" noremap @ 6
" noremap 6 @
" noremap + 7
" noremap 7 +
" noremap - 8
" noremap 8 -
" noremap / 9
" noremap 9 /
" noremap * 0
" noremap 0 *
" Page movements
noremap é <C-b>
......
......@@ -2,11 +2,12 @@
" -------
call plug#begin('~/.vim/plugged')
"Plug '907th/vim-auto-save'
Plug 'bling/vim-airline'
Plug 'Chiel92/vim-autoformat'
Plug 'bling/vim-airline'
Plug 'chriskempson/base16-vim'
Plug 'dhruvasagar/vim-table-mode'
Plug 'diepm/vim-rest-console'
Plug 'direnv/direnv.vim'
Plug 'djoshea/vim-autoread'
Plug 'godlygeek/tabular'
Plug 'iCyMind/NeoSolarized'
......@@ -15,21 +16,20 @@ Plug 'ldong/vim_loremipsum'
Plug 'lokaltog/vim-easymotion'
Plug 'nbouscal/vim-stylish-haskell'
Plug 'neovimhaskell/haskell-vim'
Plug 'plasticboy/vim-markdown'
Plug 'sbdchd/neoformat'
Plug 'scrooloose/nerdtree'
Plug 'tomtom/tcomment_vim'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
" Language
Plug 'ElmCast/elm-vim'
Plug 'LnL7/vim-nix'
Plug 'derekwyatt/vim-scala'
Plug 'groenewege/vim-less'
Plug 'ElmCast/elm-vim'
Plug 'leafgarland/typescript-vim'
Plug 'plasticboy/vim-markdown'
Plug 'raichoo/purescript-vim'
Plug 'rust-lang/rust.vim'
Plug 'wavded/vim-stylus'
......@@ -54,8 +54,8 @@ set nojoinspaces
set smartindent
" Colors
colorscheme NeoSolarized
set background=dark
colorscheme NeoSolarized
" Numbering
set number relativenumber
......@@ -120,33 +120,54 @@ set secure " disallows :autocmd, shell and write commands in local .nvimrc files
" Personal mappings
" -----------------
function! GetProjectDir()
" -C option is not required if we have the autochdir option enabled
" let gitDir = systemlist("git -C " . expand('%:p:h') . " rev-parse --show-toplevel")[0]
" lcd %:p:h
let gitDir = systemlist("git rev-parse --git-dir")[0]
" let gitDir = systemlist("git -C " . expand('%:p:h') . " rev-parse --git-dir")[0]
if empty(matchstr(gitDir, '^fatal:.*'))
return gitDir . "/.."
else
return '~'
endif
endfunction
" Set leader key as space
let mapleader=" "
" Shortcuts
nnoremap <silent> <Leader>q :quit<return>
nnoremap <silent> <Leader>s :wa<return>
nnoremap <silent> <Leader>k :bdelete<return>
nnoremap <silent> <Leader>w <C-w>
nnoremap <silent> <Leader>b <C-^>
nnoremap <silent> <Leader>w <C-w>
nnoremap <silent> <Leader>w- :split<return>
nnoremap <silent> <Leader>w/ :vsplit<return>
nnoremap <silent> <Leader>n :nohlsearch<return>
nnoremap <silent> <Leader>t :NERDTreeFind<return>
nnoremap <silent> <Leader>r :so $MYVIMRC<return>
" Search
nnoremap <silent> <Leader>p :Files<return>
nnoremap <silent> <Leader>: :Commands<return>
nnoremap <silent> <Leader>fa :Ag<return>
nnoremap <silent> <Leader>fc :Commits<return>
nnoremap <silent> <Leader>ff :Filetypes<return>
nnoremap <silent> <Leader>ft :call fzf#vim#tags("'".expand('<cword>'))<cr>
" nnoremap <silent> <Leader>fy :Tags<return>
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --hidden -g "!**/{.git,.git-crypt}/*" --no-heading --color=always --smart-case '.shellescape(<q-args>),
\ 0,
\ { 'dir': GetProjectDir()},
\ <bang>0)
nnoremap <silent> <Leader>p :call fzf#run(fzf#wrap({'dir': GetProjectDir()}))<cr>
nnoremap <silent> <Leader>l :Rg<return>
nnoremap <silent> <Leader>ft :Filetypes<return>
nnoremap <silent> <Leader>fa :call fzf#run(fzf#wrap({'dir': '~'}))<return>
" Git shortcuts
nnoremap <silent> <Leader>gb :Gblame<return>
nnoremap <silent> <Leader>gs :Gstatus<return>
nnoremap <silent> <Leader>gc :Gcommit<return>
nnoremap <silent> <Leader>gd :Gvdiff<return>
nnoremap <silent> <Leader>ge :Gedit<return>
" Vimgrep shortcuts
set wildignore+=**/bower_components/**,**/node_modules/**,**vendor/bundle**
......@@ -181,35 +202,6 @@ nmap <Leader>e <Plug>(easymotion-s)
" Turn on case sensitive feature
" let g:EasyMotion_smartcase = 1
" Surround
" --------
let g:surround_no_mappings=1
" Disable s in visual (bepo conflict)
xmap <Leader>s <Plug>Vsurround
" Switch cs for ls
nmap ls <Plug>Csurround
" As is
nmap ds <Plug>Dsurround
nmap ys <Plug>Ysurround
nmap yS <Plug>YSurround
nmap yss <Plug>Yssurround
nmap ySs <Plug>YSsurround
nmap ySS <Plug>YSsurround
xmap S <Plug>VSurround
xmap gS <Plug>VgSurround
if maparg('s', 'x') ==# ''
xnoremap <silent> s :<C-U>echoerr 'surround.vim: Visual mode s has been removed in favor of S'<CR>
endif
if !hasmapto("<Plug>Isurround","i") && "" == mapcheck("<C-S>","i")
imap <C-S> <Plug>Isurround
endif
imap <C-G>s <Plug>Isurround
imap <C-G>S <Plug>ISurround
" Abolish
" -------
......@@ -241,7 +233,7 @@ autocmd FileType * autocmd BufWritePre <buffer> :call StripEmptyEndLines()
let g:vim_markdown_folding_disabled = 1
" scala
" Scala
" -----
autocmd FileType scala map <buffer> <Leader>i :SortScalaImports<return>
......@@ -275,12 +267,6 @@ let g:cabal_indent_section = 2
let NERDTreeShowHidden=1
" Auto-save
" ---------
"let g:auto_save = 1
"let g:auto_save_silent = 1
" Table mode
" ----------
......@@ -291,3 +277,33 @@ let g:table_mode_corner='|'
let g:elm_format_autosave = 1
autocmd FileType elm setlocal shiftwidth=4 softtabstop=4 expandtab
" Project directory
" -----------------
" set autochdir
autocmd BufEnter * silent! lcd %:p:h
" function! SetupProjectDirectory()
"
" " let gitDir = systemlist("git -C " . expand('%:p:h') . " rev-parse --show-toplevel")[0]
" " if empty(matchstr(gitDir, '^fatal:.*'))
" " cd `=gitDir`
" " source .nvimrc
" " else
" " cd %:p:h
" " endif
"
" if !empty(matchstr(expand('%:p:h'), '^/.*'))
" cd %:p:h " Required for direnv to be triggered
" let gitDir = systemlist("git rev-parse --show-toplevel")[0]
" if empty(matchstr(gitDir, '^fatal:.*')) && filereadable(gitDir . "/.nvimrc")
" exec "source " . gitDir . "/.nvimrc"
" endif
" endif
"
" endfunction
"
" autocmd BufEnter * :call SetupProjectDirectory()
" autocmd BufEnter * silent! lcd %:p:h
......@@ -15,7 +15,7 @@ set confirm_on_delete multiple
# Which script is used to generate file previews?
# ranger ships with scope.sh, a script that calls external programs (see
# README for dependencies) to preview images, archives, etc.
set preview_script ~/.config/ranger/scope.sh
# set preview_script ~/.config/ranger/scope.sh
# Use the external preview script or display simple plain text previews?
set use_preview_script true
......
......@@ -14,5 +14,8 @@
[mergetool]
path = nvim
[includeIf "gitdir:~/apps/zen/"]
path = ~/apps/zen/.gitconfig
[core]
excludesfile = ~/.gitignore
[rerere]
enabled = 1
......@@ -4,12 +4,13 @@ tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log
# Gmail
# Mail account
account perso
host mail.gandi.net
port 587
from joris@guyonvarch.me
user joris@guyonvarch.me
# passwordeval "gpg2 --quiet --for-your-eyes-only --no-tty -d passwords/mail.gpg"
passwordeval "pass mail"
account default : perso
......@@ -33,7 +33,9 @@ if [ "$PRESENT" == 1 ]; then
COLOR="#BBBBBB"
fi
echo "<span color='$COLOR'>$ICON $PERCENT%</span>"
if [ "$PERCENT" -lt 95 ]; then
echo "<span color='$COLOR'>$ICON $PERCENT%</span>"
fi
fi
......
......@@ -2,5 +2,5 @@
ESSID="$(nmcli device status | grep ethernet | grep connected)"
if [ -n "$ESSID" ]; then
echo "ETH"
echo " wired"
fi
......@@ -2,5 +2,5 @@
ESSID="$(nmcli device status | grep wifi | grep connected | grep --invert-match disconnected | awk 'NF>1{print $NF}')"
if [ -n "$ESSID" ]; then
echo "$ESSID"
echo "$ESSID"
fi
......@@ -51,6 +51,9 @@ bind -r T resize-pane -D 5
bind -r S resize-pane -U 5
bind -r R resize-pane -R 5
# Create window
bind n new-window
# Reload config
bind L source-file ~/.tmux.conf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment