-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggested fixes for key-handler
#1451
Comments
My first consideration on this is that paths from Regarding the filename copy, the Regarding the new feature, I really like it! Is your mind already set on the "x" key or are you still considering other letters? I think that both the filename copy feature and image copy are ready to be made into PRs, nice contributions! |
Quick note: the MIME type can be obtained using |
@aartoni, you can definitely do the PRs if you want. I use my personal fork of the repo, so I only follow the issues and PRs for ideas. Typically, I use the file operations to copy pictures from
I use the Note: the
I checked the script but don't see any commands to retrieve the MIME type. There is Notes
EDIT:
|
Thanks for pointing that out, I've done a bit of research and was able to reproduce the results from this Stack Overflow question, showing that shell built-ins are also way faster than the commands. |
A nice trick for organizing large picture libraries is opening the directory in For an easy fix, you can check out this (Script was moved to the top post for visibility). |
One of the things that make
nsxiv
really cool is the ability to add whatever features you want to it, via thekey-handler
script. The repo has akey-handler
with nice features, but some of them are currently broken. So I opened this issue to suggest some fixes.File operations (copy and move) are broken.
As you can see,
"$destdir"
contains the literal string$HOME
rather than the expanded version, e.g./home/user
. This triggers the "not a directory" notification even though valid paths are given.One workaround for this is to expand the variable after the selection, using
eval
:The way this is quoted is important, because 'eval' processes quotes differently.
echo
may be used instead ofprintf '%s\\n'
. The advantage ofecho
is that it will expand both~
and$HOME
, making thesed
command unnecessary. However, usingecho
is not considered good practice.The image rotation commands are broken
@aartoni recently created #1449 with the relevant fix.
The commands for copying the filename and file path are not properly implemented
In theory, the
y
option should copy just the file name (e.g.image.png
), while theY
option should copy the entire file path (e.g./home/user/Pictures/image.png
). However, in practice both commands will copy the entire file path if nsxiv is opened with a full path, e.g.There is no option to copy the image itself to clipboard
The
nsxiv
repo's examplekey-handler
script has a command for copying an image to the clipboard and pasting it somewhere else, e.g. in a forum post or an email. Although I don't frequently use this, it seems like a nice thing to have. This repo could implement it like this:EDIT:
Here is an example implementation that:
The text was updated successfully, but these errors were encountered: