Closed luravoid closed 1 month ago
%
is not a full path, but the path you specify when run swayimg
, so:
swayimg /full/path/to/image
-> %
is /full/path/to/image
swayimg realtive/path/to/image
-> %
is relative/path/to/image
swayimg image
-> %
is image
Is there a way to get the full path of an image when I'm in its directory?
I want to be able to:
cd ~/Pictures/Backgrounds && swayimg
and then print the full path of the image instead of the relative path using a keybinding.
You can use
swayimg ~/Pictures/Backgrounds
The issue is that I run swayimg from a keybinding in yazi, and it automatically takes me to the directory of the images when I run it.
programs.yazi.keymap = {
manager.prepend_keymap = [
{
on = ["I"];
run = "shell --confirm 'swayimg --gallery'";
desc = "Preview all images in the current directory with swayimg";
}
It would be nice to have an option to always be able to get the full path, regardless of the current directory.
Just create a simple script swayimg_pwd
:
#!/bin/sh
swayimg --gallery "$(pwd)"
and modify the yazi config
run = "shell --confirm swayimg_pwd";
thanks, this solves my issue.
when i use
exec notify-send %
as a binding, it only prints the name of the file, not the full path