Added newsboat

Update init.vim
This commit is contained in:
Uttarayan Mondal
2021-05-05 12:45:03 +05:30
parent 946c5d5d42
commit 2e750ef16d
6 changed files with 398 additions and 146 deletions

59
local/bin/news Executable file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/env bash
PID=$$
export ID=$PID
DIR=/tmp/ueberzug_$PID
export UFIFO=$DIR/ufifo
# MAX_COLUMNS=60
IMAGE=$1
function cleanup {
# remove_image
stop_ueberzug
if [ -d "$DIR" ];then
rm -r $DIR
fi
exit
}
if [ ! -d "$DIR" ];then
mkdir $DIR
fi
source $(ueberzug library)
function start_ueberzug {
mkfifo $UFIFO
ImageLayer --silent <"$UFIFO" &
exec 3>"$UFIFO"
}
function stop_ueberzug {
exec 3>&-
rm $UFIFO &> /dev/null
}
# function set_image {
# x_size=$(tput cols)
# y_size=$(tput lines)
# MAX_COLUMNS=$(($x_size/5))
# x=$(($x_size-$MAX_COLUMNS-5))
# y=$(($y_size-5))
# echo $x $y
# ImageLayer::add [identifier]="$ID" [x]="${x}" [y]="${y}" \
# [max_width]="${MAX_COLUMNS}" \
# [path]="$@" \
# >"$UFIFO"
# }
# function remove_image {
# ImageLayer::remove [identifier]="$ID" \
# >"$UFIFO"
# }
trap cleanup EXIT
start_ueberzug
newsboat
cleanup