Use GNU Stow instead of bash scripts

This commit is contained in:
George Rawlinson 2016-10-23 17:18:46 +13:00
parent a7a537b8e1
commit e0caac3082
29 changed files with 73 additions and 248 deletions

58
Makefile Normal file
View file

@ -0,0 +1,58 @@
.PHONY: help git lftp npm nvim ssh sway urxvt zsh clean
.DEFAULT: help
help:
@echo "all # Sets up everything"
@echo "git # Sets up default git config"
@echo "lftp # Set up lftp"
@echo "npm # Set up npm"
@echo "nvim # Sets up neovim"
@echo "ssh # Set up ssh"
@echo "sway # Set up sway"
@echo "urxvt # Set up urxvt"
@echo "zsh # Set up zsh"
@echo "clean # deletes absolutely everything"
@echo ""
@echo " mostly, i'm just lazy"
all: git lftp npm nvim ssh sway urxvt zsh
git:
@stow -t ~/ git
lftp:
@stow -t ~/ lftp
npm:
@mkdir -p ~/.cache/npm ~/.local/share/npm
@stow -t ~/ npm
nvim:
@stow -t ~/ nvim
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
@echo "Run :PlugInstall when nvim is first run!"
ssh:
@stow -t ~/ ssh
sway:
@stow -t ~/ sway
urxvt:
@stow -t ~/ urxvt
zsh:
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
@stow -t ~/ zsh
clean:
@stow -D git lftp npm nvim ssh sway urxvt zsh
@rm -rf ~/.config/git \
~/.config/lftp ~/.local/share/lftp \
~/.config/npm ~/.cache/npm ~/.local/share/npm \
~/.config/nvim \
~/.config/sway \
~/.oh-my-zsh

5
git/.config/git/config Normal file
View file

@ -0,0 +1,5 @@
[user]
email = george@rawlinson.net.nz
name = George Rawlinson
[push]
default = simple

View file

@ -1,5 +0,0 @@
# Go
Define $GOPATH ([source][1])
[1]: https://golang.org/doc/install

View file

@ -0,0 +1 @@
host sftp://username:password@host:port/path/to/dir

View file

@ -1,34 +0,0 @@
# LFTP
## Ease of use
* Added bookmark for default SFTP server.
## Performance
* Disabled cache. Force server to send up-to-date list of files.
* Set pget chunks to 30. Aim is to completely saturate the connection.
* Disabled logging by LFTP.
## Cosmetic
* Use colours.
* Changed default prompt.
[Source][1]
## Connect
`lftp <bookmark title>`
Create a symlink for `.lftprc`
`ln -s ~/.dotfiles/lftp/lftprc ~/.lftprc`
Create folders for bookmarks & copy over `bookmarks`.
`mkdir -p ~/.lftp`
`cp ~/.dotfiles/lftp/bookmarks ~/.lftp/bookmarks`
[1]: http://lftp.yar.ru/lftp-man.html

View file

@ -1 +0,0 @@
host sftp://username:password@host:port/path/to/dir

View file

