Open anoduck opened 1 year ago
Hey! "catnip" is my current attempt at re-writing the project. I ended up moving really fast at the beginning and things became disorganized. I wanted to optimize the script and make it handle edge cases better.
The bash directory is where I put all of my old testing versions and earlier prototypes, so none of it is needed. If you look at one of the older scripts, its a lot more simple but essentially still does the same thing. It is not needed at all though.
The other directories are all me trying to rewrite it in a compiled language so that it would be faster. But I kept running into problems with lower level IO and terminal functionality.
just the script "cn" should be enough use it. Im thinking about trying to make it work better with sixel and other systems. Its just a little harder since I don't have Mac or BSD. Luckily "head" isn't really doing anything critical so I can just remove it. I meant to do it anyway since its pointless other than it makes it look cool lol
I've been spending a lot of time trying to make something similar over here as well: https://github.com/sweetbbak/fzf-img - this one is in Go and takes a newline separated list of images.
What happens when you run "cn ~/Pictures" (or another directory with images as an argument)?
@sweetbbak
cn
where every instance of head
has been replaced with ghead
. Ghead being gnu head as it is installed on OpenBSD.I was going to run cn
in the bash debugger to see what is preventing it from jiving with my sys.
Can you do me a favor and try the testing version?
curl -sL https://raw.githubusercontent.com/sweetbbak/catnip/main/catnip > catnip && chmod +x catnip
./catnip
@sweetbbak the error is occurring on line 131 calling the redraw
. Is this referring to a function or a command? As there is no redraw command on either the kali linux nor the openbsd system.
Its an internal command. Its kind of late here, so I'll check it out tomorrow. Maybe I'll try it out in a VM. I tried to compile a binary for freebsd and openbsd from the golang version of catnip but it complained about the "term" and "unix" packages "github.com/pkg/term" "golang.org/x/sys/unix" so Im going to have to figure out why that is and what the differences are.
There are a couple of things I need to fix after some changes to icat. Sorry about that, Ive been slacking on it lately... mostly because fzf can finally show images again
like this:
fd . ~/Pictures -e png | fzf --preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {}'
but I'll try to fix it tomorrow and get the bash version to a good/portable state, then I'll probably continue with the Golang version since its far easier to handle some of the major issues.
The choice is yours. There is no urgency in the matter, everything is good here. If you rather maintain the course of finishing the go version, that works. Go works on OpenBSD too, and I am a pretty flexible dude. It is whatever you want to do. After all, it did take me two months to get back to you. So, no worries.
@sweetbbak If you haven't opened up an issue in your own repository for the go version of catnip, do so, include the error output, and mention my username. I will see if I can help in anyway or get someone else's attention to help.
The experienced error does sound familiar, but I haven't experienced it lately. Just make sure that you install OpenBSD from a snapshot and install go from OpenBSD packages via doas pkg_add -U go go-tools
. This will give you the most recent fixes, libraries, and package releases. OpenBSD snapshots are more stable and matured than Debian snapshots and Debian current release for that matter. You also might have to use sudo or doas to build the go packages.
@sweetbbak Working on getting catnip working on OpenBSD for Kitty terminal. Just a few questions...
cn
is the script in it's entirety, then what iscatnip
?cn
?Just FYI: As would be expected with OpenBSD and more than likely FreeBSD as well,
head
is not gnuhead
. So, unless installed and aliased, the-C
flag is a no go. No biggie, almost expected.