Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

I need to use the automated fuse mount as root and xdg-open it's content as the desktop user, how could I achieve that?

filetype {*.zip,*.jar,*.war,*.ear,*.oxt,*.apkg},<application/zip,application/java-archive> FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR

Usually I wrap the command in su -c 'cmd' username, and did it successfully for other filextype, for example

filextype {*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm},<image/*> su -c 'if [[ -n "$XDG_CURRENT_DESKTOP" ]]; then for element in %f; do xdg-open "$element"; done > /dev/null 2>&1' john

but trying this on fuse mount

filetype {*.zip,*.jar,*.war,*.ear,*.oxt,*.apkg},<application/zip,application/java-archive> FUSE_MOUNT|su -c 'fuse-zip %SOURCE_FILE %DESTINATION_DIR' john

is giving me zsh:1: unmatched ', seems like a shell escape problem? this do nothing at all:

filetype {*.zip,*.jar,*.war,*.ear,*.oxt,*.apkg},<application/zip,application/java-archive> su -c 'FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR' john

I think I could manually write the fuse automation script, as last resort, but I would prefer to use the already existing code if possible

1 Answer

0 votes
by
selected by
 
Best answer

Try adding a space before closing quote, I think %DESTINATION_DIR wasn't recognized because it was followed by ' (parsing code looks weird).

by

that was it! always learning something

but how could I pass the allow_other option to the automated fuse mount? otherwise even if the fusehome dir has the right permission it prompt the error fuse: failed to open mountpoint for reading: Permission denied

by

that was it! always learning something

It's a workaround, code needs to be fixed.

allow_other option

filetype {*.zip,*.jar,*.war,*.ear,*.oxt,*.apkg},<application/zip,application/java-archive>
       \ FUSE_MOUNT|su -c 'fuse-zip %SOURCE_FILE %DESTINATION_DIR -o allow_other' john
by

I already tried that way to no avail, it gives me the same error

by

It's probably file permissions on %DESTINATION_DIR and you want to add chown john %DESTINATION_DIR && before su.

by

I wanted to chown that dynamic dir (once mounted normally it was the only one in the path that was owned by root) too but I didn't know how, now all works perfectly!

lovely support as always

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...