commit cb4af54c6cd1d9148c93c41baecd890a7ff9e672
parent d018cde0f2ed9447f5067df117ec325b4ea1ea49
Author: awy <awy@awy.one>
Date: Thu, 19 Jun 2025 00:08:38 +0300
rm rotdir
rotdir is obsolete since swayimg supports [list] all
Diffstat:
3 files changed, 11 insertions(+), 22 deletions(-)
diff --git a/.config/swayimg/config b/.config/swayimg/config
@@ -5,6 +5,8 @@ window = #000000
scale = fit
[gallery]
window = #000000
+[list]
+all = yes
[keys.viewer]
h = step_left
j = step_down
@@ -13,4 +15,13 @@ 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 "%"
+[keys.gallery]
+h = step_left
+j = step_down
+k = step_up
+l = step_right
+g = first_file
+Shift+G = last_file
diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml
@@ -1,12 +1,2 @@
[mgr]
show_hidden = true
-
-[opener]
-rotdir = [
- { run = 'rotdir "$0" | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" | setsid -f swayimg 2>/dev/null', desc = "Gallery" },
-]
-
-[open]
-prepend_rules = [
- { mime = "image/*", use = ["open", "rotdir"] },
-]
diff --git a/.local/bin/rotdir b/.local/bin/rotdir
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# When I open an image from the file manager in nsxiv (the image viewer), I want
-# to be able to press the next/previous keys to key through the rest of the
-# images in the same directory. This script "rotates" the content of a
-# directory based on the first chosen file, so that if I open the 15th image,
-# if I press next, it will go to the 16th etc. Autistic, I know, but this is
-# one of the reasons that nsxiv is great for being able to read standard input.
-
-[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
-base="$(basename "$1")"
-ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'