from homely.files import mkdir, symlink mkdir('~/Development') symlink('shells/config.fish', '~/.config/fish/config.fish')
'.Xresources': '.Xresources', '.vimrc': '.vimrc', # I3 '.config/i3/config': '.config/i3/config', '.config/i3/i3blocks.conf': '.config/i3/i3blocks.conf', '.config/i3/lock.sh': '.config/i3/lock.sh', '.config/i3/toggletouchpad.sh': '.config/i3/toggletouchpad.sh', '.config/i3/icon.png': '.config/i3/icon.png', } for source, target in dotfiles.items(): execute(['rm', '-f', target]) symlink(source, target) # Oh My ZSH execute(['rsync', '-a', 'dotfiles/.oh-my-zsh/', '.oh-my-zsh/']) # Installing Packages from homely.install import installpkg # Packages packages = [ 'ack', 'feh', 'alsa-utils', 'pulseaudio', 'rofi',
from homely.files import symlink, mkdir symlink('.zshrc') symlink('.vimrc') symlink('.gitignore_global') symlink('.gitconfig') symlink('.iterm2_shell_integration.zsh') # mkdir('~/.magick')
def main(): # TODO to auto rename to an "x.old" and warn? files.symlink("bashrc", ".bashrc") files.symlink("bash_profile", ".bash_profile") files.symlink("profile", ".profile") # TODO maybe add lines instead? files.symlink("editorconfig", ".editorconfig") if system.haveexecutable("task"): files.symlink("taskrc", ".taskrc") if system.haveexecutable("asdf"): files.symlink("tool-versions", ".tool-versions") files.symlink("asdfrc", ".asdfrc") files.symlink("default-golang-pkgs", ".default-golang-pkgs") # git common config: # TODO error if git not present # TODO into separate function gitpath = os.path.join(HERE, "common.gitconfig") system.execute(["git", "config", "--global", "include.path", gitpath]) # NOTE this might overwrite if there's another include.path already present # TODO revert/cleanup somehow? # TODO check that path specification using ~/ works # TODO does pipinstall use system pip or HOMELY's one? files.symlink("vimrc", ".vimrc") # install vim-plug files.mkdir(".vim") files.mkdir(".vim/autoload") files.mkdir(".vim/swaps") files.mkdir(".vim/backups") files.mkdir(".vim/doc") files.download( "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim", "~/.vim/autoload/plug.vim", ) # link custom ftplugin files files.symlink("vim-ftplugin", ".vim/ftplugin") if system.haveexecutable("pipenv"): # TODO warn that they need to reload for this to take effect files.lineinfile(".bashrc.local", 'eval "$(pipenv --completion)"') if system.haveexecutable("i3"): # ~/.local/bin is towards the front of PATH thanks to .profile files.symlink("i3exit.sh", "~/.local/bin/i3exit") files.symlink("locker.sh", "~/.local/bin/locker") files.symlink("i3.conf", "~/.i3/config") if system.haveexecutable("kitty"): files.mkdir("$XDG_CONFIG_HOME/kitty") files.symlink("kitty.conf", "$XDG_CONFIG_HOME/kitty/kitty.conf") if system.haveexecutable("pre-commit"): # Install pre-commit in all new/cloned repos # See also https://pre-commit.com/#pre-commit-init-templatedir template_path = "{}/.git-template".format(os.environ["HOME"]) system.execute(["git", "config", "--global", "init.templateDir", template_path]) system.execute(["pre-commit", "init-templatedir", template_path]) return 0
# ~/dotfiles/HOMELY.py from homely.files import mkdir, symlink # Create directories mkdir('~/.config') mkdir('~/.config/nvim') mkdir('~/.config/fish') mkdir('~/.config/git') mkdir('~/.config/omf') symlink('init.vim', '~/.config/nvim')
from pathlib import Path from homely.files import symlink, download, mkdir from homely.system import execute ZSH_DIR = Path("~/app/zsh").expanduser() def install_zsh(): url = "https://nchc.dl.sourceforge.net/project/zsh/zsh/5.7.1/zsh-5.7.1.tar.xz" fname = "zsh-5.7.1.tar.xz" download(url, fname) execute(f"tar xvaf {fname}") mkdir("app/") execute(f"cd zsh-5.7.1 && ./configure --prefix={ZSH_DIR} && make install") install_zsh() symlink("zshrc", "~/.zshrc") symlink("oh-my-zsh", "~/.on-my-zsh") symlink("bashrc", "~/.bashrc")
# ~/dotfiles/HOMELY.py from os.path import expanduser from homely.files import download, mkdir, symlink from homely.install import installpkg from homely.system import execute # mkdir('~/.vim/autoload') symlink('_gitconfig', '.gitconfig') symlink('_gitignore', '.gitignore') symlink('_hgignore', '.hgignore') symlink('_hgrc', '.hgrc') symlink('_tmux.conf', '.tmux.conf') symlink('_vimrc', '.vimrc') # vim_plug_url = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' # download(vim_plug_url, '~/.vim/autoload/plug.vim') # mkdir('~/.config') # mkdir('~/.config/nvim') # mkdir('~/.config/pip') # symlink('init.vim', '~/.config/nvim/') # symlink('pip.conf', '~/.config/pip/') installpkg('ag', yum='the_silver_searcher', apt='silversearcher-ag') installpkg('tmux') installpkg('zsh')
installpkg('git') if not haveexecutable('curl'): installpkg('curl') if not haveexecutable('wget'): installpkg('wget') if not haveexecutable('zsh'): installpkg('zsh') if not haveexecutable('vim'): installpkg('vim') if not haveexecutable('tmux'): installpkg('tmux') omz_dir = Path('~/.oh-my-zsh') if not omz_dir.is_dir(): execute(['sh', '-c', "'$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)'") vundle_dir = Path('~/.vim/bundle/Vundle.vim') if not vundle_dir.is_dir(): execute(['git','clone','https://github.com/VundleVim/Vundle.vim.git', '~/.vim/bundle/Vundle.vim']) execute(['vim','+PluginInstall']) symlink('tmux', "~/.tmux.conf") symlink('git', "~/.gitconfig") symlink('zsh', "~/.zshrc") symlink('vim', "~/.vimrc")
from homely.files import mkdir, symlink from homely.pipinstall import pipinstall pipinstall("ranger") pipinstall("pipenv") pipinstall("raiseorlaunch") mkdir("~/.config") mkdir("~/.local/bin") symlink("~/.local/bin", "~/bin") symlink(".bashrc") symlink(".bashrc.d") symlink(".config/i3", "~/.config/i3") symlink(".config/i3status", "~/.config/i3status") symlink(".conkyrc") symlink(".inputrc") symlink(".profile") symlink(".profile", "~/.bash_profile")