From 91fb2276c27f037b6b33d11600abd50a07473a6a Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Fri, 21 Feb 2020 15:17:54 +0300 Subject: [PATCH] =?UTF-8?q?sxiv:=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/rc.linux-gnu | 3 ++- etc/soft/sxiv/exec/image-info | 20 ++++++++++++++++++++ etc/soft/sxiv/exec/key-handler | 19 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 etc/soft/sxiv/exec/image-info create mode 100755 etc/soft/sxiv/exec/key-handler diff --git a/etc/rc.linux-gnu b/etc/rc.linux-gnu index a5c06e1..b506d66 100644 --- a/etc/rc.linux-gnu +++ b/etc/rc.linux-gnu @@ -51,7 +51,7 @@ mkdir -p ~/.config/dunst - soft/conky/conkyrc.$(uname -i) ~ - soft/ctags/ctags ~ + soft/nvim ~/.config -+ soft/vifm ~ ++ soft/vifm ~/.config - soft/vimperator ~ - soft/vimperator/vimperatorrc ~ + soft/git/gitconfig ~ @@ -59,6 +59,7 @@ mkdir -p ~/.config/dunst - soft/stalonetray/stalonetrayrc ~ - soft/tmux/tmux.conf ~ + media/alsa/asoundrc ~ ++ soft/sxiv ~/.config + soft/dfc ~/.config + soft/polybar ~/.config + soft/htop ~/.config diff --git a/etc/soft/sxiv/exec/image-info b/etc/soft/sxiv/exec/image-info new file mode 100755 index 0000000..da610cf --- /dev/null +++ b/etc/soft/sxiv/exec/image-info @@ -0,0 +1,20 @@ +#!/bin/sh + +# Example for $XDG_CONFIG_HOME/sxiv/exec/image-info +# Called by sxiv(1) whenever an image gets loaded. +# The output is displayed in sxiv's status bar. +# Arguments: +# $1: path to image file +# $2: image width +# $3: image height + +s=" " # field separator + +exec 2>/dev/null + +filename=$(basename -- "$1") +filesize=$(du -Hh -- "$1" | cut -f 1) +geometry="${2}x${3}" + +echo "${filesize}${s}${geometry}${s}${filename}" + diff --git a/etc/soft/sxiv/exec/key-handler b/etc/soft/sxiv/exec/key-handler new file mode 100755 index 0000000..39e860b --- /dev/null +++ b/etc/soft/sxiv/exec/key-handler @@ -0,0 +1,19 @@ +#!/bin/sh + +# $XDG_CONFIG_HOME/sxiv/exec/key-handler +# +# Called by sxiv(1) after the external prefix key (C-x by default) is pressed. +# The next key combo is passed as its first argument. Passed via stdin are the +# images to act upon, one path per line: all marked images, if in thumbnail +# mode and at least one image has been marked, otherwise the current image. +# sxiv(1) blocks until this script terminates. It then checks which images +# have been modified and reloads them. +# +# The key combo argument has the following form: "[C-][M-][S-]KEY", +# where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X +# keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix. + +case "$1" in + "C-d") tr '\n' '\0' | xargs -IF -0 rm -v F;; +esac +