diff options
author | awy <awy@awy.one> | 2025-07-29 03:42:18 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-07-29 03:42:18 +0300 |
commit | ef6dff4cce15186a66ba34cdd7bd39958ebf7f58 (patch) | |
tree | fcfa61164ca6e79c900b5d11f6afc6b46aaccb84 /.config/swayimg | |
download | hyprdots-ef6dff4cce15186a66ba34cdd7bd39958ebf7f58.tar.gz |
first commit
Diffstat (limited to '.config/swayimg')
-rw-r--r-- | .config/swayimg/config | 38 | ||||
-rwxr-xr-x | .config/swayimg/key-handler | 35 |
2 files changed, 73 insertions, 0 deletions
diff --git a/.config/swayimg/config b/.config/swayimg/config new file mode 100644 index 0000000..e2892a3 --- /dev/null +++ b/.config/swayimg/config @@ -0,0 +1,38 @@ +[general] +compositor = no +[viewer] +window = #000000 +scale = fit +[gallery] +window = #000000 +[list] +all = yes +[keys.viewer] +h = step_left +j = step_down +k = step_up +l = step_right +n = next_file +p = prev_file +w = zoom fit +g = first_file +Shift+g = last_file +Ctrl+x = exec ~/.config/swayimg/key-handler "%" +r = rotate_right +Shift+r = rotate_left +Alt+Shift+k = zoom +20 +Alt+Shift+j = zoom -20 +[keys.gallery] +h = step_left +j = step_down +k = step_up +l = step_right +g = first_file +Shift+g = last_file +[info] +info_timeout = 0 +[info.viewer] +top_left = none +top_right = none +bottom_left = +name +bottom_right = +scale,+frame,+index diff --git a/.config/swayimg/key-handler b/.config/swayimg/key-handler new file mode 100755 index 0000000..67943a9 --- /dev/null +++ b/.config/swayimg/key-handler @@ -0,0 +1,35 @@ +#!/bin/sh +file=$1 + [ -z "$selection" ] && selection=$(printf "w - Set as wallpaper\nc - Copy to dir\nm - Move to dir\nr - Rotate 90°\nR - Rotate -90°\nf - Flip horizontal\ny - Copy filename to clipboard\nY - Copy full path to clipboard\nd - Delete\ng - Open in GIMP\ni - Show media info" | + mew -i -l 12 -p "Choose action for selected files:") + action=$(printf "%s" "$selection" | cut -d'-' -f1 | tr -d ' ') + case "$action" in + "w") setbg "$file" & ;; + "c") + [ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | mew -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit + cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & + ;; + "m") + [ -z "$destdir" ] && destdir="$(sed "s/#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | awk '{print $2}' | mew -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + [ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit + mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & + ;; + "r") + magick "$file" -rotate 90 "$file" ;; + "R") + magick "$file" -rotate -90 "$file" ;; + "f") + magick "$file" -flop "$file" ;; + "y") + printf "%s" "$file" | tr -d '\n' | wl-copy && + notify-send "$file copied to clipboard" & ;; + "Y") + readlink -f "$file" | tr -d '\n' | wl-copy && + notify-send "$(readlink -f "$file") copied to clipboard" & ;; + "d") + [ "$(printf "No\\nYes" | mew -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;; + "g") ifinstalled gimp && setsid -f gimp "$file" ;; + "i") notify-send "File information" "$(mediainfo "$file" | sed "s/[ ]\+:/:/g;s/: /: <b>/;s/$/<\/b>/" | rg "<b>")" ;; + *) notify-send "No keybind for that key" ;; + esac |