diff options
| author | Marc Vertes <mvertes@free.fr> | 2020-11-01 09:32:20 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2020-11-01 09:32:20 +0100 |
| commit | 3bb7e9d0b1d7bc406bd2361f7484d4484eb483b1 (patch) | |
| tree | 9735fd2e0a2bf83cec9068b453fb9bdf2e7e2378 | |
| parent | aa1f45e33a957098615eca24d0b1b26c03b0eb57 (diff) | |
update
| -rw-r--r-- | .bash-powerline.sh | 2 | ||||
| -rw-r--r-- | .bashrc | 9 | ||||
| -rw-r--r-- | .config/i3/config | 3 | ||||
| -rw-r--r-- | .vimrc | 5 | ||||
| -rwxr-xr-x | bin/fpac | 8 | ||||
| -rwxr-xr-x | bin/hdmi | 3 | ||||
| -rwxr-xr-x | bin/icat | 30 | ||||
| -rwxr-xr-x | bin/idot | 4 |
8 files changed, 51 insertions, 13 deletions
diff --git a/.bash-powerline.sh b/.bash-powerline.sh index ccb7a5d..626157a 100644 --- a/.bash-powerline.sh +++ b/.bash-powerline.sh @@ -89,7 +89,7 @@ __powerline() { [ "$SSH_TTY" ] && PS1=": $host:$cwd$git$symbol" || PS1=": $cwd$git$symbol" } - PROMPT_DIRTRIM=2 + PROMPT_DIRTRIM=1 PROMPT_COMMAND="ps1${PROMPT_COMMAND:+; $PROMPT_COMMAND}" } @@ -32,12 +32,8 @@ fixab() { printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 "$1"; } #export LESS_TERMCAP_us=$(tput setaf 5) # underline (magenta) #export LESS_TERMCAP_ue=$'\E[0m' # end underline -# bat -export BAT_THEME='github' - # gnuplot display in terminal export GNUTERM='sixelgd enhanced truecolor font "arial,9"' -#export GNUTERM='sixelgd enhanced truecolor small' # Stopwatch alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' @@ -60,8 +56,8 @@ alias go14='go1.14.2' alias gob='go build' alias goh='p go help' alias god='p go doc' -alias gtr='go test -run' -alias gtb='go test -cpuprofile cpu.out -memprofile mem.out -benchmem -bench' +alias gtr='go test -v -run' +alias gtb='go test -v -cpuprofile cpu.out -memprofile mem.out -benchmem -bench' #alias vi='vim' alias rvi='sudo vim' alias rxt='sudo xt' @@ -110,3 +106,4 @@ unset base # Display git status in prompt . ~/.bash-powerline.sh +# export PS1='; ' diff --git a/.config/i3/config b/.config/i3/config index 22a61af..9ef0672 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -122,6 +122,9 @@ bindsym $mod+End exec --no-startup-id playerctl stop bindsym $mod+Next exec --no-startup-id playerctl next bindsym $mod+Prior exec --no-startup-id playerctl previous +# Screen shot +bindSym --release Print exec --no-startup-id shot + # jump to urgent bindsym $mod+x [urgent=latest] focus @@ -1,7 +1,7 @@ " set background= set t_te= t_ti= laststatus=2 -syntax on +syntax off filetype on filetype plugin on filetype plugin indent on @@ -9,7 +9,9 @@ let mapleader = "," " vimki plugin let g:vimki_lower = "a-zàçéèêếëîïñôöùûü" +autocmd filetype vimki syntax on autocmd filetype vimki set autowrite +autocmd filetype vimki setlocal spell spelllang=fr " vim-go plugin let g:go_def_mode = "gopls" @@ -17,6 +19,7 @@ let g:go_info_mode = "gopls" let g:go_list_type = "quickfix" let g:go_fmt_command = "goimports" let g:go_metalinter_command = "golangci-lint" +autocmd FileType go syntax on autocmd FileType go nmap <leader>b <Plug>(go-build) autocmd FileType go nmap <leader>i <Plug>(go-info) autocmd FileType go nmap <leader>r <Plug>(go-run) @@ -1,3 +1,9 @@ #!/bin/sh # pacman + fzf -pacman -Slq | fzf --no-clear --multi --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' | xargs -ro sudo pacman -S +#pacman -Slq | fzf --no-clear --multi --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' | xargs -ro sudo pacman -S +pacman -Slq | +fzf --no-clear --multi \ + --bind=left:preview-page-up --bind=right:preview-page-down \ + --preview-window=right:66% \ + --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} 2>/dev/null | awk "! /\/$/ {print \$2}")' | +xargs -ro sudo pacman -S @@ -1,7 +1,8 @@ #!/bin/sh # Toggle auxiliary HDMI screen on/off when connected/disconnected. -opt="--auto --right-of eDP-1" +opt="--auto --left-of eDP-1" +#opt="--auto --right-of eDP-1" #opt="--auto --above eDP-1" # Also add the following rule to /etc/udev/rules.d/hdmi.rules @@ -1,2 +1,28 @@ -#!/bin/sh -exec convert -resize '800x480>' -flatten -- ${1:--} sixel:- +#!/bin/sh -e +# Display images directly in terminal. +# Tested with xterm v361 + +# maxsize prints the geomtry size of terminal window, with +# a maximum value of 1000 pixels for width and height, or +# 640x480 if size can not be probed. +maxsize() { + [ "$WINDOWID" ] || { echo "640x480>"; return; } + xwininfo -id "$WINDOWID" | { + w=1000 h=1000 + while read -r a b; do + case $a in + (Width:) [ $((b < w)) = 1 ] && w=$b ;; + (Height:) [ $((b < h)) = 1 ] && h=$b ;; + esac + done + echo "${w}x$h" + } +} + +# Use convert(1) from imagemagick to output sixel format. +# -flatten uses the terminal background color as transparent layer +# -resize use the terminal size as bounding box, with a limit of 1000 pixels +# image is not resized if smaller than limit +#exec convert -resize "$(maxsize)>" -transparent-color white -flatten -- ${1:--} sixel:- +# color #rrrrggggbbbb +exec convert -resize "$(maxsize)>" -- ${1:--} sixel:${2:--} @@ -1,2 +1,4 @@ #!/bin/sh -dot -Tpng -Gsize=8 "${1:-}" | convert -- - sixel:- +# dot -Gsize=9 -Nshape=box -Nstyle=rounded -Tsvg | convert -- - sixel:/dev/tty +# dot -Gsize=9 -Nfontname=Helvetica -Tsvg | convert -- - sixel:/-dev/tty +dot -Gsize=9 -Nfontname=Arial -Tpng | icat - /dev/tty |
