3 changed files with 41 additions and 1 deletions
@ -0,0 +1,20 @@
@@ -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}" |
||||
|
@ -0,0 +1,19 @@
@@ -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 |
||||
|
Loading…
Reference in new issue