Skip to content

Latest commit

 

History

History
300 lines (206 loc) · 8.44 KB

README.md

File metadata and controls

300 lines (206 loc) · 8.44 KB

dotfiles

My custom dotfiles for Linux

contributors last update forks stars open issues license


📔 Table of Contents

🌟 About the Project

🎯 Features

Warning: Use at your own risk. Please acknowledge for what you are copying and what you are using it for.

  • Easy to install packages.
  • Secure your dotfiles in the private folder.
  • Easy to add your specific tools.

🧰 Getting Started

‼️ Prerequisites

  • Git should be installed on your system:

    sudo apt-get install git
  • Bash shell support.

🏃 Run Locally

  • Run from script:

    File install.sh will clone this repository in ~/dotfiles and run bootstrap.sh to install all packages and dotfiles.

    curl -sSL https://raw.githubusercontent.com/DuckyMomo20012/dotfiles/main/install.sh | bash -
  • Run manually:

    Clone the project:

    git clone https://github.com/DuckyMomo20012/dotfiles.git

    Go to the project directory:

    cd dotfiles

    Run the bootstrap script:

    ./bootstrap.sh

👀 Usage

Note: This project is tested on Ubuntu 22.04.1 LTS and Ubuntu 22.10.

File bootstrap.sh will find all setup.sh files in all directories and run it. But before that, it will run setup.sh in the packages directory, to make sure all dependency packages are installed.

🗂️ Project Structure:

  • asdf: Setup the asdf tool version manager and install plugins.
  • completions: Setup bash completions.
  • crontab: Setup cron jobs.
  • devops: Setup DevOps tools.
  • dotfiles: Setup dotfiles.
  • gpg: Scripts to encrypt files in the private directory or export/import gpg keys.
  • ibus-bamboo: Setup ibus-bamboo Vietnamese input method.
  • misc: Miscellaneous scripts.
  • packages: Install packages.
  • poetry: Setup poetry Python package manager.
  • private: Private dotfiles, will be ignored and encrypted.
  • utils: Utility scripts for this project.
  • zsh: Setup zsh shell.

Each directory will have a README.md file to explain what it does and how to customize.

🧃 Fresh Machine Setup:

Assume your current directory has this structure:

.
├── Other packages
│   └── zoom_amd64.deb
├── bootstrap.sh
├── google-chrome-stable_current_amd64.deb
└── secret.asc

Then the code below will do the following:

  • Install .deb packages in the top-level directory, but other packages in a nested directory, e.g. Other packages won't be installed.
  • Download the file install.sh from this repository and run it.
  • Import the secret key from the secret.asc file.
  • Decrypt the private directory.

Note: secret.asc file should be a secret key file, not a public key file.

Note: Please replace <YOUR-PASSWORD> with your passphrase, or you can remove it and enter your passphrase when prompted.

Every step is run seamlessly without any prompts, so you won't have any interruptions during running the script.

#!/usr/bin/env bash

curr_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# We have cd to directory to make sure find only searches in this directory
cd "$curr_dir"

mkdir -p "/tmp/packages/"

find * -maxdepth 0 -name "*.deb" -type f | while read package; do
    cp "$curr_dir/$package" "/tmp/packages"

    sudo apt install -y "/tmp/packages/$package"
done

rm -rf "/tmp/packages/"

sudo apt-get install -y curl git

curl -sSL https://raw.githubusercontent.com/DuckyMomo20012/dotfiles/main/install.sh | bash -

$HOME/dotfiles/gpg/import.sh -f "$curr_dir/secret.asc"

$HOME/dotfiles/gpg/dedot.sh -p "<YOUR-PASSWORD>"

🧭 Roadmap

  • Colorize output.

👋 Contributing

Contributions are always welcome!

📜 Code of Conduct

Please read the Code of Conduct.

❔ FAQ

  • Is this project still maintained?

    • Yes, I will add more dotfiles when I use new tools or have some modifications to my current dotfiles.
  • Is this project support other Linux distributions or MacOS?

    • I don't know, because I don't have time to test it, so some scripts may not work on other distributions. But you can try it and let me know if it works.

⚠️ License

Distributed under MIT license. See LICENSE for more information.

🤝 Contact

Duong Vinh - @duckymomo20012 - [email protected]

Project Link: https://github.com/DuckyMomo20012/dotfiles.

💎 Acknowledgements

Here are useful resources and libraries that I have used in my projects:

  • Awesome Readme Template: A detailed template to bootstrap your README file quickly.

  • rkalis/dotfiles: A good dotfiles project that inspired me with the keep sudo alive approach, extract install command from file name and some other things.

  • holman/dotfiles: Good folder structure and symlink approach.

  • explainshell.com: A website to explain shell commands.

  • ShellCheck: Finds bugs in your shell scripts.

  • DOCOPT: Command-line interface description language.

  • Command Line Interface Guidelines: An open-source guide to help you write better command-line programs, taking traditional UNIX principles and updating them for the modern day.