{"id":13395090,"url":"https://github.com/alfunx/.dotfiles","last_synced_at":"2025-04-07T06:11:04.170Z","repository":{"id":41559660,"uuid":"103404807","full_name":"alfunx/.dotfiles","owner":"alfunx","description":"There's no place like ~ !","archived":false,"fork":false,"pushed_at":"2022-08-23T09:00:41.000Z","size":43812,"stargazers_count":404,"open_issues_count":2,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-29T22:45:19.399Z","etag":null,"topics":["archlinux","awesomewm","dotfiles","git","i3lock","ranger","tmux","vim","zsh"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alfunx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"alfunx","custom":"buymeacoffee.com/alfunx"}},"created_at":"2017-09-13T13:41:35.000Z","updated_at":"2024-10-25T15:28:06.000Z","dependencies_parsed_at":"2022-09-21T13:20:17.255Z","dependency_job_id":null,"html_url":"https://github.com/alfunx/.dotfiles","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfunx%2F.dotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfunx%2F.dotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfunx%2F.dotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfunx%2F.dotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfunx","download_url":"https://codeload.github.com/alfunx/.dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archlinux","awesomewm","dotfiles","git","i3lock","ranger","tmux","vim","zsh"],"created_at":"2024-07-30T17:01:41.744Z","updated_at":"2025-04-07T06:11:04.113Z","avatar_url":"https://github.com/alfunx.png","language":"Lua","funding_links":["https://patreon.com/alfunx","buymeacoffee.com/alfunx"],"categories":["Lua"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e.dotfiles\u003c/h1\u003e\n    \u003cp\u003eThere's no place like \u003cb\u003e\u003ccode\u003e~\u003c/code\u003e\u003c/b\u003e !\u003c/p\u003e\n    \u003cp\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/WM-Awesome%20WM-535d6c.svg\" /\u003e --\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/Editor-Vim-009930.svg\" /\u003e --\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/Terminal-Kitty-784421.svg\" /\u003e --\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/Shell-Zsh-red.svg\" /\u003e --\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/Font-Iosevka-lightgrey.svg\" /\u003e --\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/Distro-Arch%20Linux-0f94d2.svg\" /\u003e --\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/IRC-Irssi-blue.svg\" /\u003e --\u003e\n    \u003c!-- \u003cbr\u003e\u003cbr\u003e --\u003e\n    \u003cimg src=\"pictures/dotfiles.png\"\u003e\n    \u003cbr\u003e\u003cbr\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n## Table of Contents\n\n+ [Screenshots](#screenshots)\n+ [Introduction](#introduction)\n+ [Setup Repository](#setup-repository)\n+ [Track Files](#track-files)\n+ [Restore Configurations](#restore-configurations)\n+ [Additional Commands](#additional-commands)\n\n## Screenshots\n\n![Awesome WM](pictures/screenshot_1.png)\n![Awesome WM](pictures/screenshot_2.png)\n![Awesome WM](pictures/screenshot_3.png)\n\n## Introduction\n\nThis repository contains my personal configuration files (also known as\n*dotfiles*). The package lists can be found in `~/.pkglist/`. To install all\nofficial packages, you can use for example `cat .pkglist/pacman | pacman -S -`.\n\nIn the following sections I'll explain how this dotfiles repository was set up,\nhow to use it and how to restore them, for example on a new device.\n\n**Note**: I migrated to\n[dotfiles.sh](https://github.com/eli-schwartz/dotfiles.sh) by Eli Schwartz,\nwhich is a thin wrapper for git that implements the method described here.\n\n## Setup Repository\n\nSetup a bare git repository in your home directory. Bare repositories have no\nworking directory, so setup an alias to avoid typing the long command. Add the\ngit directory `~/.dotfiles/` to the gitignore as a security measure. Setup\nremote and push. Hide untracked files when querying the status.\n\n```bash\ngit init --bare \"$HOME/.dotfiles\"\n\necho 'alias dotfiles=\"/usr/bin/env git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME\"' \\\n    \u003e\u003e \"$HOME/.zshrc\"\nsource \"$HOME/.zshrc\"\n\necho '.dotfiles' \u003e\u003e \"$HOME/.gitignore\"\ndotfiles add \"$HOME/.gitignore\"\ndotfiles commit -m 'Git: Add gitignore'\n\ndotfiles remote add origin https://github.com/alfunx/.dotfiles\ndotfiles push --set-upstream origin master\ndotfiles config --local status.showUntrackedFiles no\n```\n\n## Track Files\n\nUse the default git subcommands to track, update and remove files. You can\nobviously also use branches and all other features of git.\n\n```bash\ndotfiles status\ndotfiles add .zshrc\ndotfiles commit -m 'Zsh: Add zshrc'\ndotfiles add .vimrc\ndotfiles commit -m 'Vim: Add vimrc'\ndotfiles push\n```\n\nTo remove a file from the repository while keeping it locally you can use:\n\n```bash\ndotfiles rm --cached ~/.some_file\n```\n\n## Restore Configurations\n\nFirst clone dependent repositories, in this case for example `oh-my-zsh`. Clone\nyour dotfiles repository as bare repository. Setup temporary alias and then\ncheckout. If there exist files that collide with your repository (like a default\n`.bashrc`), the files will be moved to `~/.dotfiles.bak/`. Then update all\nsubmodules and again hide untracked files when querying the status.\n\n```bash\ngit clone https://github.com/robbyrussell/oh-my-zsh \\\n    \"$HOME/.oh-my-zsh\"\n\ngit clone --bare --recursive https://github.com/alfunx/.dotfiles \\\n    \"$HOME/.dotfiles\"\n\nfunction dotfiles() {\n    /usr/bin/env git --git-dir=\"$HOME/.dotfiles/\" --work-tree=\"$HOME\" \"$@\"\n}\n\ndotfiles checkout\nif [ \"$?\" -ne 0 ]; then\n    mkdir -p \"$HOME/.dotfiles.bak\"\n    dotfiles checkout 2\u003e\u00261 \\\n        | grep -P '^\\s+[\\w.]' \\\n        | awk {'print $1'} \\\n        | xargs -I{} sh -c 'cp -r --parents \"{}\" \"$HOME/.dotfiles.bak/\" \u0026\u0026 rm -rf \"{}\"'\n    dotfiles checkout\nfi\n\ndotfiles submodule update --recursive --remote\ndotfiles config --local status.showUntrackedFiles no\n```\n\nNote that the automatic moving of already existing (thus conflicting) files\nfails if there are too many of them (git cuts the message at some point).\n\nThe short variant, using a script with the commands above:\n\n```bash\n. \u003c(curl -Ls https://dotfiles.mariya.ch)\n```\n\n(Note: This is for my personal use. Instead of directly sourcing the install\nscript, you should save it somewhere on your system and review it.)\n\n## Additional Commands\n\nInstead of the alias provided above, you can use following function. `listall`\nwill show all tracked files, `listtree` will show those files in a tree format\n(requires the package `treeify`). You may need to use a pager for these\ncommands.\n\n```bash\ndotfiles() {\n    case \"$1\" in\n        listall)\n            shift\n            dotfiles ls-tree --full-tree -r --name-only HEAD \"$@\"\n            ;;\n        listtree)\n            shift\n            if hash treeify 2\u003e/dev/null; then\n                dotfiles ls-tree --full-tree -r --name-only HEAD \"$@\" | treeify\n            else\n                dotfiles listall\n            fi\n            ;;\n        *)\n            /usr/bin/env git --git-dir=\"$HOME/.dotfiles/\" --work-tree=\"$HOME\" \"$@\"\n            ;;\n    esac\n}\n```\n\n`compdef` can provide `zsh` autocompletion of the `git` command for your\nequivalent `dotfiles` command.\n\n```bash\ncompdef dotfiles='git'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfunx%2F.dotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfunx%2F.dotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfunx%2F.dotfiles/lists"}