From a1ad651a07ae57ac452b23df595e2807ba32a3ec Mon Sep 17 00:00:00 2001 From: TiynGER Date: Wed, 20 Nov 2019 22:09:06 +0100 Subject: [PATCH 1/6] fixing some outdated software settings --- .config/#additionalinstall/thinkpadspecific.sh | 2 +- .config/aliasrc | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) mode change 100644 => 100755 .config/#additionalinstall/thinkpadspecific.sh diff --git a/.config/#additionalinstall/thinkpadspecific.sh b/.config/#additionalinstall/thinkpadspecific.sh old mode 100644 new mode 100755 index e03aa7d..6141cde --- a/.config/#additionalinstall/thinkpadspecific.sh +++ b/.config/#additionalinstall/thinkpadspecific.sh @@ -1,5 +1,5 @@ #!/bin/sh -sudo yay -S thinkfan lm_sensors +yay -S thinkfan lm_sensors sudo modprobe thinkpad_acpi sudo cp /usr/share/doc/thinkfan/examples/thinkfan.conf.simple /etc/thinkfan.conf systemctl enable thinkfan diff --git a/.config/aliasrc b/.config/aliasrc index 4e8fbf8..7ae7ae0 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -28,9 +28,6 @@ sd() { find ~/ownCloud/* -type f | grep ".pdf" | fzf | xargs -r $READER ;} # grep alias grep="grep --color=auto" -# lastpass -alias lastpass="lpass" - # ls(d) alias l="lsd" alias la="lsd -la" From d98e161dc27b12da1d6b162700e2d4b9bee73c97 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Wed, 20 Nov 2019 22:09:59 +0100 Subject: [PATCH 2/6] more outdated variables --- .config/profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/profile b/.config/profile index aca0aee..46dc920 100644 --- a/.config/profile +++ b/.config/profile @@ -18,7 +18,7 @@ export VIDEO="mpv" export AUDIO="mpv" export TABLE="sc-im" export IMAGE="sxiv" -export LATEX="code" +export LATEX="vim" export MAIL="thunderbird" export MUSIC="ncmpcpp" From a77dc27cbbdb26298bf43ffebdb51d2a033946cc Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sat, 23 Nov 2019 11:02:54 +0100 Subject: [PATCH 3/6] adding pdf and image preview to vifm --- .config/profile | 4 ++-- .config/vifm/vifmrc | 14 +++++++++-- .local/bin/vifm/vifmimg | 53 +++++++++++++++++++++++++++++++++++++++++ .local/bin/vifm/vifmrun | 15 ++++++++++++ 4 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 .local/bin/vifm/vifmimg create mode 100644 .local/bin/vifm/vifmrun diff --git a/.config/profile b/.config/profile index 46dc920..2ca2b5e 100644 --- a/.config/profile +++ b/.config/profile @@ -7,7 +7,7 @@ export EDITOR="nvim" export TERMINAL="st" export BROWSER="firefox" export READER="zathura" -export FILE="vifm" +export FILE="vifmrun" export SUDO_ASKPASS="$HOME/.local/bin/tools/dmenupass" export NOTMUCH_CONFIG="$HOME/.config/notmuch-config" export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0" @@ -18,7 +18,7 @@ export VIDEO="mpv" export AUDIO="mpv" export TABLE="sc-im" export IMAGE="sxiv" -export LATEX="vim" +export LATEX="nvim" export MAIL="thunderbird" export MUSIC="ncmpcpp" diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 6a2ee3f..db45627 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -172,7 +172,11 @@ command! reload :write | restart " Pdf filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c -fileviewer *.pdf pdftotext -nopgbrk %c - +fileviewer *.pdf + \ vifmimg pdfpreview %px %py %pw %ph %c + \ %pc + \ vifmimg clear + "\ pdftotext -nopgbrk %c - " PostScript filextype *.ps,*.eps,*.ps.gz @@ -238,7 +242,13 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm \ {View in shotwell} \ shotwell, fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm - \ identify %f + \ vifmimg draw %px %py %pw %ph %c + \ %pc + \ vifmimg clear +fileviewer *.gif + \ vifmimg gifpreview %px %py %pw %ph %c + \ %pc + \vifmimg clear " OpenRaster filextype *.ora diff --git a/.local/bin/vifm/vifmimg b/.local/bin/vifm/vifmimg new file mode 100644 index 0000000..e5d8763 --- /dev/null +++ b/.local/bin/vifm/vifmimg @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +readonly ID_PREVIEW="preview" + +#AUTO_REMOVE="yes" +# By enabling this option the script will remove the preview file after it is drawn +# and by doing so the preview will always be up-to-date with the file. +# This however, requires more CPU and therefore affects the overall performance. + +if [ -e "$FIFO_UEBERZUG" ]; then + if [[ "$1" == "draw" ]]; then + declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" + [x]="$2" [y]="$3" [width]="$4" [height]="$5" \ + [path]="${PWD}/$6") \ + > "$FIFO_UEBERZUG" + + elif [[ "$1" == "videopreview" ]]; then + echo -e "Loading preview..\nFile: $6" + [[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/" + [[ ! -f "/tmp${PWD}/$6.png" ]] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp${PWD}/$6.png" -s 0 -q 10 + declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" + [x]="$2" [y]="$3" [width]="$4" [height]="$5" \ + [path]="/tmp${PWD}/$6.png") \ + > "$FIFO_UEBERZUG" + + elif [[ "$1" == "gifpreview" ]]; then + echo -e "Loading preview..\nFile: $6" + [[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/" && convert -coalesce "${PWD}/$6" "/tmp${PWD}/$6/$6.png" + for frame in $(ls -1 /tmp${PWD}/$6/$6*.png | sort -V); do + declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" + [x]="$2" [y]="$3" [width]="$4" [height]="$5" \ + [path]="$frame") \ + > "$FIFO_UEBERZUG" + # Sleep between frames to make the animation smooth. + sleep .07 + done + + elif [[ "$1" == "pdfpreview" ]]; then + echo -e "Loading preview..\nFile: $6" + [[ ! -d "/tmp${PWD}/$6/" ]] && mkdir -p "/tmp${PWD}/$6/" + [[ ! -f "/tmp${PWD}/$6.png" ]] && pdftoppm -png -singlefile "$6" "/tmp${PWD}/$6" + declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" + [x]="$2" [y]="$3" [width]="$4" [height]="$5" \ + [path]="/tmp${PWD}/$6.png") \ + > "$FIFO_UEBERZUG" + + elif [[ "$1" == "clear" ]]; then + declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \ + > "$FIFO_UEBERZUG" + [[ ! -z $AUTO_REMOVE ]] && [[ -f "/tmp${PWD}/$6.png" ]] && rm -f "/tmp${PWD}/$6.png" + [[ ! -z $AUTO_REMOVE ]] && [[ -d "/tmp${PWD}/$6/" ]] && rm -rf "/tmp${PWD}/$6/" + + fi +fi diff --git a/.local/bin/vifm/vifmrun b/.local/bin/vifm/vifmrun new file mode 100644 index 0000000..9eda32a --- /dev/null +++ b/.local/bin/vifm/vifmrun @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}" + +function 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 From 2ef7f1fc767c5039a695d9154d3195b3bda6324b Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sat, 23 Nov 2019 11:09:41 +0100 Subject: [PATCH 4/6] changing opening of files in vifm --- .config/vifm/vifmrc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index db45627..1bbe44c 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -218,12 +218,8 @@ fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, " Web filextype *.html,*.htm - \ {Open with dwb} - \ dwb %f %i &, \ {Open with firefox} \ firefox %f &, - \ {Open with uzbl} - \ uzbl-browser %f %i &, filetype *.html,*.htm links, lynx " Object @@ -236,11 +232,7 @@ fileviewer *.[1-8] man ./%c | col -b " Images filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm \ {View in sxiv} - \ sxiv %f, - \ {View in gpicview} - \ gpicview %c, - \ {View in shotwell} - \ shotwell, + \ sxiv -ia %c %d &, fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm \ vifmimg draw %px %py %pw %ph %c \ %pc From 32c33284cadd721483b4a3d320d3a572f133a31f Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sat, 23 Nov 2019 11:17:41 +0100 Subject: [PATCH 5/6] adding icons to vifm --- .config/vifm/vifmrc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 1bbe44c..ca20149 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -395,6 +395,25 @@ set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, " ------------------------------------------------------------------------------ + +" GETTING ICONS TO DISPLAY IN VIFM +" You need the next 14 lines! + +" file types +set classify=' :dir:/, :exe:, :reg:, :link:' +" various file names +set classify+=' ::../::, ::*.sh::, ::*.[hc]pp::, ::*.[hc]::, ::/^copying|license$/::, ::.git/,,*.git/::, ::*.epub,,*.fb2,,*.djvu::, ::*.pdf::, ::*.htm,,*.html,,**.[sx]html,,*.xml::' +" archives +set classify+=' ::*.7z,,*.ace,,*.arj,,*.bz2,,*.cpio,,*.deb,,*.dz,,*.gz,,*.jar,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.rz,,*.tar,,*.taz,,*.tb2,,*.tbz,,*.tbz2,,*.tgz,,*.tlz,,*.trz,,*.txz,,*.tz,,*.tz2,,*.xz,,*.z,,*.zip,,*.zoo::' +" images +set classify+=' ::*.bmp,,*.gif,,*.jpeg,,*.jpg,,*.ico,,*.png,,*.ppm,,*.svg,,*.svgz,,*.tga,,*.tif,,*.tiff,,*.xbm,,*.xcf,,*.xpm,,*.xspf,,*.xwd::' +" audio +set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::' +" media +set classify+=' ::*.avi,,*.ts,,*.axv,,*.divx,,*.m2v,,*.m4p,,*.m4v,,.mka,,*.mkv,,*.mov,,*.mp4,,*.flv,,*.mp4v,,*.mpeg,,*.mpg,,*.nuv,,*.ogv,,*.pbm,,*.pgm,,*.qt,,*.vob,,*.wmv,,*.xvid::' +" office files +set classify+=' ::*.doc,,*.docx::, ::*.xls,,*.xls[mx]::, ::*.pptx,,*.ppt::' + " Sample mappings " Start shell in current directory From c98e4a1d17cd95936f34b81ef9aa3ea6b607eb92 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sat, 23 Nov 2019 12:03:05 +0100 Subject: [PATCH 6/6] minor changes to vifm --- .config/vifm/vifmrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index ca20149..77d0ba5 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -12,8 +12,6 @@ " you will need to change this setting. set vicmd=nvim -" set vicmd=elvis\ -G\ termcap -" set vicmd=vile " This makes vifm perform file operations on its own instead of relying on " standard utilities like `cp`. While using `cp` and alike is a more universal @@ -70,7 +68,7 @@ colorscheme Default " TIME_STAMP_FORMAT=%m/%d-%H:%M " See man date or man strftime for details. -set timefmt=%m/%d\ %H:%M +set timefmt=%d.%m.%y\ %H:%M " Show list of matches on tab completion in command-line mode