From 8fdbbef10f13a834d2c5bf44ebd9bec8956c7087 Mon Sep 17 00:00:00 2001 From: Sylvain Herlédan Date: Sat, 3 Jun 2017 17:58:58 +0200 Subject: Add useful external commands for sxiv. --- bin/key-handler.sh | 15 +++++++++++++++ setup.sh | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 bin/key-handler.sh diff --git a/bin/key-handler.sh b/bin/key-handler.sh new file mode 100755 index 0000000..360c36a --- /dev/null +++ b/bin/key-handler.sh @@ -0,0 +1,15 @@ +#!/bin/sh +while read file +do + case "$1" in + "C-l") + convert -rotate 270 "$file" "$file" ;; + "C-r") + convert -rotate 90 "$file" "$file" ;; + "C-c") + echo -n "$file" \ + | xclip -i -selection clipboard -f \ + | xclip -i -selection primary ;; + esac +done + diff --git a/setup.sh b/setup.sh index c39fa4a..301c735 100755 --- a/setup.sh +++ b/setup.sh @@ -220,6 +220,8 @@ copy_files() "${dst_dir}/.local/config/dunst/dunstrc" cp -r "${src_dir}/bin/image-info.sh" \ "${dst_dir}/.local/config/sxiv/exec/image-info" + cp -r "${src_dir}/bin/key-handler.sh" \ + "${dst_dir}/.local/config/sxiv/exec/key-handler" configure_rtorrent "${src_dir}" "${dst_dir}" } @@ -258,7 +260,7 @@ configure_rtorrent() check_requirements() { local requirements="git make wget i3"; - local optional_deps="notify-send dunst pulseaudio scrot sudo redshift numlockx identify"; + local optional_deps="notify-send dunst pulseaudio scrot sudo redshift numlockx identify convert xclip"; local requirements_not_met=0; for cmd in ${optional_deps}; -- cgit v1.2.3-70-g09d2