dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit cca884b02e2cbf5634d6228f8fd5628d365e5bf9
parent 84bf3956f042159d7b74508dbecd6ff9495794c5
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sat,  9 Mar 2019 12:17:15 -0500

vifm default file manager w/ ├╝berzug

Diffstat:
A.config/vifm/colors/luke.vifm | 33+++++++++++++++++++++++++++++++++
M.config/vifm/vifmrc | 38++++++++++++++++++++------------------
M.profile | 2+-
A.scripts/tools/vifmimg | 13+++++++++++++
A.scripts/tools/vu | 15+++++++++++++++
5 files changed, 82 insertions(+), 19 deletions(-)

diff --git a/.config/vifm/colors/luke.vifm b/.config/vifm/colors/luke.vifm @@ -0,0 +1,33 @@ +highlight clear +highlight Win cterm=none ctermfg=white ctermbg=black +highlight Directory cterm=bold ctermfg=cyan ctermbg=default +highlight Link cterm=bold ctermfg=blue ctermbg=default +highlight BrokenLink cterm=bold ctermfg=red ctermbg=default +highlight Socket cterm=bold ctermfg=magenta ctermbg=default +highlight Device cterm=bold ctermfg=red ctermbg=default +highlight Fifo cterm=bold ctermfg=cyan ctermbg=default +highlight Executable cterm=bold ctermfg=green ctermbg=default +highlight Selected cterm=bold ctermfg=magenta ctermbg=default +highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default +highlight TopLine cterm=none ctermfg=black ctermbg=white +highlight TopLineSel cterm=bold ctermfg=black ctermbg=default +highlight StatusLine cterm=bold ctermfg=black ctermbg=blue +highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black +highlight CmdLine cterm=none ctermfg=white ctermbg=black +highlight ErrorMsg cterm=none ctermfg=red ctermbg=black +highlight Border cterm=none ctermfg=white ctermbg=black +highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white +highlight SuggestBox cterm=bold ctermfg=default ctermbg=default +highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red +highlight AuxWin cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight TabLine cterm=none ctermfg=white ctermbg=black +highlight TabLineSel cterm=bold,reverse ctermfg=default ctermbg=default +highlight User1 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User2 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User3 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User4 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User5 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User6 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User7 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User8 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default +highlight User9 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc @@ -9,6 +9,7 @@ map <C-o> <C-w>o map <C-s> <C-w>s map <C-v> <C-w>v +map R :restart<CR> map x :!sxiv -ft * 2>/dev/null &<CR> nnoremap o :file &<cr>l map E :!$EDITOR %f<CR> @@ -17,30 +18,22 @@ map bg :!setbg %f &<CR> nmap <space> tj nmap q ZQ -fileviewer *.html,*.css,*.py,*.c,*.h,*.sh,*.diff,*.tex highlight -O ansi %c +fileviewer *.html,*.css,*.py,*.c,*.h,*.sh,*.diff,*.tex,*.md highlight -O ansi %c fileview */ tree %c -L 1 --dirsfirst fileview ../ tree %c -L 1 --dirsfirst set vicmd=$EDITOR -set syscalls - -set nofollowlinks +fileviewer *.docx docx2txt %c - -" Natural sort of (version) numbers within text. +filetype *.csv,*.xlsx sc-im %c +set syscalls +set nofollowlinks set sortnumbers - -" Maximum number of changes that can be undone. - set undolevels=100 - -colorscheme Default - +colorscheme luke set wildmenu - -" Display completions in a form of popup with descriptions of the matches - set wildstyle=popup " Display suggestions in normal, visual and view modes for keys, marks and @@ -78,13 +71,18 @@ endif " %m run the command in a menu window filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu zathura %f 2>/dev/null &, -fileviewer *.pdf pdftotext -nopgbrk %c - +fileviewer *.pdf pdftotext -l 1 -nopgbrk %c - " Audio -filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) %c +filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display --input-ipc-server=/tmp/mpvsoc$(date +%%s) %c +fileviewer *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mediainfo %c filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx] mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) %f 2>/dev/null &, -fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx],*mp3,*.flac mediainfo %c 2>&1 & +"fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx],*mp3,*.flac echo %c is a video file. + +fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, *.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx vifmimg videopreview %px %py %pw %ph %c %pc vifmimg clear + +fileview *.zip,*.rar,*.tar.gz atool -l %f filextype *.html,*.htm firefox %f 2>/dev/null & @@ -94,7 +92,11 @@ filetype *.[1-8] man ./%c fileviewer *.[1-8] man ./%c | col -b filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm rotdir %f 2>/dev/null | sxiv -ia 2>/dev/null & -fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm file %f +"fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm file %f +fileviewer *.jpg,*.jpeg,*.png + \ vifmimg draw %px %py %pw %ph %c + \ %pc + \ vifmimg clear filextype *.svg inkscape %f 2>/dev/null & filextype *.xcf gimp %f 2>/dev/null & diff --git a/.profile b/.profile @@ -7,7 +7,7 @@ export EDITOR="nvim" export TERMINAL="st" export BROWSER="firefox" export READER="zathura" -export FILE="ranger" +export FILE="vu" export BIB="$HOME/Documents/LaTeX/uni.bib" export REFER="$HOME/Documents/referbib" export SUDO_ASKPASS="$HOME/.scripts/tools/dmenupass" diff --git a/.scripts/tools/vifmimg b/.scripts/tools/vifmimg @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +[ -z "$FIFO_UEBERZUG" ] && exit + +readonly ID_PREVIEW="preview" + +if [ "$1" = "draw" ]; then + declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="${PWD}/$6") > "$FIFO_UEBERZUG" +elif [ "$1" = "videopreview" ]; then + [ ! -f "/tmp/$6.png" ] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp/$6.png" -s 0 -q 10 && + declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="/tmp/$6.png") > "$FIFO_UEBERZUG" +else + declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") > "$FIFO_UEBERZUG" +fi diff --git a/.scripts/tools/vu b/.scripts/tools/vu @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}" + +cleanup() { + rm "$FIFO_UEBERZUG" 2>/dev/null + pkill -P $$ 2>/dev/null +} + +rm "$FIFO_UEBERZUG" 2>/dev/null +mkfifo "$FIFO_UEBERZUG" +trap cleanup EXIT +tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash & + +vifm +cleanup