项目作者: amerlyq

项目描述 :
dotfiles for archlinux/ubuntu with emphasis on terminal
高级语言: Shell
项目地址: git://github.com/amerlyq/airy.git
创建时间: 2014-08-07T16:09:27Z
项目社区:https://github.com/amerlyq/airy

开源协议:MIT License

下载


airy

Modular system configuration and package installation.

  • Encapsulates user settings to manage by version control systems.
  • Aimed for development purposes with bias to vim, tiling WM and terminals.
  • Automatic setup on clean system, with following update/maintenance.

Currently supported host systems:

  • Arch Linux (preferable)
  • Ubuntu-based distro (clean if possible)

Initial

TEMP: Manually symlink or mount —bind

  1. ln -s /data/chroots /chroot
  2. ln -s /home/work /work
  3. ln -s ~/Downloads /_dld
  4. ln -s /data/music ~/.config/mpd/music

ALSO

  • encrypt your SSH keys
  • add SSH keys to github/gitlab

Install

If you wish to feel what it’s like, default setup contains only necessary
symlinks and terminal tools, preserving your system as much as possible.

  1. mkdir -p ~/aura && cd ~/aura
  2. git clone https://github.com/amerlyq/airy
  3. cd airy
  4. make # install basic 'airy' symlinks
  5. make all # clean all and then install pkgs
  6. make continue # to continue installation after error was fixed

Go make some tea, in one minute basic shell tools will be installed.

Private parts

You can keep your system profiles and private modules/resources in your own
private repository (gitlab.com, bitbucket.com, dropbox, etc).

Overall directories structure (in repo’s root or some subdirectory) is next:

  1. repo
  2. ├── airy
  3. ├── hostname1 # home
  4. ├── hostname2 # work
  5. └── hostname3 # server (headless)
  6. ├── fonts
  7. └── setup
  8. ├── mutt
  9. └── acc
  10. ├── home
  11. └── work
  12. └── Makefile

Main repo/Makefile must be launched on clean system before everything else.
It will symlink your chosen profile/modules and launches system setup.

  1. #!/usr/bin/make -f
  2. .DEFAULT_GOAL = install
  3. MAKEFLAGS += -rR --silent
  4. d_airy := $(HOME)/aura/airy
  5. d_cfg := $(or $(AIRY_CONFIG),$(or $(XDG_CONFIG_HOME),$(HOME)/.config)/airy)
  6. prf := $(shell pwd)/airy/$(shell hostname)
  7. install:
  8. $(MAKE) -C '$(d_airy)' -- configure
  9. ln -svfT '$(prf)' '$(d_cfg)/profile'

In such way your own clean system setup will be as simple as:

  1. mkdir -p ~/aura && cd ~/aura
  2. git clone https://github.com/amerlyq/airy
  3. git clone https://gitlab.com/$yourname/$airyprivate
  4. cd $airyprivate
  5. make
  6. cd ../airy
  7. make -B

Note, that in case of using Xorg mods, to fully setup system you must run
setup command inside Xorg session — because some vars (like dpi)
impossible to extract from plain console. Therefore on clean system install
the setup script must be run twice — in console and then in Xorg.

Profile

Each profile prf/hostname is written in plain bash.
These text files usually non-executable and sourced by scripts explicitly.

  1. # vim: ft=sh
  2. CURR_PROF=home
  3. AIRY_MODS=( airy pacman git zsh vim ranger tmux xorg )
  4. ### Git ###
  5. MAIN_NAME="<Full Name>"
  6. MAIN_MAIL="username@gmail.com"
  7. MAIN_SKYPE="<username>"

Profiles can be nested/inherited.
This allows to distribute settings and nicely reuse parts of configs for similar hosts.

  1. dprf=$(dirname "$(readlink -e "$BASH_SOURCE")")
  2. AIRY_OVERLAY_PATH=${dprf%/*}
  3. source "$dprf/home" || return
  4. CURR_PROF=home_vbox
  5. AIRY_SKIP+=( browser )
  6. MAIN_MAIL="vboxuser@email.com"

Example how to use profile vars in your own modules/scripts:

  1. #!/bin/bash -e
  2. source ~/.shell/profile
  3. ...
  4. r.mutt-acc ${MAIN_MAIL:?}