Giter VIP home page Giter VIP logo

.dotfiles's Introduction

.dotfiles

There's no place like ~ !



Table of Contents

Screenshots

Awesome WM Awesome WM Awesome WM

Introduction

This repository contains my personal configuration files (also known as dotfiles). The package lists can be found in ~/.pkglist/. To install all official packages, you can use for example cat .pkglist/pacman | pacman -S -.

In the following sections I'll explain how this dotfiles repository was set up, how to use it and how to restore them, for example on a new device.

Note: I migrated to dotfiles.sh by Eli Schwartz, which is a thin wrapper for git that implements the method described here.

Setup Repository

Setup a bare git repository in your home directory. Bare repositories have no working directory, so setup an alias to avoid typing the long command. Add the git directory ~/.dotfiles/ to the gitignore as a security measure. Setup remote and push. Hide untracked files when querying the status.

git init --bare "$HOME/.dotfiles"

echo 'alias dotfiles="/usr/bin/env git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"' \
    >> "$HOME/.zshrc"
source "$HOME/.zshrc"

echo '.dotfiles' >> "$HOME/.gitignore"
dotfiles add "$HOME/.gitignore"
dotfiles commit -m 'Git: Add gitignore'

dotfiles remote add origin https://github.com/alfunx/.dotfiles
dotfiles push --set-upstream origin master
dotfiles config --local status.showUntrackedFiles no

Track Files

Use the default git subcommands to track, update and remove files. You can obviously also use branches and all other features of git.

dotfiles status
dotfiles add .zshrc
dotfiles commit -m 'Zsh: Add zshrc'
dotfiles add .vimrc
dotfiles commit -m 'Vim: Add vimrc'
dotfiles push

To remove a file from the repository while keeping it locally you can use:

dotfiles rm --cached ~/.some_file

Restore Configurations

First clone dependent repositories, in this case for example oh-my-zsh. Clone your dotfiles repository as bare repository. Setup temporary alias and then checkout. If there exist files that collide with your repository (like a default .bashrc), the files will be moved to ~/.dotfiles.bak/. Then update all submodules and again hide untracked files when querying the status.

git clone https://github.com/robbyrussell/oh-my-zsh \
    "$HOME/.oh-my-zsh"

git clone --bare --recursive https://github.com/alfunx/.dotfiles \
    "$HOME/.dotfiles"

function dotfiles() {
    /usr/bin/env git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
}

dotfiles checkout
if [ "$?" -ne 0 ]; then
    mkdir -p "$HOME/.dotfiles.bak"
    dotfiles checkout 2>&1 \
        | grep -P '^\s+[\w.]' \
        | awk {'print $1'} \
        | xargs -I{} sh -c 'cp -r --parents "{}" "$HOME/.dotfiles.bak/" && rm -rf "{}"'
    dotfiles checkout
fi

dotfiles submodule update --recursive --remote
dotfiles config --local status.showUntrackedFiles no

Note that the automatic moving of already existing (thus conflicting) files fails if there are too many of them (git cuts the message at some point).

The short variant, using a script with the commands above:

. <(curl -Ls https://dotfiles.mariya.ch)

(Note: This is for my personal use. Instead of directly sourcing the install script, you should save it somewhere on your system and review it.)

Additional Commands

Instead of the alias provided above, you can use following function. listall will show all tracked files, listtree will show those files in a tree format (requires the package treeify). You may need to use a pager for these commands.

dotfiles() {
    case "$1" in
        listall)
            shift
            dotfiles ls-tree --full-tree -r --name-only HEAD "$@"
            ;;
        listtree)
            shift
            if hash treeify 2>/dev/null; then
                dotfiles ls-tree --full-tree -r --name-only HEAD "$@" | treeify
            else
                dotfiles listall
            fi
            ;;
        *)
            /usr/bin/env git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
            ;;
    esac
}

compdef can provide zsh autocompletion of the git command for your equivalent dotfiles command.

compdef dotfiles='git'

.dotfiles's People

Contributors

alfunx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

.dotfiles's Issues

Custom Iosevka Font

Hey, can't figure out the Iosevka font you used in the screenshot in your README. Searching dotfiles, it appears to to Iosevka Custom.
There was a ttf-iosevka-custom-git AUR package, I figured it was that, but apparently not. The spacing b/w your characters seems to be wider.
Could you share your custom font or give any pointers?
Here is my screenshot:
Vim Screenshot

paclist aur and manual packages

Hi

How do you paclist packages from aur? If I run paclist aur it says it could'nt find that repository. Same is true for manual.

Thanks!

Awesome theme not loading

