vfu ia a nifty little text-based file-manager which can be run from a terminal.
Contents
Helpful Commands:
h - help
q - exit to the (VFU) current directory (using optional shell script, see below)
x - exit to the last working directory
ENTER - view file or enter folder
BKSPACE - up a level
a - arrange (sort) files list
e - erase file/folder
c - copy files
m - move files
l - symlink files (lower L)
b - browse (view) files
g - global select files by criteria. also modifies files list (hide entries for example)
s - search for filename, wildcards are available (advance with TAB during search)
i - edit file
1..9 - toggle display of files details (mode, time, size...)
0 - switch between simple and detailed listings (full info or just filenames)
~ - to home directory
. - show/hide hidden files (.dot files)
f - mask files (CTRL+f resets mask back to *)
d - change working directory
ALT+d - change directory history
` - directory bookmarks
u - user menu
TAB - edit file name/properties
o - runtime options (those are not saved/read from the config file)
p - files clipboard (copy, move files from several locations...)
v - edit VFU config file
VFU will execute actions either on the currently pointed file (if no selection exists) or on the currently selected entries. Using ALT+key exacutes action only on the currently pointed file, regardless selection. Those rules apply to copy (ALT+c), move (ALT+m), symlink (ALT+l), browse (ALT+b) operations.
Changing location of config file:
To change where the configuration file is stored ( such as moving it to .config so that it does not clutter the home folder) add
# to get vfu to put config file into ~/.conf # have to export $RC_PREFIX as .conf export RC_PREFIX=.config
into the file .bashrc. The configiuraton file can now be found in ~/.config/vfu/vfu.conf
If you decide not to change the location of the config file, it will be stored in ~/.vfu/vfu.conf
Quit To Current (VFU) Working Directory
VFU offers two exits. One to the last working directory (x key) and the other is to the directory VFU is currently in (q key). To use the latter you need to start VFU with shell function. Here is example for bash(1):
function vfu() { /usr/local/bin/vfu $*; cd "`cat /tmp/vfu.exit.$USER`"; rm -f /tmp/vfu.exit.$USER; } alias vf="vfu" # you need to add this to your ~/.profile or ~/.bash_profile
Custom File Editor:
To change the text editor used by vfu find, within the vfu.conf file, the line (near the top):
Editor=vim %f
and change it so that vim is the editor of your choice, such as gedit, kwrite, mousepad, vi, vim, nano, emacs. You may have to turn off the 'use internal editor' option in the options menu (press o to bring up menu and SPACE to turn off option). It is also possible to use a different viewer if you so wish.
Custom File Associations:
Vfu can be customised to open different files with different programs; Entrys are put in the comma separated format such as:
ux=SEE DOC,ENTER,.doc.DOC.odt.sxw.,ooffice2 -writer "%f" &
Where:
SEE DOC is just a short descriptive name
ENTER is the action on the file
.ext.ext.ext.ext. the file extentions to which the actions apply (dot separated list)
ooffice2 -writer "%f" is the command to use on the file, "%f" is the location of the file
& indicates that you wish to continue using vfu whist the file is open
Thus, vfu will open ooffice2 -writer when I press ENTER on a .odt file (or .doc , .sxw etc). If you don't add & at the end, VFU will wait ooffice2 to exit before returning back to files list.
General syntax is:
description,keyname,ext.mask,command
description is just free text, keep it small, first letter can be used as menu hotkey
keyname is key you want to bind
ext.mask is dot-separated list of required extensions and/or file type strings (extension mask)
command is the shell line you want to execute (as on the command prompt for example)
Available keys (keynames) are:
ENTER, INSERT, F1..F10, @F1..@F10, #F1..#F10, ^F1..^F10 Modifiers are: #=shift @=alt ^=ctrl note: ^KEY and @KEY may not always work, try pressing ESC then Fx as alternative to @Fx
Extension mask can be * to discard file type and run command for any/all files. It may also contain file types:
** -- executable file [] -- directory -> -- symbolic link <> -- symbolic link to directory == -- block device ++ -- character device () -- fifo (pipe) ## -- socket
You can mix file extensions with file type strings in the same mask. Don't confuse * (any/all files) with ** (executables).
In any command string (shell exec lines) you can use those placeholders:
%f -- replaced with current filename (w/o path) %F -- replaced with full pathname of the current file %g -- same as %f but for each selected filename %G -- same as %F but for each selected filename %g and %G produce list of filenames. each filename is surrounded by ' if filename contains ' then " is used. example: 'file1' "file2's" 'file"3"' ... %e -- current file name without extension %E -- current file extension %s -- current file size %c -- current path ( with slash at the end ) %C -- startup path ( with slash at the end ) %R -- re-read directory content after shell %? -- prompt for user input and replace it in %i -- simulates DownArrow after execution (advances file pointer to the next file in the list) %n -- don't clear and redraw screen on user external command %w -- wait a key after shell. replaced with empty string %x -- replaced with `x' (i.e. if '''x''' is not recognised as placeholder) %! -- request shell line to be shown before execution (debug mode)
Example section:
# view pictures ux=SEE JPEG,ENTER,.JPG.jpg.JPEG.jpeg.gif.xpm.png.,feh "%f" 2> /dev/null & # view HTML documents -- now moved to SEE filters below ux=SEE HTML,ENTER,.htm.html.shtml.,firefox "%F" & #ux=SEE HTM,ENTER,.htm.html.,w3m "%F" ux=SEE HTML,INSERT,.htm.html.shtml.,w3m "%F" # office document viewing ux=SEE DOC,ENTER,.doc.DOC.odt.sxw.,ooffice2 -writer "%f" & ux=SEE SHEET,ENTER,.ods.sxc.xls.,ooffice2 -calc "%f" & ux=SEE PRESENTATION,ENTER,.odp.ppt.sxi.,ooffice2 -impress "%f" & ux=SEE DRAW,ENTER,.odg.sxd.sda.sdd.,ooffice2 -draw "%f" & #music x=PLAY MP3,ENTER,.ogg.mp3.wav.wma.,vlc -I skins2 "%f" %i 1> /dev/null 2> /dev/null & ux=PLAY MP3,INSERT,*,xmms *.mp3 *.wav 1> /dev/null 2> /dev/null & # view PDF and PS document ux=VIEW PDF,ENTER,.pdf.PDF.,acroread "%f"& ux=VIEW PS,ENTER,.ps.,gv "%f"& # ux=VIEW TAR,INS,.gz.,gunzip -c "%f" | tar tvf - | less # view man pages -- note you can add and see filter for this ux=VIEW MAN,ENTER,.1.2.3.4.5.6.7.8.,man "%F" # play mpeg's ux=PLAY MPEG,ENTER,.mpg.MPG.mpeg.asf.avi.mov.wmv.,vlc -I skins2 "%f" 1> /dev/null 2> /dev/null & ux=PLAY MPEG,INS,.mpg.MPG.mpeg.asf.avi.mov.wmv.,vlc -I skins2 "%f" 1> /dev/null 2> /dev/null &
Custom User Menu:
The user menu is reached by pressing the u key. Custom options in this menu can be added by finding the section;
# # following user commands are bound to the UserMenu -- key `u' # note that instead of keyname there's `menu' string! # first letter is hotkey! # ux=lLocate file,menu,*,locate %? %w ux=---,menu,*, ux=ompg123: Stop,menu,*,killall -TERM mpg123 1> /dev/null 2> /dev/null & ux=smpg123: Suspend,menu,*,killall -STOP mpg123 1> /dev/null 2> /dev/null & ux=cmpg123: Continue,menu,*,killall -CONT mpg123 1> /dev/null 2> /dev/null & ux=vmpg123: View running/queue,menu,*,ps xeo "%%p %%a" | grep mpg123 | grep -v grep | less
The format is of comma separated fields:
ux=kname,menu,*,command
where:
k is the shortcut key in the menu.
name is the name of the entry in the menu.
menu states that it is a menu item.
* is the filetype filter - leave it as an asterix to enable it to be performed on all files/folders.
command is the command to be performed the variable "%f" is used to add in the location of the file/folder. An '&' can be added on at the end if you want to continue using vfu whilst the action is being performed.
Example menu section:
# # following user commands are bound to the UserMenu -- key `u` # note that instead of keyname there's `menu` string! # first letter is hotkey! # ux=lLocate file,menu,*,locate %? %w ux=---,menu,*, ux=ffeh: show pics in feh,menu,*,feh "%f" & ux=gfeh: show pics fullscreen,menu,*,feh -F "%f" ux=pplay: play in xfmedia,menu,*,xfmedia "%f" & ux=wwatch: play in vlc,menu,*,vlc -I skins2 "%f" 1> /dev/null 2> /dev/null & ux=---,menu,*, ux=ompg123: Stop,menu,*,killall -TERM mpg123 1> /dev/null 2> /dev/null & ux=smpg123: Suspend,menu,*,killall -STOP mpg123 1> /dev/null 2> /dev/null & ux=cmpg123: Continue,menu,*,killall -CONT mpg123 1> /dev/null 2> /dev/null & ux=vmpg123: View running/queue,menu,*,ps xeo "%%p %%a" | grep mpg123 | grep -v grep | less
Where extra options have been added to play music/videos in xfmedia or vlc and to show pictures in feh. i.e. It is now possible to open a folder of pictures using feh or a folder of music using vlc (with the options for a nice skin)
But the best way to find out about vfu (and most other programs) is to make a backup of the file and then play arround with it to see what you can get it to do.