tmux install
This commit is contained in:
@@ -13,6 +13,7 @@ Installs symlinks, plugins, plugin managers, ...
|
|||||||
Usage:
|
Usage:
|
||||||
{progname} [-f] [-p <dir>] install all
|
{progname} [-f] [-p <dir>] install all
|
||||||
{progname} [-f] [-p <dir>] install vim
|
{progname} [-f] [-p <dir>] install vim
|
||||||
|
{progname} [-f] [-p <dir>] install tmux
|
||||||
{progname} (-h | --help)
|
{progname} (-h | --help)
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
@@ -56,8 +57,31 @@ def install_vim(pdotfiles, force=False):
|
|||||||
["git", "clone", "https://github.com/VundleVim/Vundle.vim.git",
|
["git", "clone", "https://github.com/VundleVim/Vundle.vim.git",
|
||||||
pvundle.as_posix()])
|
pvundle.as_posix()])
|
||||||
|
|
||||||
|
|
||||||
|
def install_tmux(pdotfiles, force=False):
|
||||||
|
phome = Path(os.path.expanduser("~")).resolve()
|
||||||
|
phome_tmuxrc = phome / Path(".tmuxrc")
|
||||||
|
|
||||||
|
preltmuxrc = Path("tmux/tmuxrc")
|
||||||
|
|
||||||
|
try:
|
||||||
|
pdotfiles_tmuxrc = pdotfiles.resolve().relative_to(phome.resolve()) / preltmuxrc
|
||||||
|
except ValueError:
|
||||||
|
pdotfiles_tmuxrc = pdotfiles / preltmuxrc
|
||||||
|
|
||||||
|
if force and phome_tmuxrc.is_symlink():
|
||||||
|
phome_tmuxrc.unlink() # only kill symlinks
|
||||||
|
|
||||||
|
if phome_tmuxrc.exists():
|
||||||
|
print('.tmuxrc already there!')
|
||||||
|
else:
|
||||||
|
print("Symlinking {} to {}".format(phome_tmuxrc, pdotfiles_tmuxrc))
|
||||||
|
phome_tmuxrc.symlink_to(pdotfiles_tmuxrc)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = docopt(HELPTEXT, version='0.1')
|
args = docopt(HELPTEXT, version='0.1')
|
||||||
if args["install"]:
|
if args["install"]:
|
||||||
if any((args["all"], args["vim"])):
|
if any((args["all"], args["vim"])):
|
||||||
install_vim(Path(args["--path"]).resolve(), args["--force"])
|
install_vim(Path(args["--path"]).resolve(), args["--force"])
|
||||||
|
if any((args["all"], args["tmux"])):
|
||||||
|
install_tmux(Path(args["--path"]).resolve(), args["--force"])
|
||||||
|
|||||||
Reference in New Issue
Block a user