Hey! I'm trying to use your awesome theme but i keep running into problems. I've tried modifying some lines here and there, but since I'm not proeficient in lua I don't know if i'm doing it right. Here is the log of a fresh install of your theme on my machine

[1] 23728
2019-08-29 13:02:50 W: awesome: luaA_dofunction:78: error while running function!
stack traceback:
	/home/shi/.config/awesome/rc.lua:139: in function </home/shi/.config/awesome/rc.lua:135>
	[C]: in metamethod '__index'
	/usr/share/awesome/lib/naughty/core.lua:651: in function 'naughty.init.notify'
	/home/shi/.config/awesome/rc.lua:106: in function </home/shi/.config/awesome/rc.lua:103>
	[C]: in metamethod '__div'
	/home/shi/.config/awesome/yaawl/subject/temperature.lua:30: in method '_update'
	/home/shi/.config/awesome/yaawl/subject/init.lua:69: in method 'update'
	/home/shi/.config/awesome/yaawl/subject/temperature.lua:61: in function 'yaawl.temperature'
	/home/shi/.config/awesome/config/brokers.lua:126: in function 'config.brokers.init'
	/home/shi/.config/awesome/rc.lua:156: in main chunk
error: /home/shi/.config/awesome/rc.lua:139: attempt to concatenate a table value (local 'c')
error while running function!
stack traceback:
	/home/shi/.config/awesome/yaawl/subject/temperature.lua:30: in method '_update'
	/home/shi/.config/awesome/yaawl/subject/init.lua:69: in method 'update'
	/home/shi/.config/awesome/yaawl/subject/temperature.lua:61: in function 'yaawl.temperature'
	/home/shi/.config/awesome/config/brokers.lua:126: in function 'config.brokers.init'
	/home/shi/.config/awesome/rc.lua:156: in main chunk
error: /home/shi/.config/awesome/yaawl/subject/temperature.lua:30: attempt to perform arithmetic on a nil value
2019-08-29 13:02:50 W: awesome: luaA_dofunction:78: error while running function!
stack traceback:
	/home/shi/.config/awesome/rc.lua:139: in function </home/shi/.config/awesome/rc.lua:135>
	[C]: in metamethod '__index'
	/usr/share/awesome/lib/naughty/core.lua:651: in function 'naughty.init.notify'
	/home/shi/.config/awesome/rc.lua:106: in function </home/shi/.config/awesome/rc.lua:103>
	[C]: in metamethod '__concat'
	/home/shi/.config/awesome/rc.lua:139: in function </home/shi/.config/awesome/rc.lua:135>
	[C]: in metamethod '__index'
	/usr/share/awesome/lib/naughty/core.lua:651: in function 'naughty.init.notify'
	/etc/xdg/awesome/rc.lua:25: in main chunk
error: /home/shi/.config/awesome/rc.lua:139: attempt to concatenate a table value (local 'c')
2019-08-29 13:02:50 W: awesome: luaA_dofunction:78: error while running function!
stack traceback:
	/home/shi/.config/awesome/rc.lua:139: in function </home/shi/.config/awesome/rc.lua:135>
	[C]: in metamethod '__index'
	/usr/share/awesome/lib/naughty/core.lua:651: in function 'naughty.init.notify'
	/etc/xdg/awesome/rc.lua:25: in main chunk
error: /home/shi/.config/awesome/rc.lua:139: attempt to concatenate a table value (local 'c')
2019-08-29 13:02:50 W: awesome: a_glib_poll:438: Last main loop iteration took 0.100958 seconds! Increasing limit for this warning to that value.
2019-08-29 13:02:52 E: awesome: a_xcb_io_cb:402: X server connection broke (error 1)

Awesome theme not loaded

Presenting this theme, you mentioned this dotfiles repository. I cloned it to apply the theme, using AwesomeWM 4.2 on NetBSD 8.0. However, it doesn't work, showing two error messages:

Oops, an error happened!
invalid key to 'next'
Oops, there were errors during startup!
error while running function!
stack traceback:
[C]: in function 'key'
/usr/pkg/share/awesome/lib/awful/key.lua:88: in function </usr/pkg/share/awesome/lib/awful/key.lua:80>
(...tail calls...)
/home/userdir/.config/awesome/config/keys.lua:421:in function 'init'
/home/userdir/.config/awesome/rc.lua:103: in main chunk

I do not know the lua language. Is there anything I can do?

Gruvbox agnoster theme

Hey man, I found your rice on an age old reddit post, and I'm just now getting into awesome as my wm, and also gruvbox. I'm trying to mimic your theme as I love it.. but I'm having some trouble copying the agnoster theme correctly. Do you happen to have that lying around, or is it in this repo and I'm just missing it??

Thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.