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

Is it possible to make vifmrc choose the terminal - with preference of XTerm and fall back on gnome-terminal if XTerm is not on the system, like:

" Determine terminal to use
let $VIFM_TERMINAL = system('which xterm > /dev/null 2>&1 && echo "xterm" || echo "gnome-terminal"')

" command backup
command! backtoHDD1 execute $VIFM_TERMINAL . ' -hold -e rsync -av --delete /home/bob/to_keep/ /media/bob/backup_1/to_keep_back/ %i'

actually I run vifm version 0.14 from sources - not installed system wide

thx a lot and have a nice day guys

1 Answer

0 votes
by

You don't need execute in this case:

command! backtoHDD1 $VIFM_TERMINAL -hold -e rsync -av --delete /home/bob/to_keep/ /media/bob/backup_1/to_keep_back/ %i
by

Thanks a lot xaizek ! This configuration works for me, made a little change:

" Determine terminal to use
let $VIFM_TERMINAL = system('which xterm > /dev/null 2>&1 && echo "xterm -e" || echo "gnome-terminal -- sh -c"')

" command backup
command! backtoHDD1 $VIFM_TERMINAL 'rsync -av --delete /home/bob/to_keep/ /media/bob/backup_1/to_keep_back/ %i'
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.
...