чень смари какую хуйню я сделал
в showimagemode.cc в дифолтные вюверы добавил preview_worker, который мой самадельный скрепт, патамушто не гребу как еще сделать, шобы оно кастамный скрепт жрало. а вот сам скрепт это мая "гордасть". хуйня канешно но я пездец даволен.
#! /bin/sh
#
# Copyright (C) 2005 Tobias Toedter <t.toedter@gmx.net>
# Portability changes by Ralf Hoffmann <ralf@boomerangsworld.de>
# Copyright (C) 2014 Ralf Hoffmann <ralf@boomerangsworld.de>
# merge with displaywrapper_worker
#
# This file is part of worker.
#
# Worker is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Worker is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Worker; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# we require exactly seven arguments to the script
if [ $# != 7 ]; then
echo "This is the $0 program. It belongs to the worker filemanager."
echo " This is not a standalone program. It will normally be called from"
echo " worker to display pictures in it."
echo " The arguments are:"
echo " 1. X-coordinate"
echo " 2. Y-coordinate"
echo " 3. Width of the area"
echo " 4. Height of the area"
echo " 5. Hex-number of the window"
echo " 6. The filename to show"
echo " 7. The background color in X11-format"
echo
exit
fi
mime="$(file --mime-type --brief "${6}")"
AWK='{
split($2, pieces, /\//)
i=1
printf("#")
for (; i <= length(pieces); i++) {
printf(pieces[i])
}
}
'
if [ ! -d ~/.cache ]; then
mkdir ~/.cache
fi
if [ ! -d ~/.run ]; then
mkdir ~/.run
fi
pidfile=~/.run/worker-preview.pid
cachefile=~/.cache/worker-preview.cache
if [ -f "$pidfile" ]; then
pid="$(cat "$pidfile")"
if [ -d "/proc/$pid" -a -f "$cachefile" -a "$(cat "$cachefile")" = "$6" ]
then
exit
elif [ -d "/proc/$pid" ]; then
kill "$pid"
fi
fi
nyae () {
which "$1" >/dev/null
return $?
}
image () {
info="$(xwininfo -id "0x$5")"
width="$(echo "$info" | awk '/Width:/ {print $2}')"
height="$(echo "$info" | awk '/Height:/ {print $2}')"
size=""
if [ "$width" -ge "$height" ]; then
size="$width"
else
size="$height"
fi
if nyae display; then
display \
-resize "$size" \
-geometry "${3}x${4}+${1}+${2}" \
-window "0x${5}" \
-foreground "$7" \
"${6}" >/tmp/log 2>&1 &
echo $! > "$pidfile"
echo "$6" > "$cachefile"
elif nyae gm; then
gm display \
-size "$size" \
-geometry "${3}x${4}+${1}+${2}" \
-window "0x${5}" \
-foreground "$7" \
"${6}" >/tmp/log 2>&1 &
echo $! > "$pidfile"
echo "$6" > "$cachefile"
else
echo "No supported kartinko prosmotrs4ikov found."
exit 1
fi
}
video () {
if nyae mpv; then
bgr="$(echo "$7" | awk -F: "$AWK")"
echo $bgr > /tmp/log
echo $7 >> /tmp/log
mpv --no-osc \
--background="$bgr" \
--geometry="${3}x${4}+${1}+${2}" \
--loop \
--wid=0x"${5}" "${6}" &
echo $! > "$pidfile"
echo "$6" > "$cachefile"
fi
}
case "$mime" in
image/gif)
count=""
if nyae identify; then
count="$(identify -ping "$6" | wc -l)"
elif nyae gm; then
count="$(gm identify -ping "$6" | wc -l)"
else
echo "Cannot identify $6"
exit 1
fi
if [ "$count" -gt 1 ]; then
video "$@"
else
image "$@"
fi
;;
image*)
image "$@"
;;
video*|audio*)
video "$@"
#which ffmpeg >/dev/null || exit
#im="$(image_viewer)"
#[ -z "$im" ] && exit
#ffmpeg -i "${6}" -c:v png -f image2pipe - |
# $im -geometry "${3}x${4}+${1}+${2}" -window "0x${5}" \
# -foreground "$7" png:-
;;
esac
там я смарю какие-та логи напиханы это я када не мог панять схуяли не работает, поудаляйте сами пашаласта
ваша фартуна на сиводня:
QOTD:
"I'll listen to reason when it comes out on CD."
а мая фартуна в том, што нихуя не работает в плане он все равно не панимет, што нужно использоват мой скрепт, а не его хуету. блджад! нихуя не понимаю, што у них там в сорцах. праграмминг из эн унначюрал таск!