summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash-powerline.sh2
-rw-r--r--.bashrc9
-rw-r--r--.config/i3/config3
-rw-r--r--.vimrc5
-rwxr-xr-xbin/fpac8
-rwxr-xr-xbin/hdmi3
-rwxr-xr-xbin/icat30
-rwxr-xr-xbin/idot4
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}"
}
diff --git a/.bashrc b/.bashrc
index 229f627..a78d064 100644
--- a/.bashrc
+++ b/.bashrc
@@ -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
diff --git a/.vimrc b/.vimrc
index 79cd484..58841c0 100644
--- a/.vimrc
+++ b/.vimrc
@@ -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)
diff --git a/bin/fpac b/bin/fpac
index db30d36..6207191 100755
--- a/bin/fpac
+++ b/bin/fpac
@@ -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
diff --git a/bin/hdmi b/bin/hdmi
index 75e6f37..0b04531 100755
--- a/bin/hdmi
+++ b/bin/hdmi
@@ -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
diff --git a/bin/icat b/bin/icat
index b15a6d4..702d648 100755
--- a/bin/icat
+++ b/bin/icat
@@ -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:--}
diff --git a/bin/idot b/bin/idot
index d36d947..44387e8 100755
--- a/bin/idot
+++ b/bin/idot
@@ -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