Top Related Projects
💻 macOS / Ubuntu dotfiles
A curated list of dotfiles resources.
Quick Overview
The cowboy/dotfiles repository is a collection of configuration files (dotfiles) and scripts for setting up and customizing a Unix-like environment. It includes configurations for various tools and applications, such as Vim, Bash, Git, and more, tailored to the preferences of the repository owner, Ben Alman (cowboy).
Pros
- Comprehensive set of configurations for a wide range of tools and applications
- Well-organized structure with separate files for different components
- Includes installation scripts for easy setup
- Regularly maintained and updated
Cons
- Highly personalized configurations may not suit everyone's preferences
- Requires some familiarity with Unix-like systems and command-line tools
- May overwrite existing configurations if not carefully installed
- Some configurations might be outdated or incompatible with newer versions of tools
Getting Started
To use these dotfiles:
-
Clone the repository:
git clone https://github.com/cowboy/dotfiles.git
-
Navigate to the dotfiles directory:
cd dotfiles
-
Run the installation script:
./bin/dotfiles
Note: It's recommended to review the configurations and installation script before running them to ensure they align with your preferences and system setup.
Competitor Comparisons
💻 macOS / Ubuntu dotfiles
Pros of alrra/dotfiles
- More comprehensive documentation, including detailed installation instructions and explanations for various configurations
- Broader range of supported tools and applications, including git, npm, and various macOS settings
- Regular updates and maintenance, with more recent commits and active development
Cons of alrra/dotfiles
- Potentially overwhelming for beginners due to the extensive number of configurations and options
- Less focus on cross-platform compatibility, with a stronger emphasis on macOS-specific settings
Code Comparison
dotfiles:
# cowboy/dotfiles
if [[ "$1" == "-h" || "$1" == "--help" ]]; then cat <<HELP
Dotfiles - "Cowboy" Ben Alman - http://benalman.com/
Usage: $(basename "$0")
See the README for documentation.
https://github.com/cowboy/dotfiles
Copyright (c) 2012 "Cowboy" Ben Alman
Licensed under the MIT license.
http://benalman.com/about/license/
HELP
exit; fi
# alrra/dotfiles
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" \
&& . "utils.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
main() {
print_in_purple "\n • Update content\n\n"
ask_for_sudo
update_content
}
main
A curated list of dotfiles resources.
Pros of awesome-dotfiles
- Comprehensive collection of dotfiles resources and tools
- Well-organized with categories for different types of dotfiles and related tools
- Regularly updated with contributions from the community
Cons of awesome-dotfiles
- Not a ready-to-use dotfiles setup, requires more effort to implement
- May be overwhelming for beginners due to the large number of options
Code comparison
dotfiles:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
awesome-dotfiles:
## Tools
- [Ansible](https://www.ansible.com) - Radically simple configuration-management, application deployment, task-execution, and multinode orchestration engine.
- [bashdot](https://github.com/bashdot/bashdot) - Minimalist dotfile management framework written entirely in bash.
- [chezmoi](https://chezmoi.io) - Manage your dotfiles across multiple machines, securely.
The code comparison shows that dotfiles provides actual configuration files, while awesome-dotfiles offers a curated list of tools and resources for managing dotfiles. This reflects the different purposes of the two repositories: dotfiles is a personal dotfiles setup, while awesome-dotfiles is a comprehensive resource for dotfiles management.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Dotfiles
My OSX / Ubuntu dotfiles.
About this project
I've been using bash on-and-off for a long time (since Slackware Linux was distributed on 1.44MB floppy disks). In all that time, every time I've set up a new Linux or OS X machine, I've copied over my .bashrc
file and my ~/bin
folder to each machine manually. And I've never done a very good job of actually maintaining these files. It's been a total mess.
I finally decided that I wanted to be able to execute a single command to "bootstrap" a new system to pull down all of my dotfiles and configs, as well as install all the tools I commonly use. In addition, I wanted to be able to re-execute that command at any time to synchronize anything that might have changed. Finally, I wanted to make it easy to re-integrate changes back in, so that other machines could be updated.
That command is dotfiles, and this is my "dotfiles" Git repo.
How the "dotfiles" command works
When dotfiles is run for the first time, it does a few things:
- In Ubuntu, Git is installed if necessary via APT (it's already there in OSX).
- This repo is cloned into your user directory, under
~/.dotfiles
. - Files in
/copy
are copied into~/
. (read more) - Files in
/link
are symlinked into~/
. (read more) - You are prompted to choose scripts in
/init
to be executed. The installer attempts to only select relevant scripts, based on the detected OS and the script filename. - Your chosen init scripts are executed (in alphanumeric order, hence the funky names). (read more)
On subsequent runs, step 1 is skipped, step 2 just updates the already-existing repo, and step 5 remembers what you selected the last time. The other steps are the same.
Other subdirectories
- The
/backups
directory gets created when necessary. Any files in~/
that would have been overwritten by files in/copy
or/link
get backed up there. - The
/bin
directory contains executable shell scripts (including the dotfiles script) and symlinks to executable shell scripts. This directory is added to the path. - The
/caches
directory contains cached files, used by some scripts or functions. - The
/conf
directory just exists. If a config file doesn't need to go in~/
, reference it from the/conf
directory. - The
/source
directory contains files that are sourced whenever a new shell is opened (in alphanumeric order, hence the funky names). - The
/test
directory contains unit tests for especially complicated bash functions. - The
/vendor
directory contains third-party libraries.
The "copy" step
Any file in the /copy
subdirectory will be copied into ~/
. Any file that needs to be modified with personal information (like copy/.gitconfig which contains an email address and private key) should be copied into ~/
. Because the file you'll be editing is no longer in ~/.dotfiles
, it's less likely to be accidentally committed into your public dotfiles repo.
The "link" step
Any file in the /link
subdirectory gets symlinked into ~/
with ln -s
. Edit one or the other, and you change the file in both places. Don't link files containing sensitive data, or you might accidentally commit that data! If you're linking a directory that might contain sensitive data (like ~/.ssh
) add the sensitive files to your .gitignore file!
The "init" step
Scripts in the /init
subdirectory will be executed. A whole bunch of things will be installed, but only if they aren't already.
OS X
- Minor XCode init via the init/10_osx_xcode.sh script
- Homebrew via the init/20_osx_homebrew.sh script
- Homebrew recipes via the init/30_osx_homebrew_recipes.sh script
- Homebrew casks via the init/30_osx_homebrew_casks.sh script
- Fonts via the init/50_osx_fonts.sh script
Ubuntu
- APT packages and git-extras via the init/20_ubuntu_apt.sh script
Both
- Node.js, npm and nave via the init/50_node.sh script
- Ruby, gems and rbenv via the init/50_ruby.sh script
- Vim plugins via the init/50_vim.sh script
Hacking my dotfiles
Because the dotfiles script is completely self-contained, you should be able to delete everything else from your dotfiles repo fork, and it will still work. The only thing it really cares about are the /copy
, /link
and /init
subdirectories, which will be ignored if they are empty or don't exist.
If you modify things and notice a bug or an improvement, file an issue or a pull request and let me know.
Also, before installing, be sure to read my gently-worded note.
Installation
OS X Notes
You need to have XCode or, at the very minimum, the XCode Command Line Tools, which are available as a much smaller download.
The easiest way to install the XCode Command Line Tools in OSX 10.9+ is to open up a terminal, type xcode-select --install
and follow the prompts.
Tested in OSX 10.15
Ubuntu Notes
You might want to set up your ubuntu server like I do it, but then again, you might not.
Either way, you should at least update/upgrade APT with sudo apt-get -qq update && sudo apt-get -qq dist-upgrade
first.
Tested in Ubuntu 14.04 LTS
Heed this critically important warning before you install
If you're not me, please do not install dotfiles directly from this repo!
Why? Because I often completely break this repo while updating. Which means that if I do that and you run the dotfiles
command, your home directory will burst into flames, and you'll have to go buy a new computer. No, not really, but it will be very messy.
Actual installation (for you)
- Read my gently-worded note
- Fork this repo
- Open a terminal/shell and do this (change
cowboy
andmaster
as appropriate):
Ubuntu
export DOTFILES_GH_USER=cowboy
export DOTFILES_GH_BRANCH=master
bash -c "$(wget -qO- https://raw.github.com/$DOTFILES_GH_USER/dotfiles/$DOTFILES_GH_BRANCH/bin/dotfiles)" && source ~/.bashrc
macOS
export DOTFILES_GH_USER=cowboy
export DOTFILES_GH_BRANCH=master
bash -c "$(curl -fsSL https://raw.github.com/$DOTFILES_GH_USER/dotfiles/$DOTFILES_GH_BRANCH/bin/dotfiles)" && source ~/.bashrc
Since you'll be using the dotfiles command on subsequent runs, you'll only have to set the DOTFILES_GH_USER
variable for the initial install, but if you have a custom branch, you will need to export DOTFILES_GH_BRANCH
for subsequent runs.
There's a lot of stuff that requires admin access via sudo
, so be warned that you might need to enter your password here or there.
Actual installation (for me)
Ubuntu
bash -c "$(wget -qO- https://bit.ly/cowboy-dotfiles)" && source ~/.bashrc
macOS
bash -c "$(curl -fsSL https://bit.ly/cowboy-dotfiles)" && source ~/.bashrc
Aliases and Functions
To keep things easy, the ~/.bashrc
and ~/.bash_profile
files are extremely simple, and should never need to be modified. Instead, add your aliases, functions, settings, etc into one of the files in the source
subdirectory, or add a new file. They're all automatically sourced when a new shell is opened. Take a look, I have a lot of aliases and functions. I even have a fancy prompt that shows the current directory, time and current git/svn repo status.
Scripts
In addition to the aforementioned dotfiles script, there are a few other bin scripts. This includes nave, which is a git submodule.
- dotfiles - (re)initialize dotfiles. It might ask for your password (for
sudo
). - src - (re)source all files in
/source
directory - Look through the bin subdirectory for a few more.
Prompt
I think my bash prompt is awesome. It shows git and svn repo status, a timestamp, error exit codes, and even changes color depending on how you've logged in.
Git repos display as [branch:flags] where flags are:
? untracked files
! changed (but unstaged) files
+ staged files
SVN repos display as [rev1:rev2] where rev1 and rev2 are:
rev1 last changed revision
rev2 revision
Check it out:
Inspiration
https://github.com/gf3/dotfiles
https://github.com/mathiasbynens/dotfiles
(and 15+ years of accumulated crap)
License
Copyright (c) 2014 "Cowboy" Ben Alman
Licensed under the MIT license.
http://benalman.com/about/license/
Top Related Projects
💻 macOS / Ubuntu dotfiles
A curated list of dotfiles resources.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot