Restructing the entire dotfile repo!

This commit is contained in:
Derek Taylor
2019-01-15 15:27:01 -06:00
parent 57f834c56f
commit 2ff59758f1
131 changed files with 16150 additions and 0 deletions

16
.config/vifm/scripts/imgc Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
W3MIMGDISPLAY="/usr/lib/w3m/w3mimgdisplay"
FONTH=18 # Size of one terminal row
FONTW=9 # Size of one terminal column
X=$1
Y=$2
COLUMNS=$3
LINES=$4
x=$((FONTW * X))
y=$((FONTH * Y))
erase="6;$x;$y;$(( FONTW*COLUMNS ));$(( FONTH*LINES ))\n3;"
echo -e "$erase" | $W3MIMGDISPLAY

38
.config/vifm/scripts/imgt Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
#
# Based on script by z3bra -- 2014-01-21
W3MIMGDISPLAY="/usr/lib/w3m/w3mimgdisplay"
FONTH=18 # Size of one terminal row
FONTW=10 # Size of one terminal column
X=$1
Y=$2
COLUMNS=$3
LINES=$4
FILENAME=$5
read width height <<< `echo "5;$FILENAME" | $W3MIMGDISPLAY`
if [ -z "$width" -o -z "$height" ]; then
echo 'Error: Failed to obtain image size.'
exit 1
fi
x=$((FONTW * X))
y=$((FONTH * Y))
max_width=$((FONTW * COLUMNS))
max_height=$((FONTH * LINES))
if [ "$width" -gt "$max_width" ]; then
height=$((height * max_width / width))
width=$max_width
fi
if [ "$height" -gt "$max_height" ]; then
width=$((width * max_height / height))
height=$max_height
fi
w3m_command="0;1;$x;$y;$width;$height;;;;;$FILENAME\n4;\n3;"
echo -e "$w3m_command" | $W3MIMGDISPLAY