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
edited by

VIFM 0.14 - Linux - XTerm

I like to start vifm from the source code I compiled, so I made a script to launch it with both panels set to the home directory, and it works fine

#!/bin/bash

cd /home/bob/PROGRAM/BUILD_VIFM/BUILD_VIFM_0_14/vifm-0.14/src


# -c "cd /home/bob": Changes the directory of the first panel to /home/bob
# -c "wincmd w": Switches focus to the second panel
# -c "cd /home/bob": Changes the directory of the second panel to /home/bob

xterm -maximized -e ./vifm  -c "cd /home/bob" -c "wincmd w" -c "cd /home/bob"

I added this script in -> System Settings > preferences -> startup Applications

Is it a good practice to do so ?

Thx

2 Answers

0 votes
by

Nothing wrong with starting Vifm like that, but the command could be simplified by using positional parameters instead of -c:

#!/bin/bash

xterm -maximized -e ~/PROGRAM/BUILD_VIFM/BUILD_VIFM_0_14/vifm-0.14/src/vifm ~ ~
by

@xaizek prima - this one line makes the job - I tested it - your solution is simple, effective, and doing exactly what it's supposed to do

0 votes
by

-c only could be convenient if you want to start with just one pane visible.

I use an adaptation of this script so that when I quit Vifm, the shell ends up in the last directory Vifm was in.

By the way, to get the latest version of Vifm on Linux, I've found Homebrew to be an easier solution than building from source: brew install vifm

by

@qadzek Thank you for the tip, I’ll note it down in case I want to install Vifm on my system instead of running it from source

 __  __ _____ ____   ____ ___
|  \/  | ____|  _ \ / ___|_ _|
| |\/| |  _| | |_) | |    | |
| |  | | |___|  _ <| |___ | |
|_|  |_|_____|_| \_\\____|___|
...