@ -1,60 +0,0 @@
#!/bin/bash
# Links all ZSH plugins from dotfiles in oh-my-zsh plugin directory
DOTFILES_DIR="$HOME/.dotfiles"
ZSH_DIR="$HOME/.oh-my-zsh/custom/"
# Check if zsh installed & directories reachable
if [ ! command -v zsh &> /dev/null ]; then
echo "zsh not installed"
exit 1
fi
if [ ! -d ${DOTFILES_DIR} ]; then
echo "${DOTFILES_DIR} does not exist"
exit 1
fi
if [ ! -d ${ZSH_DIR} ]; then
echo "${ZSH_DIR} does not exist"
exit 1
fi
# Recursively find all ZSH files in ~/.dotfiles
declare -a ZSH_FILES=(`find $DOTFILES_DIR -type f -name "*.zsh"`)
# Copy array
declare -a ZSH_NAMES=("${ZSH_FILES[@]}")
# Remove path, we only want filenames
ZSH_NAMES=("${ZSH_NAMES[@]/*\//}")
# Get number of ZSH files
NUM_FILES=${#ZSH_FILES[@]}
# Check if there are actually any files to symlink
if [ ${NUM_FILES} -lt 1 ]; then
echo "No files found."
exit 1
else
echo "${NUM_FILES} files to be symlinked."
fi
# Print all files w/ symlinked path
for (( i=0; i<${NUM_FILES}; i++ )); do
# Check if symlinked file exists
if [ -f ${ZSH_DIR}${ZSH_NAMES[$i]} ]; then
# Delete symlink
rm -f ${ZSH_DIR}${ZSH_NAMES[$i]}
fi
# Perform symlink
echo "Symlink: ${ZSH_FILES[$i]} > ${ZSH_DIR}${ZSH_NAMES[$i]}"
ln -s ${ZSH_FILES[$i]} ${ZSH_DIR}${ZSH_NAMES[$i]}
done
# All done
echo "Done!"
exit 0

2
npm/.config/npm/config Normal file
View file

@ -0,0 +1,2 @@
# Save exact version instead of a 'loose' version.
save-exact=true

View file

@ -1,15 +0,0 @@
# NPM
* Install NPM packages globally without requiring sudo. ([source][1])
* Save exact version instead of a 'loose' version. ([source][2])
Create directory for global packages
`mkdir ~/.npm-packages`
Copy `.npmrc`
`cp ~/.dotfiles/npm/npmrc ~/.npmrc`
[1]: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
[2]: https://docs.npmjs.com/misc/config#save-exact

View file

@ -1,5 +0,0 @@
# Install NPM packages globally without requiring sudo.
prefix=${HOME}/.npm-packages
# Save exact version instead of a 'loose' version.
save-exact=true

View file

@ -1,32 +0,0 @@
# neovim (nvim)
Install [nvim][url-nvim] with [vim-plug][url-vim-plug] (plugin manager)
## Plugins
* [vim-airline][url-vim-airline]
* [vim-airline-plugins][url-vim-airline-plugins]
* [vim-monokai][url-vim-monokai]
* [vim-gitgutter][url-vim-gitgutter]
* [vim-sensible][url-vim-sensible]
## Installation
```shell
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
```
## Configuration
`ln -s ~/.dotfiles/nvim/init.vim ~/.config/nvim/init.vim`
`nvim +PlugInstall +qall`
[url-nvim]:https://github.com/neovim/neovim
[url-vim-plug]:https://github.com/junegunn/vim-plug
[url-vim-airline]:https://github.com/vim-airline/vim-airline
[url-vim-airline-plugins]:https://github.com/vim-airline/vim-airline
[url-vim-monokai]:https://github.com/sickill/vim-monokai
[url-vim-gitgutter]:https://github.com/airblade/vim-gitgutter
[url-vim-sensible]:https://github.com/tpope/vim-sensible

View file

@ -1,15 +0,0 @@
# SSH
Create SSH directory & copy config there.
`mkdir -p ~/.ssh/`
`cp config ~/.ssh/`
Generate SSH key(s)
`ssh-keygen -t ed25519 -C "comment" -f /path/to/ssh/key`
## TODO
Update config variables with proper variables (user/port/keys)

View file

@ -1,21 +0,0 @@
# SWAY
[Sway][1] is an i3-compatible window manager for Wayland.
Using i3status for the menu bar. Run with `sway`.
## Dependencies
* sway
* i3status
* ttf-font-icons
* rxvt-unicode
## Setup
`mkdir -p ~/config/{i3status,sway}`
`ln -s ~/.dotfiles/sway/sway.config ~/.config/sway/config`
`ln -s ~/.dotfiles/sway/i3status.config ~/.config/i3status/config`
[1]: https://github.com/SirCmpwn/sway

View file

@ -1,20 +0,0 @@
# urxvt
a.k.a. rxvt-unicode.
Uses following perl extensions:
* Clickable URLs
* Simple Tabbing
## Installation
Create a symlink for `.Xresources`
`ln -s ~/.dotfiles/urxvt/xresources ~/.Xresources`
## Daemon
[Startup][url-daemon] with `urxvtd -q -o -f`
[url-daemon]:https://wiki.archlinux.org/index.php/Rxvt-unicode/Tips_and_tricks#Daemon-client

View file

@ -1,9 +0,0 @@
# VitaSDK
Unofficial SDK for the PS Vita. Development moves fast, so breaks often.
Check [vitasdk-cmake][url-vitasdk-cmake] and
[vitasdk][url-vitasdk] for prereqs & changes.
[url-vitasdk-cmake]: https://github.com/codestation/vitasdk-cmake
[url-vitasdk]: https://github.com/vitasdk

View file

@ -1,9 +1,13 @@
# Install NPM packages globally without requiring sudo. # Install NPM packages globally without requiring sudo.
# Source: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md # Source: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
NPM_PACKAGES="${HOME}/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH" export NPM_CONFIG_USERCONFIG=$HOME/.config/npm/config
export NPM_CONFIG_CACHE=$HOME/.cache/npm
export NPM_CONFIG_TMP=$XDG_RUNTIME_DIR/npm
export NPM_CONFIG_PREFIX=$HOME/.local/share/npm
PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
# Unset manpath so we can inherit from /etc/manpath via the `manpath` command # Unset manpath so we can inherit from /etc/manpath via the `manpath` command
unset MANPATH # delete if you already modified MANPATH elsewhere in your config unset MANPATH # delete if you already modified MANPATH elsewhere in your config
export MANPATH="$NPM_PACKAGES/share/man:$(manpath)" export MANPATH="$NPM_CONFIG_PREFIX/share/man:$(manpath)"

View file

@ -1,28 +0,0 @@
# ZSH
* oh-my-zsh. ([source][1])
* zsh-completions plugin. ([source][2])
## Install
### Main package
`pacman -S zsh`
`chsh -s /bin/zsh`
### oh-my-zsh
`git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh`
### zsh-completions plugin
`git clone https://github.com/zsh-users/zsh-completions
~/.oh-my-zsh/custom/plugins/zsh-completions`
## Configuration
`ln -s ~/.dotfiles/zsh/zshrc ~/.zshrc`
[1]: https://github.com/robbyrussell/oh-my-zsh
[2]: https://github.com/zsh-users/zsh-completions