Browse Source

update xbindkeys config + gitignore ncmpcpp error log + add rotdir script + use zipinfo instead of atool for lf zip previews

Noah Vogt 3 năm trước cách đây
mục cha
commit
5034748186
4 tập tin đã thay đổi với 18 bổ sung1 xóa
  1. 1 0
      .gitignore
  2. 2 1
      dot-config/lf/scope
  3. 3 0
      dot-config/xbindkeys/config
  4. 12 0
      local-bin/rotdir

+ 1 - 0
.gitignore

@@ -3,3 +3,4 @@ dot-config/norisa.local
 dot-config/newsboat/urls
 dot-config/Xauth/auth
 local-share/gnupg/
+error.log

+ 2 - 1
dot-config/lf/scope

@@ -26,7 +26,8 @@ case "$(file --dereference --brief --mime-type -- "$1")" in
 	text/html) lynx -width="$4" -display_charset=utf-8 -dump "$1"  ;;
 	text/troff) man ./ "$1" | col -b ;;
 	text/* | */xml | application/json) bat --terminal-width "$4" -f "$1" ;;
-	application/zip) atool --list -- "$1" ;;
+	application/zip) zipinfo -2htz "$1" ;;
+	#application/zip) atool --list -- "$1" ;;
         audio/* | application/octet-stream) mediainfo "$1" || exit 1;;
 	video/* )
 		CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}')"

+ 3 - 0
dot-config/xbindkeys/config

@@ -134,3 +134,6 @@
 
 "echo \"$(mpc current)\" | xargs notify-send"
    Mod4 + C
+
+"mpc stop && killall mpd"
+   Mod4 + X

+ 12 - 0
local-bin/rotdir

@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# When I open an image from the file manager in sxiv (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 sxiv 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; }'