From 9a85d328ccf29f4cebb104e4eeeba1b20a896f6b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 15 Jul 2023 18:57:12 +0200 Subject: [PATCH] nsxiv replaces unmaintained sxiv --- .config/lf/lfrc | 2 +- .config/shell/bm-files | 2 +- .local/bin/dmenuhandler | 4 ++-- .local/bin/linkhandler | 4 ++-- .local/bin/rotdir | 4 ++-- .local/bin/tutorialvids | 2 +- .local/share/applications/img.desktop | 2 +- .local/share/larbs/getkeys/{sxiv => nsxiv} | 13 ++++++------- README.md | 2 +- 9 files changed, 17 insertions(+), 18 deletions(-) rename .local/share/larbs/getkeys/{sxiv => nsxiv} (50%) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 25fb3d1..56a4182 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -35,7 +35,7 @@ cmd open ${{ image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;; image/svg+xml) display -- $f ;; image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*$" | - setsid -f sxiv -aio 2>/dev/null | while read -r file; do + setsid -f nsxiv -aio 2>/dev/null | while read -r file; do [ -z "$file" ] && continue lf -remote "send select \"$file\"" lf -remote "send toggle" diff --git a/.config/shell/bm-files b/.config/shell/bm-files index 7acbb66..2e8864b 100644 --- a/.config/shell/bm-files +++ b/.config/shell/bm-files @@ -20,4 +20,4 @@ cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings # ncmpcpp (music player) cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config # ncmpcpp (music player) config cfl ${XDG_CONFIG_HOME:-$HOME/.config}/lf/lfrc # lf (file browser) config cfL ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope # lf's scope/preview file -cfX ${XDG_CONFIG_HOME:-$HOME/.config}/sxiv/exec/key-handler # sxiv (image viewer) key/script handler +cfX ${XDG_CONFIG_HOME:-$HOME/.config}/nsxiv/exec/key-handler # nsxiv (image viewer) key/script handler diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index acfd71b..e50178a 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -4,7 +4,7 @@ # some choice programs to use to open it. feed="${1:-$(true | dmenu -p 'Paste URL or file path')}" -case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in +case "$(printf "copy url\\nnsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in "copy url") echo "$feed" | xclip -selection clipboard ;; mpv) setsid -f mpv -quiet "$feed" >/dev/null 2>&1 ;; "mpv loop") setsid -f mpv -quiet --loop "$feed" >/dev/null 2>&1 ;; @@ -13,7 +13,7 @@ case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv "queue yt-dlp audio") qndl "$feed" 'yt-dlp -o "%(title)s.%(ext)s" -f bestaudio --embed-metadata --restrict-filenames' ;; "queue download") qndl "$feed" 'curl -LO' >/dev/null 2>&1 ;; PDF) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && zathura "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; - sxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; + nsxiv) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; vim) curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; setbg) curl -L "$feed" > $XDG_CACHE_HOME/pic ; xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 ;; browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;; diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index f62b581..84b2e28 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -1,7 +1,7 @@ #!/bin/sh # Feed script a url or file location. -# If an image, it will view in sxiv, +# If an image, it will view in nsxiv, # if a video or gif, it will view in mpv # if a music file or pdf, it will download, # otherwise it opens link in browser. @@ -16,7 +16,7 @@ case "$url" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtube.com/shorts*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*) setsid -f mpv -quiet "$url" >/dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif) - curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; + curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && nsxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *pdf|*cbz|*cbr) curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source*) diff --git a/.local/bin/rotdir b/.local/bin/rotdir index 86da6db..d171f29 100755 --- a/.local/bin/rotdir +++ b/.local/bin/rotdir @@ -1,11 +1,11 @@ #!/bin/sh -# When I open an image from the file manager in sxiv (the image viewer), I want +# 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 sxiv is great for being able to read standard input. +# 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")" diff --git a/.local/bin/tutorialvids b/.local/bin/tutorialvids index 8d1dc47..1bac3df 100755 --- a/.local/bin/tutorialvids +++ b/.local/bin/tutorialvids @@ -8,7 +8,7 @@ vidlist=" dwm (window manager) https://videos.lukesmith.xyz/videos/watch/f6b78db7-b368-4647-bc64-28c08fff1988 dwmblocks (status bar) https://videos.lukesmith.xyz/w/mmxHMbqZZEr5FManB57Yy1 pacman (installing/managing programs) https://videos.lukesmith.xyz/videos/watch/8e7cadb9-0fed-47ce-a2a8-6635fa48614b -sxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2 +sxiv/nsxiv (image viewer) https://videos.lukesmith.xyz/videos/watch/ad4c8d85-90c3-4f3d-a1f3-89129e64a3c2 st (terminal) https://videos.lukesmith.xyz/videos/watch/efddd39d-bac5-4599-b572-177beb4ce6e8 i3 (old window manager) https://videos.lukesmith.xyz/videos/watch/b861525c-7ada-40ee-a2bb-b5e1ffe0f48b neomutt (email) https://videos.lukesmith.xyz/videos/watch/83122e83-52d9-4278-ae1a-7d1beeb50c8e diff --git a/.local/share/applications/img.desktop b/.local/share/applications/img.desktop index 42aa81e..5783107 100644 --- a/.local/share/applications/img.desktop +++ b/.local/share/applications/img.desktop @@ -1,4 +1,4 @@ [Desktop Entry] Type=Application Name=Image viewer -Exec=/usr/bin/sxiv -a %f +Exec=/usr/bin/nsxiv -a %f diff --git a/.local/share/larbs/getkeys/sxiv b/.local/share/larbs/getkeys/nsxiv similarity index 50% rename from .local/share/larbs/getkeys/sxiv rename to .local/share/larbs/getkeys/nsxiv index df5cb1e..176a65a 100644 --- a/.local/share/larbs/getkeys/sxiv +++ b/.local/share/larbs/getkeys/nsxiv @@ -1,9 +1,8 @@ - _ - _____ _(_)_ __ -/ __\ \/ / \ \ / / -\__ \> <| |\ V / -|___/_/\_\_| \_/ -sxiv is the image viewer. + _ __ _____ _(_)_ __ +| '_ \/ __\ \/ / \ \ / / +| | | \__ \> <| |\ V / +|_| |_|___/_/\_\_| \_/ +nsxiv is the image viewer. h/j/k/l - Pan image -/+ - Zoom out/in Enter - Toggle thumbnail mode @@ -12,4 +11,4 @@ sxiv is the image viewer. r - Reload image if changed m - Mark/unmark image w - Zoom to fit window - ctrl-x - Run external command (see ~/.config/sxiv/exec/key-handler for options) + ctrl-x - Run external command (see ~/.config/nsxiv/exec/key-handler for options) diff --git a/README.md b/README.md index 135a8e4..1e2f780 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on - zsh (shell) - lf (file manager) - mpd/ncmpcpp (music) - - sxiv (image/gif viewer) + - nsxiv (image/gif viewer) - mpv (video player) - other stuff like xdg default programs, inputrc and more, etc. - I try to minimize what's directly in `~` so: