From 7d45921d60b06b0c958e9c1dc92ec6075a310fdb Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Fri, 1 Mar 2019 12:27:22 +0100 Subject: Added sxiv image-info and key-handler. --- files/i3/config | 1 + files/i3blocks/config | 5 ++++ files/ranger/rc.conf | 2 +- files/rcs/dunstrc | 7 ++--- files/sxiv/image-info | 18 ++++++++++++ files/sxiv/key-handler | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ files/sxiv/path.txt | 2 ++ 7 files changed, 105 insertions(+), 5 deletions(-) create mode 100755 files/sxiv/image-info create mode 100755 files/sxiv/key-handler create mode 100644 files/sxiv/path.txt (limited to 'files') diff --git a/files/i3/config b/files/i3/config index 839fe8d..3cad285 100644 --- a/files/i3/config +++ b/files/i3/config @@ -344,3 +344,4 @@ bar { #exec_always bash ~/scripts/pkmBgSelector.sh exec feh --bg-fill ~/images/wallpapers/bg* #exec transmission-gtk +exec setxkbmap -option caps:swapescape diff --git a/files/i3blocks/config b/files/i3blocks/config index 155aba4..274fb89 100644 --- a/files/i3blocks/config +++ b/files/i3blocks/config @@ -8,6 +8,11 @@ color=#bceebc command=echo "🥠 $(fortune -n 55 -s | sed 's/\n/ \/ /g')" interval=once +[screenRec] +command=~/scripts/i3blocks/i3rec.sh +interval=once +signal=13 + [music] color=#a5acff #background=#696eff diff --git a/files/ranger/rc.conf b/files/ranger/rc.conf index 587d5d3..d7d7938 100644 --- a/files/ranger/rc.conf +++ b/files/ranger/rc.conf @@ -245,7 +245,7 @@ alias travel scout -aefiklst # =================================================================== # Custom -map ,w shell feh --bg-max %f +map ,w shell setBG.sh %f & map ,W console shell ~/scripts/floats/floatBgBrowser.sh %d/ & map ,p shell asPDF.sh %f map ,P shell lowriter --convert-to pdf %f diff --git a/files/rcs/dunstrc b/files/rcs/dunstrc index dc70c18..b1f09cc 100644 --- a/files/rcs/dunstrc +++ b/files/rcs/dunstrc @@ -16,8 +16,7 @@ idle_threshold = 120 ### Text ### - - font = Monospace 8 + font = Monospace 9 line_height = 0 markup = full format = "%s\n%b" @@ -31,8 +30,8 @@ show_indicators = yes ### Icons ### - #icon_position = right - #max_icon_size = 32 + icon_position = right + max_icon_size = 64 #icon_path = /usr/share/icons/hicolor/16x16/status/:/usr/share/icons/hicolor/16x16/devices/ ### History ### diff --git a/files/sxiv/image-info b/files/sxiv/image-info new file mode 100755 index 0000000..be503d8 --- /dev/null +++ b/files/sxiv/image-info @@ -0,0 +1,18 @@ +#!/bin/sh + +# 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 "${filename}${s}${geometry}${s}${filesize}" + diff --git a/files/sxiv/key-handler b/files/sxiv/key-handler new file mode 100755 index 0000000..bc1cf92 --- /dev/null +++ b/files/sxiv/key-handler @@ -0,0 +1,75 @@ +#!/bin/sh + +case "$1" in + "s") + width=$(echo "" | dmenu -p "Width of new files?") + [ "$width" ] || exit 0 + height=$(echo "" | dmenu -p "Height of new files?") + [ "$height" ] || exit 0 + modifier="" + [ "$(printf "Yes\nNo" | dmenu -i -p "Maintain aspect ratio?")" = "No" ] && modifier="!" + while read file + do + convert "$file" -resize "$width"x"$height""$modifier" "$width"x"$height""$modifier"_"$file" + done ;; + "h") + notify-send "\ +w: Set as wallpaper. . +r: Rotate clockwise. . +R: Rotate counter-clockwise. . +f: Flop (horizontally). . +f: Flop (vertically). . +y: Yank filename to clipboard. . +Y: Yank file path to clipboard. . +d: Delete file (with confirmation prompt). . +c: Rename file. . +g: Open in gimp. . +s: Create new image with different size. . +S: Search image online. . +h: Show help. ." ;; +esac + +while read file +do + case "$1" in + "w") setBG.sh "$file" ;; + "r") + convert -rotate 90 "$file" "$file" && + notify-send "$file rotated clockwise" ;; + "R") + convert -rotate -90 "$file" "$file" && + notify-send "$file rotated counter-clockwise" ;; + "f") + convert -flop "$file" "$file" && + notify-send "$file flopped" ;; + "F") + convert -flip "$file" "$file" && + notify-send "$file flipped" ;; + "y") + echo -n "$file" | xclip -selection clipboard && + notify-send "$file copied to clipboard" & ;; + "Y") + echo -n "$(readlink -f "$file")" | xclip -selection clipboard && + notify-send "$(readlink -f "$file") copied to clipboard" & ;; + "d") + [ "$(printf "No\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;; + "c") + newname="$(dmenu -p "New name of $file?")" + [ "$newname" ] && newname="$newname"'.'"${file##*.}" && [ "$(printf "No\nYes" | dmenu -i -p "Rename $file to $newname?")" = "Yes" ] && mv "$file" "$newname" && notify-send "$file renamed to $newname." ;; + "g") + gimp "$file" & ;; + "S") + echo -n "$(readlink -f "$file")" | xclip -selection clipboard && notify-send "$(readlink -f "$file") copied to clipboard" + $BROWSER https://tineye.com/ ;; + # "c") + # [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + # [ -z "$destdir" ] && exit + # cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & + # ;; + # "m") + # [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + # [ -z "$destdir" ] && exit + # mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & + # ;; + esac +done diff --git a/files/sxiv/path.txt b/files/sxiv/path.txt new file mode 100644 index 0000000..6579b91 --- /dev/null +++ b/files/sxiv/path.txt @@ -0,0 +1,2 @@ +image-info path: ~/.config/sxiv/exec/image-info +key-handler path: ~/.config/sxiv/exec/key-handler -- cgit v1.2.1