aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-10-03 18:20:03 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-10-03 18:20:03 +0200
commitb18219fd1e6c53ffc3fb9b7b06c22e010d80c12f (patch)
tree21893dc9b6d06bf5ed57da442e940b904d3eb0fe
parentf64ad36ec79f4cfa3e6180a8cf86565aa629747f (diff)
downloadconfigs-b18219fd1e6c53ffc3fb9b7b06c22e010d80c12f.tar.gz
configs-b18219fd1e6c53ffc3fb9b7b06c22e010d80c12f.zip
Blue mpv and unique colors viewer for sxiv.
-rw-r--r--stow/mpv/.config/mpv/mpv.conf3
-rwxr-xr-xstow/sxiv/.config/sxiv/exec/key-handler58
2 files changed, 40 insertions, 21 deletions
diff --git a/stow/mpv/.config/mpv/mpv.conf b/stow/mpv/.config/mpv/mpv.conf
index 32f16e9..ec15a60 100644
--- a/stow/mpv/.config/mpv/mpv.conf
+++ b/stow/mpv/.config/mpv/mpv.conf
@@ -5,7 +5,8 @@ osd-level=1
osd-font='Linux Libertine'
osd-font-size=30
#osd-color='#FF00B0B0' #cyan
-osd-color='#FFEBCB8B' #yellow
+#osd-color='#FFEBCB8B' #yellow
+osd-color='#FF7aa2f7' #TokyoNight blue
osd-bar-w=80
osd-bar-h=1.5
osd-bar-align-x=0
diff --git a/stow/sxiv/.config/sxiv/exec/key-handler b/stow/sxiv/.config/sxiv/exec/key-handler
index e445c9d..2a08612 100755
--- a/stow/sxiv/.config/sxiv/exec/key-handler
+++ b/stow/sxiv/.config/sxiv/exec/key-handler
@@ -2,6 +2,29 @@
case "$1" in
+ "h")
+ dunstify "sxiv key-handler" "\
+w: Set as wallpaper. .
+r: Rotate clockwise. .
+R: Rotate counter-clockwise. .
+f: Flop (horizontally). .
+F: Flip (vertically). .
+y: Yank filename to clipboard. .
+Y: Yank file path to clipboard. .
+i: Yank image to clipboard. .
+d: Move file to litter. .
+n: Rename file. .
+N: Open in a new instance of sxiv. .
+g: Open in gimp. .
+G: Make a gif out of selected images. .
+s: Create new image with different size..
+S: Search image online. .
+c: Copy images to a chosen folder. .
+m: Move images to a chosen folder. .
+H: Show image colors. .
+h: Show help. ."
+ ;;
+
"s")
width=$(echo "" | dmenu -p "Width of new files?")
[ "$width" ] || exit 0
@@ -57,26 +80,14 @@ case "$1" in
dunstify "Created $name.gif"
;;
- "h")
- dunstify "sxiv key-handler" "\
-w: Set as wallpaper. .
-r: Rotate clockwise. .
-R: Rotate counter-clockwise. .
-f: Flop (horizontally). .
-F: Flip (vertically). .
-y: Yank filename to clipboard. .
-Y: Yank file path to clipboard. .
-i: Yank image to clipboard. .
-d: Move file to litter. .
-n: Rename file. .
-N: Open in a new instance of sxiv. .
-g: Open in gimp. .
-G: Make a gif out of selected images. .
-s: Create new image with different size..
-S: Search image online. .
-c: Copy images to a chosen folder. .
-m: Move images to a chosen folder. .
-h: Show help. ."
+ "H")
+ tmpDir="/tmp/sxivHistograms_$(date +'%H_%M_%S')"
+ mkdir -p "$tmpDir"
+ while read -r file; do
+ tmpFile=${tmpDir}/${file}
+ convert "$file" -colors 256 -unique-colors "$tmpFile"
+ done
+ sxiv -s f "$tmpDir"
;;
esac
@@ -118,16 +129,21 @@ do
prompt.sh "Rename $file to ${newname}?" "mv $file $newname" &&
dunstify "$file renamed to ${newname}."
;;
+
"N")
sxiv -b "$file" & ;;
+
"g")
gimp "$file" & ;;
+
"S")
echo -n "$(readlink -f "$file")" | xsel -ib && dunstify "$(xsel -ob) copied to clipboard"
$BROWSER "https://tineye.com/" ;;
+
"i")
xclip -selection clipboard -t image/png "$(readlink -f "$file")" && dunstify "$file copied to clipboard as image."
;;
+
"c")
[ -z "$destdir" ] && destdir="$(selectPath.sh "Copy image(s) to:")"
[ -z "$destdir" ] && exit
@@ -138,6 +154,7 @@ do
replace="$(echo -e "No\nYes" | dmenu -i -p "Replace $file in $destdir?")"
fi
[ "$replace" = "Yes" ] && cp "$file" "$destdir" && dunstify -t 2000 -i "$(readlink -f "$file")" "$file copied to $destdir" & ;;
+
"m")
[ -z "$destdir" ] && destdir="$(selectPath.sh "Move image(s) to:")"
[ -z "$destdir" ] && exit
@@ -146,6 +163,7 @@ do
replace="$(echo -e "No\nYes" | dmenu -l 2 -i -p "Replace $file in $destdir?")"
fi
[ "$replace" = "Yes" ] && mv "$file" "$destdir" && dunstify -t 2000 -i "$destdir$file" "$file moved to $destdir" & ;;
+
esac
done