Merge branch 'master' of github.com:Lissy93/dotfiles

This commit is contained in:
Alicia Sykes 2022-10-22 16:36:42 +01:00
commit 31cb825d84
6 changed files with 238 additions and 191 deletions

100
.github/README.md vendored
View File

@ -7,10 +7,10 @@
## Contents ## Contents
- [Introduction to Dotfiles](#intro) - [Introduction to Dotfiles](#intro)
- [What are dotfiles?](#what-are-dotfiles) - [What are dotfiles?](#what-are-dotfiles)
- [Dotfile Management Systems](#dotfile-management-systems)
- [XDG Directories](#xdg-directories) - [XDG Directories](#xdg-directories)
- [Containerized Userspace](#containerized-userspace) - [Containerized Userspace](#containerized-userspace)
- [Security](#security) - [Security](#security)
- [Dotfile Management Systems](#dotfile-management-systems)
- [So copy paste, right?](#so-copy-paste-right) - [So copy paste, right?](#so-copy-paste-right)
- [My Dots](#my-dotfiles) - [My Dots](#my-dotfiles)
- [Setup](#setup) - [Setup](#setup)
@ -43,11 +43,46 @@ It's not hard to create your own dotfile repo, it's great fun and you'll learn a
--- ---
### XDG Directories
The location of most config files can be defined using the [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec), which is honored by most apps. This lets you specify where config, log, cache and data files are stored, keeping your top-level home directory free from clutter. You can do this by setting environmental variables, usually within the [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshenv) file.
Variable | Location
--- | ---
`XDG_CONFIG_HOME` | `~/.config`
`XDG_DATA_HOME` | `~/.local/share`
`XDG_BIN_HOME` | `~/.local/bin`
`XDG_LIB_HOME` | `~/.local/lib`
`XDG_CACHE_HOME` | `~/.local/var/cache`
---
### Containerized Userspace
You can also containerize your dotfiles, meaning with a single command, you can spin up a fresh virtual environment on any system, and immediately feel right at home with all your packages and configurations.
This is awesome for a number of reasons: 1) Super minimal dependency installation on the host 2) Blazing fast, as you can pull your built image from a registry, instead of compiling everything locally 3) Cross-platform compatibility, whatever your host OS is, you can always have a familiar Linux system in the container 4) Security, you can control which host resources are accessible within each container
For this, I'm using an Alpine-based Docker container defined in the [`Dockerfile`](https://github.com/Lissy93/dotfiles/blob/master/Dockerfile), to try it out, just run `docker run lissy93/dotfiles`.
Other options could include spinning up VMs with a predefined config, either using something like [Vagrant](https://www.vagrantup.com/) or a [NixOS](https://nixos.org/)-based config.
---
### Security
Something that is important to keep in mind, is security. Often you may have some personal info included in some of your dotfiles. Before storing anything on the internet, double check there's no sensitive info, SSH keys, API keys or plaintext passwords. If you're using git, then any files you wouldn't want to be commited, can just be listed in your [`.gitignore`](https://git-scm.com/docs/gitignore). If any .gitignore'd files are imported by other files, be sure to check they exist, so you don't get errors when cloning onto a fresh system.
Another solution, is to encrypt sensitive info. A great tool for this is [`pass`](https://www.passwordstore.org/) as it makes GPG-encrypting passwords very easy ([this article](https://www.outcoldman.com/en/archive/2015/09/17/keep-sensitive-data-encrypted-in-dotfiles/) outlines how), or you could also just use plain old GPG (as outlined in [this article](https://www.abdullah.today/encrypted-dotfiles/)).
---
### Dotfile Management Systems ### Dotfile Management Systems
In terms of managing and applying your dotfiles, you can make things simple, or complex as you like. In terms of managing and applying your dotfiles, you can make things simple, or complex as you like.
The two most common approaches are be either symlinking, or using git bare repo, but you could also do things manually by writing a simple script. The two most common approaches are be either [symlinking](#option-1---symlinking), or using [git bare repo](#option-2---git-bare-repo), but you could also do things manually by writing a simple script.
#### Option 1 - Symlinking #### Option 1 - Symlinking
@ -96,41 +131,6 @@ To learn more, DistroTube made an excellent [video about bare git repos](https:/
In terms of managing dependencies, using either [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) or [git subtree](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt) will let you keep dependencies in your project, while also separate from your own code and easily updatable. In terms of managing dependencies, using either [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) or [git subtree](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt) will let you keep dependencies in your project, while also separate from your own code and easily updatable.
---
### XDG Directories
One of my goals was to try and keep the top-level user home directory as clean as possible by honouring the [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec), which lets you specify the locations for config, cache, data, log and other files. This is done by setting environmental variables within [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshenv).
You can modify any of these values, but by default the following paths are used:
Variable | Location
--- | ---
`XDG_CONFIG_HOME` | `~/.config`
`XDG_DATA_HOME` | `~/.local/share`
`XDG_BIN_HOME` | `~/.local/bin`
`XDG_LIB_HOME` | `~/.local/lib`
`XDG_CACHE_HOME` | `~/.local/var/cache`
---
### Containerized Userspace
You can also containerize your dotfiles, meaning with a single command, you can spin up a fresh virtual environment on any system, and immediately feel right at home with all your packages and configurations.
This is awesome for a number of reasons: 1) Super minimal dependency installation on the host 2) Blazing fast, as you can pull your built image from a registry, instead of compiling everything locally 3) Cross-platform compatibility, whatever your host OS is, you can always have a familiar Linux system in the container 4) Security, you can control which host resources are accessible within each container
For this, I'm using an Alpine-based Docker container defined in the [`Dockerfile`](https://github.com/Lissy93/dotfiles/blob/master/Dockerfile), to try it out, just run `docker run lissy93/dotfiles`.
Other options could include spinning up VMs with a predefined config, either using something like [Vagrant](https://www.vagrantup.com/) or a [NixOS](https://nixos.org/)-based config.
---
### Security
Something that is important to keep in mind, is security. Often you may have some personal info included in some of your dotfiles. Before storing anything on the internet, double check there's no sensitive info, SSH keys, API keys or plaintext passwords. If you're using git, then any files you wouldn't want to be commited, can just be listed in your [`.gitignore`](https://git-scm.com/docs/gitignore). If any .gitignore'd files are imported by other files, be sure to check they exist, so you don't get errors when cloning onto a fresh system.
Another solution, is to encrypt sensitive info. A great tool for this is [`pass`](https://www.passwordstore.org/) as it makes GPG-encrypting passwords very easy ([this article](https://www.outcoldman.com/en/archive/2015/09/17/keep-sensitive-data-encrypted-in-dotfiles/) outlines how), or you could also just use plain old GPG (as outlined in [this article](https://www.abdullah.today/encrypted-dotfiles/)).
--- ---
@ -140,7 +140,7 @@ Zach Holman wrote a great article titled [Dotfiles Are Meant to Be Forked](https
By all means feel free to take what you want from mine. I've taken care to ensure that each file is standalone, and well documented so that certain files can just be dropped into any system. But I cannot stress enough the importance of reading through files to ensure it's actually what you want. By all means feel free to take what you want from mine. I've taken care to ensure that each file is standalone, and well documented so that certain files can just be dropped into any system. But I cannot stress enough the importance of reading through files to ensure it's actually what you want.
If you're looking for some more example dotfile repos to get you started, I can highly recommend taking a look at: [holman](https://github.com/holman/dotfiles). If you're looking for some more example dotfile repos to get you started, I can highly recommend taking a look at: [@holman/dotfiles](https://github.com/holman/dotfiles), [@nickjj/dotfiles](https://github.com/nickjj/dotfiles), [@caarlos0/dotfiles](https://github.com/caarlos0/dotfiles), [@cowboy/dotfiles](https://github.com/cowboy/dotfiles).
There's even more to check out at [webpro/awesome-dotfiles](https://github.com/webpro/awesome-dotfiles), [dotfiles.github.io](https://dotfiles.github.io/) and [r/unixporn](https://www.reddit.com/r/unixporn/). There's even more to check out at [webpro/awesome-dotfiles](https://github.com/webpro/awesome-dotfiles), [dotfiles.github.io](https://dotfiles.github.io/) and [r/unixporn](https://www.reddit.com/r/unixporn/).
@ -148,9 +148,6 @@ There's even more to check out at [webpro/awesome-dotfiles](https://github.com/w
## My Dotfiles ## My Dotfiles
> **Note**
> This repo is still a work in progress
### Setup ### Setup
> **Warning** > **Warning**
@ -164,7 +161,7 @@ bash <(curl -s https://raw.githubusercontent.com/Lissy93/dotfiles/master/lets-go
This will execute the quick setup script (in [`lets-go.sh`](https://github.com/Lissy93/dotfiles/blob/master/lets-go.sh)), which just clones the repo (if not yet present), then executes the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script. You can re-run this at anytime to update the dotfiles. You can also optionally pass in some variables to change the install location (`DOTFILES_DIR`) and source repo (`DOTFILES_REPO`) to use your fork. This will execute the quick setup script (in [`lets-go.sh`](https://github.com/Lissy93/dotfiles/blob/master/lets-go.sh)), which just clones the repo (if not yet present), then executes the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script. You can re-run this at anytime to update the dotfiles. You can also optionally pass in some variables to change the install location (`DOTFILES_DIR`) and source repo (`DOTFILES_REPO`) to use your fork.
The install script is idempotent, it can be run multiple times without changing the result, beyond the initial application. It will take care of checking that all dependencies are present, and will prompt the user to install missing packages, using the appropriate package manager (currently supports brew, pacman, apt and pkg). The install script takes care of installing / updating ZSH, Tmux and Vim all plugins. The install script [does several things](#install-script), it takes care of checking dependencies are met, updating dotfiles and symlinks, configuring CLI (Vim, Tmux, ZSH, etc), and will prompt the user to install listed packages, update the OS and apply any system preferences. The script is idempotent, so it can be run multiple times without changing the result, beyond the initial application.
_Alternatively, you can clone the repo yourself, cd into it, allow execution of [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) then run it to install or update._ _Alternatively, you can clone the repo yourself, cd into it, allow execution of [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) then run it to install or update._
@ -178,7 +175,7 @@ chmod +x ~/.dotfiles/install.sh
~/.dotfiles/install.sh ~/.dotfiles/install.sh
``` ```
You'll probably want to fork the repo, then clone your fork instead, so update the above commands with the path to your repo, and optioanlly change the clone location on your disk. You'll probably want to fork the repo, then clone your fork instead, so update the above commands with the path to your repo, and optionally change the clone location on your disk.
Once the repo is cloned, you can modify whatever files you like before running the install script. The [Directory Structure](#directory-structure) section provides an overview of where each file is located. Then see the [Configuring](#configuring) section for setting file paths and symlink locations. Once the repo is cloned, you can modify whatever files you like before running the install script. The [Directory Structure](#directory-structure) section provides an overview of where each file is located. Then see the [Configuring](#configuring) section for setting file paths and symlink locations.
@ -196,10 +193,13 @@ Once the repo is cloned, you can modify whatever files you like before running t
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/tmux" title="Tmux Configs">tmux/</a> ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/tmux" title="Tmux Configs">tmux/</a>
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/vim" title="Vim Configs">vim/</a> ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/vim" title="Vim Configs">vim/</a>
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/zsh" title="ZSH Configs">zsh/</a> ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/zsh" title="ZSH Configs">zsh/</a>
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/installs" title="List of packages to install">installs/</a> └── <a href="https://github.com/Lissy93/dotfiles/tree/master/installs" title="List of packages to install">installs/</a>
├── <a href="https://github.com/Lissy93/dotfiles/blob/master/installs/Brewfile" title="Packages for MacOS via Homebrew">Brewfile</a>
├── <a href="https://github.com/Lissy93/dotfiles/blob/master/installs/arch-pacman.sh" title="Packages for Arch Linux via Pacman">arch-pacman.sh</a>
└── <a href="https://github.com/Lissy93/dotfiles/blob/master/installs/flatpak.sh" title="Packages for Linux Desktops via Flatpak">flatpak.sh</a>
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/.github" title="Repo Meta">.github/</a> ├── <a href="https://github.com/Lissy93/dotfiles/tree/master/.github" title="Repo Meta">.github/</a>
├── <a href="https://github.com/Lissy93/dotfiles/blob/master/lets-go.sh" title="Remote Setup Initiator">lets-go.sh</a> ├── <a href="https://github.com/Lissy93/dotfiles/blob/master/lets-go.sh" title="Remote Setup Initiator">lets-go.sh</a>
└── <a href="https://github.com/Lissy93/dotfiles/blob/master/install.sh" title="Setup Script">install.sh</a> ── <a href="https://github.com/Lissy93/dotfiles/blob/master/install.sh" title="Setup Script">install.sh</a>
└── <a href="https://github.com/Lissy93/dotfiles/blob/master/symlinks.yml" title="Symlink location list">symlinks.yml</a> └── <a href="https://github.com/Lissy93/dotfiles/blob/master/symlinks.yml" title="Symlink location list">symlinks.yml</a>
</pre> </pre>
@ -207,7 +207,7 @@ Once the repo is cloned, you can modify whatever files you like before running t
### Install Script ### Install Script
The install script will do the following: The setup script ([`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh)) will do the following:
- **Setup** - **Setup**
- Print welcome message, and a summary of proposed changes, and prompt user to continue - Print welcome message, and a summary of proposed changes, and prompt user to continue
@ -613,6 +613,7 @@ The following section lists different apps that may be installed for each catego
- [`bat`](https://github.com/sharkdp/bat) - Output highlighting _(better cat)_ - [`bat`](https://github.com/sharkdp/bat) - Output highlighting _(better cat)_
- [`ctags`](https://github.com/universal-ctags/ctags) - Indexing of file info + headers - [`ctags`](https://github.com/universal-ctags/ctags) - Indexing of file info + headers
- [`diff-so-fancy`](https://github.com/so-fancy/diff-so-fancy) - Readable file compares _(better diff)_ - [`diff-so-fancy`](https://github.com/so-fancy/diff-so-fancy) - Readable file compares _(better diff)_
- [`entr`](https://eradman.com/entrproject/) - Run command whenever file changes
- [`duf`](https://github.com/muesli/duf) - Get info on mounted disks _(better df)_ - [`duf`](https://github.com/muesli/duf) - Get info on mounted disks _(better df)_
- [`exa`](https://github.com/ogham/exa) - Listing files with info _(better ls)_ - [`exa`](https://github.com/ogham/exa) - Listing files with info _(better ls)_
- [`fzf`](https://github.com/junegunn/fzf) - Fuzzy file finder and filtering - [`fzf`](https://github.com/junegunn/fzf) - Fuzzy file finder and filtering
@ -627,6 +628,7 @@ The following section lists different apps that may be installed for each catego
- [`tldr`](https://github.com/tldr-pages/tldr) - Community-maintained docs _(better man)_ - [`tldr`](https://github.com/tldr-pages/tldr) - Community-maintained docs _(better man)_
- [`tree`](https://gitlab.com/OldManProgrammer/unix-tree) - Directory listings as tree - [`tree`](https://gitlab.com/OldManProgrammer/unix-tree) - Directory listings as tree
- [`trash-cli`](https://github.com/andreafrancia/trash-cli) - Record + restore removed files - [`trash-cli`](https://github.com/andreafrancia/trash-cli) - Record + restore removed files
- [`watch`](https://gitlab.com/procps-ng/procps) - Run commands periorically
- [`xsel`](https://github.com/kfish/xsel) - Copy paste access to X clipboard - [`xsel`](https://github.com/kfish/xsel) - Copy paste access to X clipboard
- [`zoxide`](https://github.com/ajeetdsouza/zoxide) - Easy navigation _(better cd)_ - [`zoxide`](https://github.com/ajeetdsouza/zoxide) - Easy navigation _(better cd)_
@ -993,12 +995,13 @@ Tmux plugins are managed using [TMP](https://github.com/tmux-plugins/tpm) and de
// TODO // TODO
Git aliases for ZSH are located in [`/zsh/aliases/git.zsh`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/git.zsh), and are documented under the [Aliases](https://github.com/lissy93/dotfiles#my-aliases) section, above.
--- ---
## Dependencies ## Dependencies
These dot files make use of the following packages, and hence they are required It's strongly recomended to have the following packages installed on your system before proceeding:
- [zsh](https://www.zsh.org/) - Interactive Shell - [zsh](https://www.zsh.org/) - Interactive Shell
- [nvim](http://neovim.io/) - Extensible Vim-based text editor - [nvim](http://neovim.io/) - Extensible Vim-based text editor
@ -1012,11 +1015,8 @@ They can be easily installed/ updated with your package manger, e.g:
- Alpine: `apk add zsh neovim tmux ranger git` - Alpine: `apk add zsh neovim tmux ranger git`
- MacOS: `brew install zsh neovim tmux ranger git` - MacOS: `brew install zsh neovim tmux ranger git`
Depending on your setup, the following utils may also be required: `make`, `ctags`, `fzf` and `python3-pip`
--- ---
### Utilities ### Utilities

View File

@ -3,6 +3,7 @@ FROM alpine:latest
LABEL maintainer "Alicia Sykes <https://aliciasykes.com>" LABEL maintainer "Alicia Sykes <https://aliciasykes.com>"
LABEL org.opencontainers.image.source https://github.com/lissy93/dotfiles LABEL org.opencontainers.image.source https://github.com/lissy93/dotfiles
# Parameters
ARG user=alicia ARG user=alicia
ARG group=wheel ARG group=wheel
ARG uid=1000 ARG uid=1000
@ -11,8 +12,8 @@ ARG userspace=userspace.git
ARG vcsprovider=github.com ARG vcsprovider=github.com
ARG vcsowner=lissy93 ARG vcsowner=lissy93
# Install system packages, with root
USER root USER root
RUN \ RUN \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk upgrade --no-cache && \ apk upgrade --no-cache && \
@ -54,12 +55,19 @@ RUN \
chown -R ${user}:${group} /home/${user}/.dotfiles && \ chown -R ${user}:${group} /home/${user}/.dotfiles && \
chown -R ${user}:${group} /home/${user}/.userspace chown -R ${user}:${group} /home/${user}/.userspace
ENV DOTFILES_DIR="$HOME/.dotfiles"
RUN chmod u+x /home/${user}/.dotfiles/install.sh RUN chmod u+x /home/${user}/.dotfiles/install.sh
USER ${user} USER ${user}
RUN cd $HOME/.dotfiles && ./install.sh RUN cd $HOME/.dotfiles && ./install.sh --auto-yes
ENV HISTFILE=/home/${user}/.cache/.zsh_history ENV HISTFILE=/home/${user}/.cache/.zsh_history
CMD [] CMD []
ENTRYPOINT [ "/bin/zsh" ]
# docker run -it --rm -w "$HOME" -v "$HOME/.userspace":/userspace -v $PWD:/cwd -v $HOME/.config:/config:rw -v /var/run/docker.sock:/var/run/docker.sock --network host dot-test

View File

@ -268,3 +268,9 @@
smudge = git-lfs smudge -- %f smudge = git-lfs smudge -- %f
process = git-lfs filter-process process = git-lfs filter-process
required = true required = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Users/alicia/Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true

View File

@ -12,15 +12,23 @@
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> # # Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
###################################################################### ######################################################################
# Configuration Params # Dotfiles Source Repo and Destination Directory
REPO_NAME="${REPO_NAME:-Lissy93/Dotfiles}" REPO_NAME="${REPO_NAME:-Lissy93/Dotfiles}"
REPO_PATH="https://github.com/${REPO_NAME}.git" DOTFILES_DIR="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}"
DOTFILES_REPO="${DOTFILES_REPO:-https://github.com/${REPO_NAME}.git}"
# Config Names and Locations
TITLE="🧰 ${REPO_NAME} Setup"
SYMLINK_FILE="${SYMLINK_FILE:-symlinks.yaml}" SYMLINK_FILE="${SYMLINK_FILE:-symlinks.yaml}"
DOTBOT_DIR="dotbot" DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot" DOTBOT_BIN="bin/dotbot"
# Set variables for reference
PARAMS=$* # User-specified parameters
CURRENT_DIR=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd) CURRENT_DIR=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd)
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}" SYSTEM_TYPE=$(uname -s) # Get system type - Linux / MacOS (Darwin)
TITLE="🧰 ${REPO_NAME} Setup" PROMPT_TIMEOUT=15 # When user is prompted for input, skip after x seconds
START_TIME=`date +%s` # Start timer
# Color Variables # Color Variables
CYAN_B='\033[1;96m' CYAN_B='\033[1;96m'
@ -32,19 +40,13 @@ RESET='\033[0m'
GREEN='\033[0;32m' GREEN='\033[0;32m'
PURPLE='\033[0;35m' PURPLE='\033[0;35m'
# Other params
start_time=`date +%s` # Start timer
PROMPT_TIMEOUT=15 # When user is prompted for input, skip after x seconds
system_type=$(uname -s) # Get system type - Linux / MacOS (Darwin)
params=$* # Get passed in params
# Clear the screen # Clear the screen
if [[ ! $params == *"--no-clear"* ]]; then if [[ ! $PARAMS == *"--no-clear"* ]]; then
clear clear
fi fi
# If set to auto-yes - then don't wait for user reply # If set to auto-yes - then don't wait for user reply
if [[ $params == *"--auto-yes"* ]]; then if [[ $PARAMS == *"--auto-yes"* ]]; then
PROMPT_TIMEOUT=1 PROMPT_TIMEOUT=1
REPLY='Y' REPLY='Y'
fi fi
@ -120,17 +122,18 @@ system_verify () {
# Prints welcome banner, verifies that requirements are met # Prints welcome banner, verifies that requirements are met
function pre_setup_tasks () { function pre_setup_tasks () {
# Show starting banner # Show pretty starting banner
make_banner "${TITLE}" "${CYAN_B}" 1 make_banner "${TITLE}" "${CYAN_B}" 1
# Print list of what will be applied # Print intro, listing what changes will be applied
make_intro make_intro
# Confirm user would like to proceed # Confirm that the user would like to proceed
echo -e "\n${CYAN_B}Are you happy to continue? (y/N)${RESET}" echo -e "\n${CYAN_B}Are you happy to continue? (y/N)${RESET}"
read -t $PROMPT_TIMEOUT -n 1 -r read -t $PROMPT_TIMEOUT -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]; then if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "\n${PURPLE}No worries, feel free to come back another time.\nTerminating...${RESET}" echo -e "\n${PURPLE}No worries, feel free to come back another time.\nTerminating...${RESET}"
make_banner "🚧 Installation Aborted" ${YELLOW_B} 1
exit 0 exit 0
fi fi
echo echo
@ -151,7 +154,7 @@ function setup_dot_files () {
then then
echo -e "${PURPLE}Dotfiles not yet present. Will download ${REPO_NAME} into ${DOTFILES_DIR}${RESET}" echo -e "${PURPLE}Dotfiles not yet present. Will download ${REPO_NAME} into ${DOTFILES_DIR}${RESET}"
mkdir -p "${DOTFILES_DIR}" mkdir -p "${DOTFILES_DIR}"
git clone --recursive ${REPO_PATH} ${DOTFILES_DIR} git clone --recursive ${DOTFILES_REPO} ${DOTFILES_DIR}
else else
echo -e "${PURPLE}Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}${RESET}" echo -e "${PURPLE}Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}${RESET}"
cd "${DOTFILES_DIR}" && git pull origin master && git submodule update --recursive cd "${DOTFILES_DIR}" && git pull origin master && git submodule update --recursive
@ -204,7 +207,7 @@ function apply_preferences () {
# Apply general system, app and OS security preferences (prompt user first) # Apply general system, app and OS security preferences (prompt user first)
read -t $PROMPT_TIMEOUT -p "$(echo -e $CYAN_B)Would you like to apply system preferences? (y/N)" -n 1 -r read -t $PROMPT_TIMEOUT -p "$(echo -e $CYAN_B)Would you like to apply system preferences? (y/N)" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ $REPLY =~ ^[Yy]$ ]]; then
if [ "$system_type" = "Darwin" ]; then if [ "$SYSTEM_TYPE" = "Darwin" ]; then
echo -e "\n${PURPLE}Applying MacOS system preferences, ensure you've understood before proceeding${RESET}\n" echo -e "\n${PURPLE}Applying MacOS system preferences, ensure you've understood before proceeding${RESET}\n"
macos_settings_dir="$DOTFILES_DIR/system-specific/macos/system-settings" macos_settings_dir="$DOTFILES_DIR/system-specific/macos/system-settings"
for macScript in "macos-security.sh" "macos-preferences.sh" "macos-apps.sh"; do for macScript in "macos-security.sh" "macos-preferences.sh" "macos-apps.sh"; do
@ -229,10 +232,12 @@ function intall_macos_packages () {
# Update / Install the Homebrew packages in ~/.Brewfile # Update / Install the Homebrew packages in ~/.Brewfile
if command_exists brew && [ -f "$DOTFILES_DIR/installs/Brewfile" ]; then if command_exists brew && [ -f "$DOTFILES_DIR/installs/Brewfile" ]; then
echo -e "\n${PURPLE}Updating homebrew and packages...${RESET}" echo -e "\n${PURPLE}Updating homebrew and packages...${RESET}"
brew update brew doctor # Check for any app issues
brew upgrade brew update # Update Brew to latest version
brew bundle --global --file $HOME/.Brewfile brew upgrade # Upgrade all installed casks
brew cleanup brew bundle --global --file $HOME/.Brewfile # Install all listed Brew apps
brew cleanup # Remove stale lock files and outdated downloads
killall Finder # Restart finder (required for some apps)
else else
echo -e "${PURPLE}Skipping Homebrew as requirements not met${RESET}" echo -e "${PURPLE}Skipping Homebrew as requirements not met${RESET}"
fi fi
@ -267,7 +272,7 @@ function install_packages () {
echo -e "${PURPLE}Skipping package installs${RESET}" echo -e "${PURPLE}Skipping package installs${RESET}"
return return
fi fi
if [ "$system_type" = "Darwin" ]; then if [ "$SYSTEM_TYPE" = "Darwin" ]; then
# Mac OS # Mac OS
intall_macos_packages intall_macos_packages
elif [ -f "/etc/arch-release" ]; then elif [ -f "/etc/arch-release" ]; then
@ -290,8 +295,14 @@ function finishing_up () {
source "${HOME}/.zshenv" source "${HOME}/.zshenv"
# Print success message, and time taken # Print success message, and time taken
total_time=$((`date +%s`-start_time)) total_time=$((`date +%s`-START_TIME))
make_banner "✨ Dotfiles configured succesfully in $total_time seconds" ${GREEN_B} 1 if [[ $total_time -gt 60 ]]; then
total_time="$(($total_time/60)) minutes"
else
total_time="${total_time} seconds"
fi
make_banner "✨ Dotfiles configured succesfully in $total_time" ${GREEN_B} 1
echo -e "\033[0;92m .--.\n |o_o |\n |:_/ |\n // \ echo -e "\033[0;92m .--.\n |o_o |\n |:_/ |\n // \
\ \\ \n (| | ) \n /'\_ _/\`\\ \n \\___)=(___/\n" \ \\ \n (| | ) \n /'\_ _/\`\\ \n \\___)=(___/\n"
@ -305,7 +316,7 @@ function finishing_up () {
} }
# If --help flag passed in, just show the help menu # If --help flag passed in, just show the help menu
if [[ $params == *"--help"* ]]; then if [[ $PARAMS == *"--help"* ]]; then
make_intro make_intro
exit 0 exit 0
fi fi

View File

@ -40,6 +40,7 @@ brew 'broot' # Interactive directory navigation
brew 'ctags' # Indexing of file info + headers brew 'ctags' # Indexing of file info + headers
brew 'diff-so-fancy'# Readable file compares (better diff) brew 'diff-so-fancy'# Readable file compares (better diff)
brew 'duf' # Get info on mounted disks (better df) brew 'duf' # Get info on mounted disks (better df)
brew 'entr' # Run command whenever file changes
brew 'exa' # Listing files with info (better ls) brew 'exa' # Listing files with info (better ls)
brew 'fzf' # Fuzzy file finder and filtering brew 'fzf' # Fuzzy file finder and filtering
brew 'hyperfine' # Benchmarking for arbitrary commands brew 'hyperfine' # Benchmarking for arbitrary commands
@ -54,6 +55,7 @@ brew 'thefuck' # Auto-correct miss-typed commands
brew 'tldr' # Community-maintained docs (better man) brew 'tldr' # Community-maintained docs (better man)
brew 'tree' # Directory listings as tree structure brew 'tree' # Directory listings as tree structure
brew 'trash-cli' # Record and restore removed files brew 'trash-cli' # Record and restore removed files
brew 'watch' # Run commands periorically
brew 'xsel' # Copy paste access to the X clipboard brew 'xsel' # Copy paste access to the X clipboard
brew 'zoxide' # Auto-learning navigation (better cd) brew 'zoxide' # Auto-learning navigation (better cd)
@ -68,6 +70,7 @@ brew 'ncdu' # Disk usage analyzer and monitor (better du)
brew 'speedtest-cli'# Command line speed test utility brew 'speedtest-cli'# Command line speed test utility
# CLI Productivity Apps # CLI Productivity Apps
brew 'aspell' # Spell check
brew 'browsh' # Web browser, in terminal brew 'browsh' # Web browser, in terminal
brew 'buku' # Bookmark manager brew 'buku' # Bookmark manager
brew 'cmus' # Music player brew 'cmus' # Music player
@ -103,7 +106,7 @@ brew 'pv' # Pipe viewer, with animation options
# Development Apps # Development Apps
cask 'android-studio' # IDE for Android development cask 'android-studio' # IDE for Android development
cask 'boop' # Test transformation tool cask 'boop' # Text transformation tool
brew 'gradle' # Build automation for Java brew 'gradle' # Build automation for Java
cask 'iterm2' # Better terminal emulator cask 'iterm2' # Better terminal emulator
cask 'postman' # HTTP API testing app cask 'postman' # HTTP API testing app
@ -156,32 +159,6 @@ cask 'veracrypt' # File and volume encryption
# Desktop Applications # # Desktop Applications #
############################################################# #############################################################
# Mac OS Mods and Imrovments
cask 'alt-tab' # Much better alt-tab window switcher
cask 'anybar' # Custom programatic menubar icons
cask 'copyq' # Clipboard manager (cross platform)
cask 'espanso' # Live text expander (cross-platform)
cask 'finicky' # Website-specific default browser
cask 'hiddenbar' # Hide / show annoying menubar icons
brew 'iproute2mac' # MacOS port of netstat and ifconfig
brew 'lporg' # Backup and restore launchpad layout
brew 'm-cli' # All in one MacOS management CLI app
cask 'mjolnir' # Util for loading Lua automations
cask 'openinterminal' # Finder button, opens directory in terminal
cask 'popclip' # Popup options for text on highlight
cask 'raycast', args: { require_sha: false } # Spotlight alternative
cask 'shottr' # Better screenshot utility
brew 'skhd' # Hotkey daemon for macOS
cask 'stats' # System resource usage in menubar
brew 'yabai' # Tiling window manager
# Utility apps
cask 'coteditor' # Just a simple plain-text editor
cask 'little-snitch' # Firewall app viewing / blocking traffic
cask 'keka' # File archiver and extractor
cask 'onyx' # Repair util for verifying system files
cask 'daisydisk', args: { require_sha: false } # Disk space analyzer and cleaner
# Creativity # Creativity
cask 'audacity' # Audio editor / recorder cask 'audacity' # Audio editor / recorder
cask 'gimp' # Photo editor cask 'gimp' # Photo editor
@ -213,6 +190,10 @@ cask 'firefox'
cask 'chromium' cask 'chromium'
cask 'orion' cask 'orion'
#############################################################
# MacOS-Specific Stuff #
#############################################################
# Fonts # Fonts
tap 'homebrew/cask-fonts' tap 'homebrew/cask-fonts'
cask 'font-fira-code' cask 'font-fira-code'
@ -220,4 +201,41 @@ cask 'font-hack'
cask 'font-inconsolata' cask 'font-inconsolata'
cask 'font-meslo-lg-nerd-font' cask 'font-meslo-lg-nerd-font'
# Mac OS Quick-Look Plugins
cask 'qlcolorcode' # QL for code with highlighting
cask 'qlimagesize' # QL for size info for images
cask 'qlmarkdown' # QL for markdown files
cask 'qlprettypatch' # QL for patch / diff files
cask 'qlstephen' # QL for dev text files
cask 'qlvideo' # QL for video formats
cask 'quicklook-csv' # QL for tables in CSV format
cask 'quicklook-json', args: { require_sha: false } # QL for JSON, with trees
cask 'quicklookapk', args: { require_sha: false } # QL for Android APKs
cask 'suspicious-package', args: { require_sha: false } # QL for OSX app installers
cask 'webpquicklook', args: { require_sha: false } # QL for WebP image files
# Mac OS Mods and Imrovments
cask 'alt-tab' # Much better alt-tab window switcher
cask 'anybar' # Custom programatic menubar icons
cask 'copyq' # Clipboard manager (cross platform)
cask 'espanso' # Live text expander (cross-platform)
cask 'finicky' # Website-specific default browser
cask 'hiddenbar' # Hide / show annoying menubar icons
brew 'iproute2mac' # MacOS port of netstat and ifconfig
brew 'lporg' # Backup and restore launchpad layout
brew 'm-cli' # All in one MacOS management CLI app
cask 'mjolnir' # Util for loading Lua automations
cask 'openinterminal' # Finder button, opens directory in terminal
cask 'popclip' # Popup options for text on highlight
cask 'raycast', args: { require_sha: false } # Spotlight alternative
cask 'shottr' # Better screenshot utility
brew 'skhd' # Hotkey daemon for macOS
cask 'stats' # System resource usage in menubar
brew 'yabai' # Tiling window manager
# Mac OS Utility Apps
cask 'coteditor' # Just a simple plain-text editor
cask 'little-snitch' # Firewall app viewing / blocking traffic
cask 'keka' # File archiver and extractor
# EOF # EOF

View File

@ -1,6 +1,13 @@
# This file specifies folders for the MacOS launchpad, and which apps should be nested where. ######################################################################
# It's useful for setting up fresh systems quickly, after installing all required dependencies. # MacOS App Launchpad Layout #
# Requires lporg (brew install blacktop/tap/lporg), run `lporg load [file]` to restore layout. ######################################################################
# Specifies the folder layout and app order within OSX Launchpad #
# Useful for setting up fresh systems quickly after installing apps #
# Intended for use with lporg, run: brew install blacktop/tap/lporg #
# To restore launchpad layout with lporg, run: lporg load [file] #
# #
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
######################################################################
apps: apps:
pages: pages:
@ -18,6 +25,7 @@ apps:
- Sourcetree - Sourcetree
- UTM - UTM
- Visual Studio - Visual Studio
- MacDown
- folder: Work Coms - folder: Work Coms
pages: pages:
- number: 1 - number: 1
@ -67,62 +75,62 @@ apps:
- number: 1 - number: 1
items: items:
- Raycast - Raycast
- Scroll Reverser - Stats
- Hidden Bar - Hidden Bar
- AltTab - AltTab
- Finicky
- Stats
- Little Snitch
- Espanso
- CopyQ
- PopClip
- OpenInTerminal - OpenInTerminal
- Scroll Reverser
- AnyBar - AnyBar
- Marta - Shottr
- Little Snitch
- Finicky
- Espanso
- OnyX
- CopyQ
- amm
- PopClip
- Mjolnir - Mjolnir
- LinearMouse - LinearMouse
- Übersicht - Übersicht
- Shottr - MacForge
- OnyX
- folder: Other - folder: Other
pages: pages:
- number: 1 - number: 1
items: items:
- Shortcuts
- QuickTime Player
- TextEdit
- Grapher
- Time Machine
- Font Book
- Chess
- Stickies
- Image Capture
- VoiceOver Utility
- AirPort Utility
- Migration Assistant
- Terminal - Terminal
- Activity Monitor - Activity Monitor
- Console
- Keychain Access
- System Information
- Automator - Automator
- TextEdit
- System Information
- Keychain Access
- Script Editor - Script Editor
- Disk Utility - Disk Utility
- Console
- Screenshot
- Calculator
- System Preferences
- Simulator
- TestFlight
- Developer
- Time Machine
- Dictionary
- Stickies
- Shortcuts
- Grapher
- Digital Color Meter - Digital Color Meter
- ColorSync Utility - ColorSync Utility
- Screenshot - Font Book
- Bluetooth File Exchange - Chess
- Audio MIDI Setup - Audio MIDI Setup
- Developer - Image Capture
- Jabra Firmware Update - VoiceOver Utility
- Jabra Direct - Bluetooth File Exchange
- System Preferences - AirPort Utility
- Calculator - Migration Assistant
- Dictionary - QuickTime Player
- CotEditor
- VMware Fusion Tech Preview - VMware Fusion Tech Preview
- TestFlight - Jabra Direct
- Simulator - CotEditor
- number: 2 - number: 2
items: items:
- Orion - Orion
@ -135,29 +143,29 @@ apps:
items: items:
- Contacts - Contacts
- Reminders - Reminders
- Photos
- Numbers
- Pages
- Keynote
- Photo Booth
- Notes - Notes
- FaceTime - FaceTime
- Messages - Messages
- Maps - Maps
- Find My - Find My
- Photo Booth
- Photos
- Preview
- Music - Music
- Podcasts - Podcasts
- Books
- Preview
- TV - TV
- Voice Memos - Voice Memos
- Numbers
- Keynote
- Pages
- News - News
- Stocks - Stocks
- Books
- Siri - Siri
- App Store
- Mission Control - Mission Control
- Safari - Safari
- Home - Home
- App Store
- folder: Corporate Spyware - folder: Corporate Spyware
pages: pages:
- number: 1 - number: 1
@ -165,12 +173,13 @@ apps:
- Netskope Client - Netskope Client
- Self Service - Self Service
- Solarwinds Discovery Agent - Solarwinds Discovery Agent
- Kandji Extension Manager
- Sophos Endpoint - Sophos Endpoint
- Sophos Endpoint Self Help
- Sophos Network Extension - Sophos Network Extension
- Sophos Scan - Sophos Scan
- Remove Sophos Endpoint - Remove Sophos Endpoint
- Remove Netskope Client - Remove Netskope Client
- Sophos Endpoint Self Help
- folder: Voldermort - folder: Voldermort
pages: pages:
- number: 1 - number: 1
@ -183,8 +192,3 @@ apps:
- Chromium - Chromium
- Visual Studio Code - Visual Studio Code
- iTerm - iTerm
# widgets:
# pages: []
# dock_items:
# - ============
# desktop: {}