mirror of
https://github.com/Lissy93/dotfiles.git
synced 2024-11-24 16:33:14 +01:00
Resolve conflicts
This commit is contained in:
commit
60ff4eb75b
120
.gitattributes
vendored
Normal file
120
.gitattributes
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
# .gitattributes file contains repo-specific file and path attributes
|
||||
|
||||
|
||||
###############################
|
||||
# Git Line Endings #
|
||||
###############################
|
||||
|
||||
# Set default behaviour to automatically normalize line endings.
|
||||
* text=auto
|
||||
|
||||
# Use CFLF line endings for batch scripts, for opening in Windows via Unix
|
||||
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||
|
||||
# Use LF line endings for bash scripts, for opening in Unix via Windows
|
||||
*.sh text eol=lf
|
||||
|
||||
###############################
|
||||
# Git Large File System (LFS) #
|
||||
###############################
|
||||
|
||||
# Archives
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.br filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
# Documents
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
# Images
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
*.ico filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.psd filter=lfs diff=lfs merge=lfs -text
|
||||
*.webp filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
# Fonts
|
||||
*.woff2 filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
# Other
|
||||
*.exe filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
#####################
|
||||
# Binary File Types #
|
||||
#####################
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
|
||||
# Fonts
|
||||
*.ttf binary
|
||||
*.eot binary
|
||||
*.otf binary
|
||||
*.woff binary
|
||||
*.woff2 binary
|
||||
|
||||
##############################
|
||||
# Language Specific Settings #
|
||||
##############################
|
||||
|
||||
|
||||
|
||||
*.go -text diff=golang
|
||||
Dockerfile text
|
||||
|
||||
# Web Development
|
||||
*.bash text eol=lf
|
||||
*.bat text eol=crlf
|
||||
*.cmd text eol=crlf
|
||||
*.coffee text
|
||||
*.css text diff=css
|
||||
*.htm text diff=html
|
||||
*.html text diff=html
|
||||
*.inc text
|
||||
*.ini text
|
||||
*.js text
|
||||
*.json text
|
||||
*.jsx text
|
||||
*.less text
|
||||
*.ls text
|
||||
*.map text -diff
|
||||
*.od text
|
||||
*.onlydata text
|
||||
*.php text diff=php
|
||||
*.pl text
|
||||
*.ps1 text eol=crlf
|
||||
*.py text diff=python
|
||||
*.rb text diff=ruby
|
||||
*.sass text
|
||||
*.scm text
|
||||
*.scss text diff=css
|
||||
*.sh text eol=lf
|
||||
.husky/* text eol=lf
|
||||
*.sql text
|
||||
*.styl text
|
||||
*.tag text
|
||||
*.ts text
|
||||
*.tsx text
|
||||
*.xml text
|
||||
*.xhtml text diff=html
|
||||
|
||||
|
||||
AUTHORS text
|
||||
CHANGELOG text
|
||||
CHANGES text
|
||||
CONTRIBUTING text
|
||||
COPYING text
|
||||
copyright text
|
||||
*COPYRIGHT* text
|
||||
INSTALL text
|
||||
license text
|
||||
LICENSE text
|
||||
NEWS text
|
||||
readme text
|
||||
*README* text
|
||||
TODO text
|
||||
*.*ignore text
|
485
.github/README.md
vendored
485
.github/README.md
vendored
@ -15,14 +15,18 @@
|
||||
- [Security](#security)
|
||||
- [My Dots](#my-dots)
|
||||
- [Setup](#setup)
|
||||
- [Directory Structure](#directory-structure)
|
||||
- [Configuring](#configuring)
|
||||
- [Aliases](#aliases)
|
||||
- [Utilities](#utilities)
|
||||
- [Packages](#packages)
|
||||
- [System Preferences](#system-preferences)
|
||||
- [ZSH](#zsh)
|
||||
- [Vim](#vim)
|
||||
- [Tmux](#tmux)
|
||||
- [Git](#git)
|
||||
- [Dependencies](#dependencies)
|
||||
|
||||
---
|
||||
|
||||
## Intro
|
||||
@ -152,12 +156,29 @@ Another solution, is to encrypt sensitive info. A great tool for this is [`pass`
|
||||
|
||||
## My Dotfiles
|
||||
|
||||
> **Note**
|
||||
> This repo is still a work in progress
|
||||
|
||||
### Setup
|
||||
|
||||
> **Warning**
|
||||
> Prior to running the setup script, read through everything and confirm it's what you want.
|
||||
|
||||
To set everything up, just recursivley clone the repo, cd into it, allow execution of `install.sh` then run it to install.
|
||||
Let's Go!
|
||||
|
||||
```bash
|
||||
bash <(curl -s https://raw.githubusercontent.com/Lissy93/dotfiles/master/lets-go.sh)
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
_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._
|
||||
|
||||
<details>
|
||||
<summary>Example</summary>
|
||||
|
||||
|
||||
```bash
|
||||
git clone --recursive git@github.com:Lissy93/dotfiles.git ~/.dotfiles
|
||||
@ -165,13 +186,38 @@ chmod +x ~/.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.
|
||||
|
||||
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.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Directory Structure
|
||||
|
||||
<pre>
|
||||
~
|
||||
└── <a href="https://github.com/Lissy93/dotfiles" title="Root">.</a>
|
||||
├── <a href="https://github.com/Lissy93/dotfiles/tree/master/bash" title="Bash Config">bash/</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/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/.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/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>
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
### Configuring
|
||||
|
||||
The locations for all symlinks are defined in [`.install.conf.yaml`](https://github.com/Lissy93/dotfiles/blob/master/.install.conf.yaml). These are managed using [Dotbot](https://github.com/anishathalye/dotbot), and will be applied whenever you run the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script.
|
||||
The locations for all symlinks are defined in [`symlinks.yaml`](https://github.com/Lissy93/dotfiles/blob/master/symlinks.yaml). These are managed using [Dotbot](https://github.com/anishathalye/dotbot), and will be applied whenever you run the [`install.sh`](https://github.com/Lissy93/dotfiles/blob/master/install.sh) script. The symlinks set locations based on XDG paths, all of which are defined in [`.zshenv`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshenv).
|
||||
|
||||
The bootstrap configurations are idempotent (and so the installer can be run multiple times without causing any problems). To only install certain parts of the config, pass the `--only` flag to the install.sh script, similarly `--except` can be used to exclude certain directives.
|
||||
The bootstrap configurations are idempotent (and so the installer can be run multiple times without causing any problems).
|
||||
|
||||
---
|
||||
|
||||
@ -179,16 +225,24 @@ The bootstrap configurations are idempotent (and so the installer can be run mul
|
||||
|
||||
#### Into to Aliases
|
||||
|
||||
An alias is simply a command shortcut. These are very useful for long or frequently used commands.
|
||||
An alias is simply a command shortcut. These are very useful for shortening long or frequently used commands.
|
||||
|
||||
For example, if you frequently find yourself typing `git add .` you could add an alias like `alias gaa='git add .'`, then just type `gaa`. You can also override existing commands, for example to always show hidden files with `ls` you could set `alias ls='ls -a'`.
|
||||
<details>
|
||||
<summary>How to use Aliases</summary>
|
||||
|
||||
For example, if you often find yourself typing `git add .` you could add an alias like `alias gaa='git add .'`, then just type `gaa`. You can also override existing commands, for example to always show hidden files with `ls` you could set `alias ls='ls -a'`.
|
||||
|
||||
Aliases should almost always be created at the user-level, and then sourced from your shell config file (usually `.bashrc` or `.zshrc`). System-wide aliases would be sourced from `/etc/profile`. Don't forget that for your changes to take effect, you'll need to restart your shell, or re-source the file containing your aliases, e.g. `source ~/.zshrc`.
|
||||
|
||||
You can view a list of defined aliases by running `alias`, or search for a specific alias with `alias | grep 'search-term'`. The `unalias` command is used for removing aliases.
|
||||
|
||||
The following section lists the aliases used in my dotfiles.
|
||||
</details>
|
||||
|
||||
#### My Aliases
|
||||
|
||||
All aliases in my dotfiles are categorised into files located in [`zsh/aliases/`](https://github.com/Lissy93/dotfiles/blob/master/zsh/aliases/) which are imported in [`zsh/.zshrc`](https://github.com/Lissy93/dotfiles/blob/master/zsh/.zshrc#L9-L14).
|
||||
|
||||
The following section lists all (or most) the aliases by category:
|
||||
|
||||
<details>
|
||||
|
||||
@ -395,7 +449,7 @@ Alias | Description
|
||||
`mkcp` | Copies a directory, and navigates into it
|
||||
`mkmv` | Moves a directory, and navigates into it
|
||||
|
||||
# Getting outa directories
|
||||
##### Getting outa directories
|
||||
|
||||
Alias | Description
|
||||
---|---
|
||||
@ -491,23 +545,378 @@ Alias | Description
|
||||
|
||||
### Utilities
|
||||
|
||||
// TODO
|
||||
|
||||
The dotfiles also contains several handy bash scripts to carry out useful tasks with slightly more ease.
|
||||
|
||||
Each of these scripts is standalone, without any dependencies, and can be executed directly to use.
|
||||
Alternatively, they can be sourced from within a .zshrc / .bashrc, for use anywhere via their alias.
|
||||
|
||||
For usage instructions about any of them, just append the `--help` flag.
|
||||
|
||||
- [Transfer]() - Quickly transfer files or folders to the internet
|
||||
- [Web Search]() - Open a specific search engine with a given query
|
||||
- [QR Code]() - Generates a QR code for a given string, to transfer data to mobile device
|
||||
- [Weather]() - Shows current and forecasted weather for your location
|
||||
- [Color Map]() - Just outputs your terminal emulators supported color pallete
|
||||
- [Welcome]() - Used for first login, prints personalised greeting, system info, and other handy info
|
||||
- [Online]() - Checks if you are connected to the internet
|
||||
|
||||
|
||||
|
||||
#### Transfer
|
||||
|
||||
Quickly transfer a file, group of files or directory via the transfer.sh service.<br>
|
||||
To get started, run `transfer <file(s) / folder>`, for more info, run `transfer --help`
|
||||
|
||||
If multiple files are passed in, they will automatically be compressed into an archive.
|
||||
You can change the file transfer service, or use a self-hosted instance by setting the URL in `FILE_TRANSFER_SERVICE`
|
||||
The file can be either run directly, or sourced in your `.zshrc` and used via the `transfer` alias.
|
||||
|
||||
> For info, run `transfer --help`<br>
|
||||
> Source: [`utils/transfer.sh`](https://github.com/Lissy93/dotfiles/blob/master/utils/transfer.sh)
|
||||
|
||||
#### Web Search
|
||||
|
||||
Quickly open web search results for a given query using a selected search engine. To get started, run `web-search`, or `web-search --help` for more info.
|
||||
|
||||
Usage:
|
||||
|
||||
All parameters are optional, to get started just run `web-search` or `web-search <search provider (optional)> <query (optional)>`, the `ws` alias can also be used. If a search engine isn't specified, you'll be prompted to select one from the list. Similarly, if a query hasn't been included you'll be asked for that too.
|
||||
|
||||
- `web-search` - Opens interactive menu, you'll be prompted to select a search engine from the list then enter your query
|
||||
- `web-search <search term>` - Specify a search term, and you'll be prompted to select the search engine
|
||||
- For example, `web-search Hello World!`
|
||||
- `web-search <search engine>` - Specify a search engine, and you'll be prompted for your search term
|
||||
- For example, `web-search duckduckgo`
|
||||
- `web-search <search engine> <search engine>` - Specify both a search engine and query, and results will open immediately
|
||||
- For example, `web-search wikipedia Matrix Defense`
|
||||
|
||||
<details>
|
||||
|
||||
<summary><b>Supported Search Providers</b></summary>
|
||||
|
||||
The following search engines are supported by default:
|
||||
- DuckDuckGo: `ws duckduckgo` (or `wsddg`)
|
||||
- Wikipedia: `ws wikipedia` or (`wswiki`)
|
||||
- GitHub: `ws github` (or `wsgh`)
|
||||
- StackOverflow: `ws stackoverflow` (or `wsso`)
|
||||
- Wolframalpha: `ws wolframalpha` (or `wswa`)
|
||||
- Reddit: `ws reddit` (or `wsrdt`)
|
||||
- Maps: `ws maps` (or `wsmap`)
|
||||
- Google: `ws google` (or `wsggl`)
|
||||
- Grep App: `ws grepapp` (or `wsgra`)
|
||||
|
||||
</details>
|
||||
|
||||
The alias `ws` will also resolve to `web-search`, if it's not already in use. You can either run the script directly, e.g.`~/.config/utils/web-search.sh` (don't forget to `chmod +x` the file first, to make it executable), or use the `web-search` / `ws` alias anywhere, once it has been source'd from your .zshrc.
|
||||
|
||||
> For info, run `web-search --help`<br>
|
||||
> Source: [`utils/web-search.sh`](https://github.com/Lissy93/dotfiles/blob/master/utils/web-search.sh)
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Try now!</summary>
|
||||
|
||||
```bash
|
||||
bash <(curl -s https://raw.githubusercontent.com/Lissy93/dotfiles/master/utils/web-search.sh)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Packages
|
||||
|
||||
The dotfile installation script can also, detect which system and environemnt you're running, and optionally prompt to install packages and applications.
|
||||
|
||||
The dotfiles can also optionally install any packages that you may need. This is useful for quickly setting up new systems, but it's important that you remove / comment out any packages that you don't need.
|
||||
Package lists are stored in [`installs/`](https://github.com/Lissy93/dotfiles/tree/master/installs) directory, with separate files for different OSs. The install script will [pick the appropriate file](https://github.com/Lissy93/dotfiles/blob/22c6a04fdb22c140448b7d15ef8187c3a424ab47/install.sh#L243-L260) based on your distro.
|
||||
|
||||
The list of software is stored in the [`installs/`]() directory, and the file that's used will vary depending on the host operating system.
|
||||
You will be prompted before anything is installed. Be sure to remove / comment out anything you do not need before proceeding.
|
||||
|
||||
- Arch (and Arch-based systems, like Manjaro) - []() uses pacman
|
||||
- Debian (and Debian-based systems, like Ubuntu) - []() uses apt
|
||||
- Alpine - []() uses [apk](https://docs.alpinelinux.org/user-handbook/0.1a/Working/apk.html)
|
||||
- Mac OS - [`.Brewfile`]() uses [Homebrew](https://brew.sh/)
|
||||
- Windows - [`windows.sh`]() uses [winget](https://docs.microsoft.com/en-us/windows/package-manager/winget/) and [scoop](https://scoop.sh/)
|
||||
- Linux (desktop): [`flatpak.sh`](https://github.com/Lissy93/dotfiles/blob/master/installs/flatpak.sh) - Desktop apps can be installed on Linux systems via [Flatpack](https://flatpak.org/)
|
||||
- Mac OS: [`.Brewfile`](https://github.com/Lissy93/dotfiles/blob/master/installs/Brewfile) - Mac apps installed via [Homebrew](https://brew.sh/)
|
||||
- Arch (and Arch-based systems, like Manjaro): [`pacman.sh`](https://github.com/Lissy93/dotfiles/blob/master/installs/pacman.sh) - Arch CLI apps installed via [pacman](https://wiki.archlinux.org/title/Pacman)
|
||||
- Debian (and Debian-based systems, like Ubuntu): [`apt.sh`](https://github.com/Lissy93/dotfiles/blob/master/installs/apt.sh) - Debian CLI apps installed via [apt](https://wiki.debian.org/Apt)
|
||||
- Alpine: [`apk.sh`](https://github.com/Lissy93/dotfiles/blob/master/installs/apk.sh) - Alpine CLI apps installed via [apk](https://docs.alpinelinux.org/user-handbook/0.1a/Working/apk.html)
|
||||
|
||||
The following section lists different apps that may be installed for each category:
|
||||
|
||||
#### Command Line
|
||||
|
||||
<details>
|
||||
<summary>CLI Essentials</summary>
|
||||
|
||||
- `git` - Version controll
|
||||
- `neovim` - Text editor
|
||||
- `ranger` - Directory browser
|
||||
- `tmux` - Term multiplexer
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CLI Basics</summary>
|
||||
|
||||
- `aria2` - Resuming download util _(better wget)_
|
||||
- `bat` - Output highlighting _(better cat)_
|
||||
- `ctags` - Indexing of file info + headers
|
||||
- `diff-so-fancy` -# Readable file compares _(better diff)_
|
||||
- `exa` - Listing files with info _(better ls)_
|
||||
- `fzf` - Fuzzy file finder and filtering
|
||||
- `hyperfine` - Benchmarking for arbitrary commands
|
||||
- `jq` - JSON parser
|
||||
- `lfs` - Get info on mounted disks _(better df)_
|
||||
- `procs` - Advanced process viewer _(better ps)_
|
||||
- `ripgrep` - Searching within files _(better grep)_
|
||||
- `scc` - Count lines of code _(better cloc)_
|
||||
- `sd` - RegEx find and replace _(better sed)_
|
||||
- `thefuck` - Auto-correct miss-typed commands
|
||||
- `tldr` - Community-maintained docs _(better man)_
|
||||
- `tree` - Directory listings as tree
|
||||
- `trash-cli` - Record + restore removed files
|
||||
- `xsel` - Copy paste access to X clipboard
|
||||
- `zoxide` - Easy navigation _(better cd)_
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CLI Monitoring and Performance Apps</summary>
|
||||
|
||||
- `bandwhich` - Bandwidth utilization monitor
|
||||
- `ctop` - Container metrics and monitoring
|
||||
- `bpytop` - Resource monitoring _(like htop)_
|
||||
- `glances` - Resource monitor + web and API
|
||||
- `gping` - Interactive ping tool, with graph
|
||||
- `ncdu` - Disk usage analyzer and monitor _(better du)_
|
||||
- `speedtest-cli` -# Command line speed test utility
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CLI Productivity Apps</summary>
|
||||
|
||||
- `browsh` - CLI web browser
|
||||
- `buku` - Bookmark manager
|
||||
- `cmus` - Music browser / player
|
||||
- `khal` - Calendar client
|
||||
- `mutt` - Email client
|
||||
- `newsboat` - RSS / ATOM news reader
|
||||
- `rclone` - Manage cloud storage
|
||||
- `task` - Todo + task management
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CLI Dev Suits</summary>
|
||||
|
||||
- `httpie` - HTTP / API testing testing client
|
||||
- `lazydocker` - Full Docker management app
|
||||
- `lazygit` - Full Git managemtne app
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CLI External Sercvices</summary>
|
||||
|
||||
- `ngrok` - Reverse proxy for sharing localhost
|
||||
- `tmate` - Share a terminal session via internet
|
||||
- `pbgopy` - Cross-device copy and paste service
|
||||
- `asciinema` - Recording + sharing terminal sessions
|
||||
- `googler` - Fetch search results from Google
|
||||
- `gotty` - Expose terminal sessaion via browser
|
||||
- `navi` - Browse, search, read cheat sheets
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>CLI Fun</summary>
|
||||
|
||||
- `cowsay` - Have an ASCII cow say your message
|
||||
- `figlet` - Output text as big ASCII art text
|
||||
- `lolcat` - Make console output raibow colored
|
||||
- `neofetch` - Show system data and ditstro info
|
||||
- `pipes-sh` - Cool terminal pipe screen saver
|
||||
- `pv` - Pipe viewer, with animation options
|
||||
|
||||
</details>
|
||||
|
||||
#### Software Development
|
||||
|
||||
<details>
|
||||
<summary>Development Apps</summary>
|
||||
|
||||
- `android-studio` - IDE for Android development
|
||||
- `boop` - Test transformation tool
|
||||
- `gradle` - Build automation for Java
|
||||
- `iterm2` - Better terminal emulator
|
||||
- `postman` - HTTP API testing app
|
||||
- `sourcetree` - Git visual client
|
||||
- `utm` - VM management console
|
||||
- `visual-studio-code` - Code editor
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Development Langs, Compilers, Package Managers and SDKs</summary>
|
||||
|
||||
- `docker` - Containers
|
||||
- `gcc` - GNU C++ compilers
|
||||
- `go` - Compiler for Go Lang
|
||||
- `lua` - Lua interpreter
|
||||
- `luarocks` - Package manager for Lua
|
||||
- `node` - Node.js
|
||||
- `nvm` - Switching node versions
|
||||
- `openjdk` - Java development kit
|
||||
- `python` - Python interpriter
|
||||
- `rust` - Rust language
|
||||
- `android-sdk` - Android software dev kit
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Development Utils</summary>
|
||||
|
||||
- `gh` - Interact with GitHub PRs, issues, repos
|
||||
- `scrcpy` - Display and control Andrdroid devices
|
||||
- `terminal-notifier` - Trigger Mac notifications from terminal
|
||||
- `tig` - Text-mode interface for git
|
||||
- `ttygif` - Generate GIF from terminal commands + output
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Network and Security Testing</summary>
|
||||
|
||||
- `bettercap` - Network, scanning and moniroting
|
||||
- `nmap` - Port scanning
|
||||
- `wrk` - HTTP benchmarking
|
||||
- `burp-suite` - Web security testing
|
||||
- `metasploit` - Pen testing framework
|
||||
- `owasp-zap` - Web app security scanner
|
||||
- `wireshark` - Network analyzer + packet capture
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Security Utilities</summary>
|
||||
|
||||
- `bcrypt` - Encryption utility, using blowfish
|
||||
- `clamav` - Open source virus scanning suite
|
||||
- `gpg-suite` - PGP encryption for emails and files
|
||||
- `git-crypt` - Transparent encryption for git repos
|
||||
- `lynis` - Scan system for common security issues
|
||||
- `openssl` - Cryptography and SSL/TLS Toolkit
|
||||
- `rkhunter` - Search / detect potential root kits
|
||||
- `veracrypt` - File and volume encryption
|
||||
|
||||
</details>
|
||||
|
||||
#### Desktop Applications
|
||||
|
||||
<details>
|
||||
<summary>Creativity</summary>
|
||||
|
||||
- audacity - Audio editor / recorder
|
||||
- gimp - Photo editor
|
||||
- handbrake - Video transcoder
|
||||
- inkscape - Vector editor
|
||||
- obs - Screencasting / recording
|
||||
- shotcut - Video editor
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Media</summary>
|
||||
|
||||
- calibre - E-Book reader
|
||||
- spotify - Propietary music streaming
|
||||
- transmission - Torrent client
|
||||
- vlc - Media player
|
||||
- pandoc - Universal file converter
|
||||
- youtube-dl - YouTube video downloader
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Personal Applications</summary>
|
||||
|
||||
- 1password - Password manager _(proprietary)_
|
||||
- tresorit - Encrypted file backup _(proprietary)_
|
||||
- standard-notes - Encrypted synced notes
|
||||
- signal - Link to encrypted mobile messenger
|
||||
- ledger-live - Crypto hardware wallet manager
|
||||
- mountain-duck - Mount remote storage locations
|
||||
- protonmail-bridge - Decrypt ProtonMail emails
|
||||
- protonvpn - Client app for ProtonVPN
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Browsers</summary>
|
||||
|
||||
- firefox
|
||||
- chromium
|
||||
- tor
|
||||
|
||||
</details>
|
||||
|
||||
#### MacOS Apps
|
||||
|
||||
<details>
|
||||
<summary>MacOS Mods and Imrovments</summary>
|
||||
|
||||
- `alt-tab` - Much better alt-tab window switcher
|
||||
- `anybar` - Custom programatic menubar icons
|
||||
- `copyq` - Clipboard manager _(cross platform)_
|
||||
- `espanso` - Live text expander _(cross-platform)_
|
||||
- `finicky` - Website-specific default browser
|
||||
- `hiddenbar` - Hide / show annoying menubar icons
|
||||
- `iproute2mac` - MacOS port of netstat and ifconfig
|
||||
- `lporg` - Backup and restore launchpad layout
|
||||
- `m-cli` - All in one MacOS management CLI app
|
||||
- `mjolnir` - Util for loading Lua automations
|
||||
- `openinterminal` - Finder button, opens directory in terminal
|
||||
- `popclip` - Popup options for text on highlight
|
||||
- `raycast` - Spotlight alternative
|
||||
- `shottr` - Better screenshot utility
|
||||
- `skhd` - Hotkey daemon for macOS
|
||||
- `stats` - System resource usage in menubar
|
||||
- `yabai` - Tiling window manager
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>MacOS Utility Apps</summary>
|
||||
|
||||
- coteditor - Just a simple plain-text editor
|
||||
- little-snitch - Firewall app viewing / blocking traffic
|
||||
- keka - File archiver and extractor
|
||||
- onyx - Repair util for verifying system files
|
||||
- daisydisk - Disk space analyzer and cleaner
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
### System Preferences
|
||||
|
||||
The installation script can also prompt you to confiture system settings and user preferences. This is useful for setting up a completely fresh system in just a few seconds.
|
||||
|
||||
#### MacOS
|
||||
|
||||
MacOS includes a utility named [`defaults`](https://real-world-systems.com/docs/defaults.1.html), which lets you configure all system and app preferences programatically through the command line. This is very powerful, as you can write a script that configures every aspect of your system enabling you to setup a brand new machine in seconds.
|
||||
|
||||
All settings are then updated in the `.plist` files stored in `~/Library/Preferences`. This can also be used to configure preferences for any installed app on your system, where the application is specified by its domain identifier - you can view a full list of your configurable apps by running `defaults domains`.
|
||||
|
||||
|
||||
In my dotfiles, the MacOS preferences will configure everything from system security to launchpad layout. The Mac settings are located in [`system-specific/macos/system-settings/`](https://github.com/Lissy93/dotfiles/tree/master/system-specific/macos/system-settings), and are split into three files:
|
||||
- [`macos-security.sh`](https://github.com/Lissy93/dotfiles/blob/master/system-specific/macos/system-settings/macos-security.sh) - Sets essential security settings, disables telementry, disconnects unused ports, enforces signing, sets logout timeouts, and much more
|
||||
- [`macos-preferences.sh`](https://github.com/Lissy93/dotfiles/blob/master/system-specific/macos/system-settings/macos-preferences.sh) - Configures all user preferences, including computer name, highlight color, finder options, spotlight settings, hardware preferences and more
|
||||
- [`macos-apps.sh`](https://github.com/Lissy93/dotfiles/blob/master/system-specific/macos/system-settings/macos-apps.sh) - Applies preferences to any installed desktop apps, such as Terminal, Time Machine, Photos, Spotify, and many others
|
||||
|
||||
Upon running each script, a summary of what will be changed will be shown, and you'll be prompted as to weather you'd like to continue. Each script also handles permissions, compatibility checking, and graceful fallbacks. Backup of original settings will be made, and a summary of all changes made will be logged as output when the script is complete.
|
||||
|
||||
If you choose to run any of these scripts, take care to read it through first, to ensure you understand what changes will be made, and optionally update or remove anything as you see fit.
|
||||
|
||||
---
|
||||
|
||||
@ -521,12 +930,17 @@ The list of software is stored in the [`installs/`]() directory, and the file th
|
||||
|
||||
The entry point for the Vim config is the [`vimrc`](https://github.com/Lissy93/dotfiles/blob/master/vim/vimrc), but the main editor settings are defined in [`vim/editor.vim`](https://github.com/Lissy93/dotfiles/blob/master/vim/editor.vim)
|
||||
|
||||
##### Plugins
|
||||
#### Vim Plugins
|
||||
|
||||
Vim plugins are managed using [Plug](https://github.com/junegunn/vim-plug) defined in [`vim/plugins.vim`](https://github.com/Lissy93/dotfiles/blob/master/vim/plugins.vim).
|
||||
To install them from GitHub, run `:PlugInstall` (see [options](https://github.com/junegunn/vim-plug#commands)) from within Vim.
|
||||
Vim plugins are managed using [Plug](https://github.com/junegunn/vim-plug) defined in [`vim/plugins.vim`](https://github.com/Lissy93/dotfiles/blob/master/vim/setup-vim-plug.vim).
|
||||
To install them from GitHub, run `:PlugInstall` (see [options](https://github.com/junegunn/vim-plug#commands)) from within Vim. They will also be installed or updated when you run the main dotfiles setup script ([`install.sh`](https://github.com/Lissy93/dotfiles/blob/d4b8426629e7fbbd6d17d0b87f0bb863d6618bfd/install.sh#L132-L134)).
|
||||
|
||||
The following plugins are being used:
|
||||
|
||||
<details>
|
||||
|
||||
<summary><b>Layout & Navigation</b></summary>
|
||||
|
||||
Layout & Navigation:
|
||||
- **[Airline](https://github.com/vim-airline/vim-airline)**: `vim-airline/vim-airline` - A very nice status line at the bottom of each window, displaying useful info
|
||||
- **[Nerd-tree](https://github.com/preservim/nerdtree)**: `preservim/nerdtree` - Alter files in larger projects more easily, with a nice tree-view pain
|
||||
- **[Matchup](https://github.com/andymass/vim-matchup)**: `andymass/vim-matchup` - Better % naviagtion, to highlight and jump between open and closing blocks
|
||||
@ -537,7 +951,13 @@ Layout & Navigation:
|
||||
- **[Smoothie](https://github.com/psliwka/vim-smoothie)**: `psliwka/vim-smoothie` - Smooth scrolling, supporting `^D`, `^U`, `^F` and `^B`
|
||||
- **[DevIcons](https://github.com/ryanoasis/vim-devicons)**: `ryanoasis/vim-devicons` - Adds file-type icons to Nerd-tree and other plugins
|
||||
|
||||
Operations:
|
||||
</details>
|
||||
|
||||
|
||||
<details>
|
||||
|
||||
<summary><b>Operations</b></summary>
|
||||
|
||||
- **[Nerd-Commenter](https://github.com/preservim/nerdcommenter)**: `preservim/nerdcommenter` - For auto-commenting code blocks
|
||||
- **[Ale](https://github.com/dense-analysis/ale)**: `dense-analysis/ale` - Checks syntax asynchronously, with lint support
|
||||
- **[Surround](https://github.com/tpope/vim-surround)**: `tpope/vim-surround` - Easily surround selected text with brackets, quotes, tags etc
|
||||
@ -547,13 +967,25 @@ Operations:
|
||||
- **[Vim-Test](https://github.com/janko/vim-test)**: `janko/vim-test` - A wrapper for running tests on different granularities
|
||||
- **[Syntastic](https://github.com/vim-syntastic/syntastic)**: `vim-syntastic/syntastic` - Syntax checking that warns in the gutter when there's an issue
|
||||
|
||||
Git:
|
||||
</details>
|
||||
|
||||
|
||||
<details>
|
||||
|
||||
<summary><b>Git</b></summary>
|
||||
|
||||
- **[Git-Gutter](https://github.com/airblade/vim-gitgutter)**: `airblade/vim-gitgutter` - Shows git diff markers in the gutter column
|
||||
- **[Vim-fugitive](https://github.com/tpope/vim-fugitive)**: `tpope/vim-fugitive` - A git wrapper for git that lets you call a git command using `:Git`
|
||||
- **[Committia](https://github.com/rhysd/committia.vim)**: `rhysd/committia.vim` - Shows a diff, status and edit window for git commits
|
||||
- **[Vim-Git](https://github.com/tpope/vim-git)**: `tpope/vim-git` - Runtime files for git in vim, for git, gitcommit, gitconfig, gitrebase, and gitsendemail
|
||||
|
||||
File-Type Plugins:
|
||||
</details>
|
||||
|
||||
|
||||
<details>
|
||||
|
||||
<summary><b>File-Type Plugins</b></summary>
|
||||
|
||||
- **[Vim-JavaScript](https://github.com/pangloss/vim-javascript)**: `pangloss/vim-javascript` *(JavaScript)* - Syntax highlighting and improved indentation for JS files
|
||||
- **[Yats](https://github.com/HerringtonDarkholme/yats.vim)**: `HerringtonDarkholme/yats.vim` *(TypeScript)* - Syntax highlighting and snippets for TypeScript files
|
||||
- **[Vim-jsx-pretty](https://github.com/MaxMEllon/vim-jsx-pretty)**: `MaxMEllon/vim-jsx-pretty` *(React)* - Highlighting and indentation for React .tsx and .jsx files
|
||||
@ -571,9 +1003,16 @@ File-Type Plugins:
|
||||
- **[Zinit](https://github.com/zinit-zsh/zinit-vim-syntax)**: `zinit-zsh/zinit-vim-syntax` *(ZSH)* - syntax definition for Zinit commands in any file of type zsh
|
||||
- **[Nginx](https://github.com/chr4/nginx.vim)**:`chr4/nginx.vim` *(Nginx)* - Integer matching, hichlight syntax and IPv4/ IPv6, mark insecure protocols and more
|
||||
|
||||
Themes:
|
||||
</details>
|
||||
|
||||
|
||||
<details>
|
||||
|
||||
<summary><b>Themes</b></summary>
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
### Tmux
|
||||
|
@ -1,32 +0,0 @@
|
||||
- defaults:
|
||||
link:
|
||||
create: true
|
||||
relink: true
|
||||
|
||||
- clean: ['~', '~/.config']
|
||||
|
||||
- link:
|
||||
~/.zshenv:
|
||||
path: zsh/.zshenv
|
||||
force: true
|
||||
~/.config/zsh: zsh
|
||||
~/.config/vim: vim
|
||||
~/.config/nvim: vim
|
||||
~/.config/bash: bash
|
||||
~/.tmux.conf: tmux/.tmux.conf
|
||||
~/.local/share/tmux: tpm
|
||||
~/.config/utils: utils
|
||||
~/.gitconfig: configs/.gitconfig
|
||||
~/.config/.gitignore_global: configs/.gitignore_global
|
||||
~/.config/curl/.curlrc: configs/.curlrc
|
||||
~/.Brewfile:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: installs/.Brewfile
|
||||
~/.macos:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: configs/.macos
|
||||
~/.finicky.js:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: configs/.finicky.js
|
||||
- shell:
|
||||
- git submodule sync --recursive
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"makefile.extensionOutputFolder": "./.vscode"
|
||||
}
|
65
Dockerfile
Normal file
65
Dockerfile
Normal file
@ -0,0 +1,65 @@
|
||||
FROM alpine:latest
|
||||
|
||||
LABEL maintainer "Alicia Sykes <https://aliciasykes.com>"
|
||||
LABEL org.opencontainers.image.source https://github.com/lissy93/dotfiles
|
||||
|
||||
ARG user=alicia
|
||||
ARG group=wheel
|
||||
ARG uid=1000
|
||||
ARG dotfiles=dotfiles.git
|
||||
ARG userspace=userspace.git
|
||||
ARG vcsprovider=github.com
|
||||
ARG vcsowner=lissy93
|
||||
|
||||
USER root
|
||||
|
||||
RUN \
|
||||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
|
||||
apk upgrade --no-cache && \
|
||||
apk add --update --no-cache \
|
||||
sudo \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
nasm \
|
||||
ncurses \
|
||||
ca-certificates \
|
||||
libressl \
|
||||
bash-completion \
|
||||
cmake \
|
||||
ctags \
|
||||
file \
|
||||
curl \
|
||||
build-base \
|
||||
gcc \
|
||||
coreutils \
|
||||
wget \
|
||||
neovim \
|
||||
git git-doc \
|
||||
zsh \
|
||||
vim \
|
||||
tmux \
|
||||
docker \
|
||||
docker-compose
|
||||
|
||||
RUN \
|
||||
echo "%${group} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
||||
adduser -D -G ${group} ${user} && \
|
||||
addgroup ${user} docker
|
||||
|
||||
COPY ./ /home/${user}/.userspace/
|
||||
|
||||
RUN \
|
||||
git clone --recursive https://${vcsprovider}/${vcsowner}/${dotfiles} /home/${user}/.dotfiles && \
|
||||
chown -R ${user}:${group} /home/${user}/.dotfiles && \
|
||||
chown -R ${user}:${group} /home/${user}/.userspace
|
||||
|
||||
RUN chmod u+x /home/${user}/.dotfiles/install.sh
|
||||
|
||||
USER ${user}
|
||||
|
||||
RUN cd $HOME/.dotfiles && ./install.sh
|
||||
|
||||
ENV HISTFILE=/home/${user}/.cache/.zsh_history
|
||||
|
||||
CMD []
|
6
Vagrantfile
vendored
Normal file
6
Vagrantfile
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "generic/arch"
|
||||
end
|
@ -12,7 +12,7 @@
|
||||
editor = nvim
|
||||
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
|
||||
pager = delta
|
||||
excludesfile = ~/.config/.gitignore_global
|
||||
excludesfile = /Users/alicia/.config/.gitignore_global
|
||||
[web]
|
||||
browser = firefox
|
||||
[instaweb]
|
||||
|
436
configs/.macos
436
configs/.macos
@ -1,436 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ~/.macos
|
||||
|
||||
# This file configures Mac OS settings, overriding anything set in preferences
|
||||
# Be sure to read through and understand this file before applying any changes
|
||||
|
||||
# Before starting, close system preferences, prompt for pass and set keep alive
|
||||
osascript -e 'tell application "System Preferences" to quit'
|
||||
sudo -v
|
||||
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
|
||||
|
||||
# Device Options
|
||||
COMPUTER_NAME="AS-MacBook"
|
||||
HIGHLIGHT_COLOR="0 0.8 0.7"
|
||||
|
||||
# Set computer name and hostname
|
||||
sudo scutil --set ComputerName "$COMPUTER_NAME"
|
||||
sudo scutil --set HostName "$COMPUTER_NAME"
|
||||
sudo scutil --set LocalHostName "$COMPUTER_NAME"
|
||||
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$COMPUTER_NAME"
|
||||
|
||||
# Set highlight color
|
||||
defaults write NSGlobalDomain AppleHighlightColor -string "${HIGHLIGHT_COLOR}"
|
||||
|
||||
# Configure sidebars, scrollbars and window resizers
|
||||
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
|
||||
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
|
||||
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0
|
||||
defaults write NSGlobalDomain NSWindowResizeTime -float 0.05
|
||||
|
||||
# Show expanded save and print dialoges
|
||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
|
||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
|
||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
|
||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
|
||||
|
||||
# Save to disk (not to iCloud) by default
|
||||
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
|
||||
|
||||
# Automatically quit printer app once the print jobs complete
|
||||
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
|
||||
|
||||
# Disable the “Are you sure you want to open this application?” dialog
|
||||
defaults write com.apple.LaunchServices LSQuarantine -bool false
|
||||
|
||||
# Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
|
||||
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
|
||||
|
||||
# Display ASCII control characters using caret notation in standard text views
|
||||
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
|
||||
|
||||
# Disable Resume system-wide
|
||||
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
|
||||
|
||||
# Disable automatic termination of inactive apps
|
||||
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
|
||||
|
||||
# Disable the crash reporter
|
||||
defaults write com.apple.CrashReporter DialogType -string "none"
|
||||
|
||||
# Fix for the ancient UTF-8 bug in QuickLook (https://mths.be/bbo)
|
||||
echo "0x08000100:0" > ~/.CFUserTextEncoding
|
||||
|
||||
# Reveal IP address, hostname, OS version, etc. when clicking the clock in the login window
|
||||
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
|
||||
|
||||
# Disable automatic text capitalisation, smart dashed, period substitiotion, auto-correct
|
||||
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
|
||||
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
|
||||
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
|
||||
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
|
||||
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
||||
|
||||
# Set a custom wallpaper image. `DefaultDesktop.jpg` is already a symlink, and
|
||||
# all wallpapers are in `/Library/Desktop Pictures/`. The default is `Wave.jpg`.
|
||||
#rm -rf ~/Library/Application Support/Dock/desktoppicture.db
|
||||
#sudo rm -rf /System/Library/CoreServices/DefaultDesktop.jpg
|
||||
#sudo ln -s /path/to/your/image /System/Library/CoreServices/DefaultDesktop.jpg
|
||||
|
||||
###############################################################################
|
||||
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
|
||||
###############################################################################
|
||||
|
||||
# Trackpad: enable tap to click for this user and for the login screen
|
||||
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
|
||||
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
|
||||
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
|
||||
|
||||
# Increase sound quality for Bluetooth headphones/headsets
|
||||
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
|
||||
|
||||
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
|
||||
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
||||
|
||||
# Use scroll gesture with the Ctrl (^) modifier key to zoom
|
||||
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
|
||||
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
|
||||
# Follow the keyboard focus while zoomed in
|
||||
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
|
||||
|
||||
# Set a blazingly fast keyboard repeat rate
|
||||
defaults write NSGlobalDomain KeyRepeat -int 8
|
||||
defaults write NSGlobalDomain InitialKeyRepeat -int 50
|
||||
|
||||
# Set language and text formats
|
||||
defaults write NSGlobalDomain AppleLanguages -array "en"
|
||||
defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=GBP"
|
||||
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
|
||||
defaults write NSGlobalDomain AppleMetricUnits -bool true
|
||||
sudo systemsetup -settimezone "Europe/London" > /dev/null
|
||||
|
||||
# Power and standby options
|
||||
sudo pmset -a lidwake 1
|
||||
sudo pmset -a autorestart 1
|
||||
sudo pmset -a displaysleep 15
|
||||
sudo pmset -b sleep 5
|
||||
sudo pmset -c sleep 0
|
||||
|
||||
# Screen options
|
||||
|
||||
# Require password immediately after sleep or screen saver begins
|
||||
defaults write com.apple.screensaver askForPassword -int 1
|
||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
||||
|
||||
# Save screenshots to the downloads directory, in .png
|
||||
defaults write com.apple.screencapture location -string "${HOME}/Downloads/screenshots"
|
||||
defaults write com.apple.screencapture type -string "png"
|
||||
|
||||
# Enable subpixel font rendering on non-Apple LCDs
|
||||
defaults write NSGlobalDomain AppleFontSmoothing -int 1
|
||||
|
||||
# Enable HiDPI display modes (requires restart)
|
||||
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
|
||||
|
||||
# Finder settings - Start location, hidden files
|
||||
defaults write com.apple.finder NewWindowTarget -string "PfHm"
|
||||
defaults write com.apple.finder NewWindowTargetPath -string "file:///"
|
||||
defaults write com.apple.finder AppleShowAllFiles -bool true
|
||||
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
|
||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
|
||||
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
|
||||
sudo chflags nohidden /Volumes
|
||||
|
||||
# Finder - View pain options
|
||||
defaults write com.apple.finder QuitMenuItem -bool true
|
||||
defaults write com.apple.finder ShowStatusBar -bool true
|
||||
defaults write com.apple.finder ShowPathbar -bool true
|
||||
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
|
||||
defaults write com.apple.finder FXInfoPanesExpanded -dict \
|
||||
General -bool true \
|
||||
OpenWith -bool true \
|
||||
Privileges -bool true
|
||||
|
||||
# Finder - Searching options
|
||||
defaults write com.apple.finder _FXSortFoldersFirst -bool true
|
||||
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
|
||||
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
|
||||
|
||||
# Finder - Disable disk image verification
|
||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||
|
||||
# Finder - Automatically open a new Finder window when a volume is mounted
|
||||
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
|
||||
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
|
||||
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
|
||||
|
||||
# Finder - Show info, snap-to-grid, item sizes and grid spacing
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
# Dock Settings
|
||||
defaults write com.apple.dock mouse-over-hilite-stack -bool true
|
||||
defaults write com.apple.dock tilesize -int 48
|
||||
defaults write com.apple.dock mineffect -string "genie"
|
||||
defaults write com.apple.dock minimize-to-application -bool true
|
||||
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
|
||||
defaults write com.apple.dock show-process-indicators -bool true
|
||||
defaults write com.apple.dock launchanim -bool true
|
||||
defaults write com.apple.dock expose-animation-duration -float 0.5
|
||||
defaults write com.apple.dock expose-group-by-app -bool false
|
||||
defaults write com.apple.dock mru-spaces -bool false
|
||||
defaults write com.apple.dock autohide -bool true
|
||||
defaults write com.apple.dock autohide-delay -float 0.05
|
||||
defaults write com.apple.dock autohide-time-modifier -float 0.05
|
||||
defaults write com.apple.dock showhidden -bool true
|
||||
defaults write com.apple.dock show-recents -bool false
|
||||
|
||||
# If DockUtil installed, then use it to remove default dock items, and add useful ones
|
||||
if hash dockutil 2> /dev/null; then
|
||||
apps_to_remove_from_dock=(
|
||||
'App Store' 'Calendar' 'Contacts' 'FaceTime'
|
||||
'Keynote' 'Mail' 'Maps' 'Messages' 'Music'
|
||||
'News' 'Notes' 'Numbers'
|
||||
'Pages' 'Photos' 'Podcasts'
|
||||
'Reminders' 'TV'
|
||||
)
|
||||
apps_to_add_to_dock=(
|
||||
'iTerm' 'Firefox' 'Standard Notes' 'Visual Studio Code'
|
||||
)
|
||||
IFS=""
|
||||
# Removes useless apps from dock
|
||||
for app in ${apps_to_remove_from_dock[@]}; do
|
||||
dockutil --remove ~/Applications/${app}.app
|
||||
done
|
||||
# Adds useful apps to dock, if installed
|
||||
for app in ${apps_to_add_to_dock[@]}; do
|
||||
if [[ -d "~/Applications/${app}.app" ]]; then
|
||||
dockutil --add ~/Applications/${app}.app
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Add iOS & Watch Simulator to Launchpad
|
||||
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app" "/Applications/Simulator.app"
|
||||
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator (Watch).app" "/Applications/Simulator (Watch).app"
|
||||
|
||||
# Set hot corners
|
||||
defaults write com.apple.dock wvous-tl-corner -int 11
|
||||
defaults write com.apple.dock wvous-tl-modifier -int 0
|
||||
defaults write com.apple.dock wvous-bl-corner -int 2
|
||||
defaults write com.apple.dock wvous-bl-modifier -int 1048576
|
||||
defaults write com.apple.dock wvous-br-corner -int 5
|
||||
defaults write com.apple.dock wvous-br-modifier -int 1048576
|
||||
defaults write com.apple.dock wvous-tr-corner -int 0
|
||||
defaults write com.apple.dock wvous-tr-modifier -int 0
|
||||
|
||||
# Safari & Webkit Privacy Enchanements
|
||||
defaults write com.apple.Safari UniversalSearchEnabled -bool false
|
||||
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
|
||||
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
|
||||
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
|
||||
defaults write com.apple.Safari HomePage -string "about:blank"
|
||||
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
|
||||
defaults write com.apple.Safari ShowFavoritesBar -bool false
|
||||
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
|
||||
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
|
||||
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
||||
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
||||
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
|
||||
defaults write com.apple.Safari IncludeDevelopMenu -bool true
|
||||
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
|
||||
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
||||
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true
|
||||
defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false
|
||||
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
|
||||
defaults write com.apple.Safari AutoFillPasswords -bool false
|
||||
defaults write com.apple.Safari AutoFillCreditCardData -bool false
|
||||
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false
|
||||
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
|
||||
defaults write com.apple.Safari WebKitPluginsEnabled -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false
|
||||
defaults write com.apple.Safari WebKitJavaEnabled -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles -bool false
|
||||
defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false
|
||||
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
|
||||
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
|
||||
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
|
||||
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
|
||||
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
|
||||
|
||||
# Mail App
|
||||
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
|
||||
defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\U21a9"
|
||||
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
|
||||
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
|
||||
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
|
||||
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
|
||||
|
||||
# Spotlight - Emable / disable search locations, and indexing order
|
||||
defaults write com.apple.spotlight orderedItems -array \
|
||||
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
|
||||
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
|
||||
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
|
||||
'{"enabled" = 1;"name" = "PDF";}' \
|
||||
'{"enabled" = 0;"name" = "FONTS";}' \
|
||||
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
|
||||
'{"enabled" = 0;"name" = "MESSAGES";}' \
|
||||
'{"enabled" = 0;"name" = "CONTACT";}' \
|
||||
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
|
||||
'{"enabled" = 0;"name" = "IMAGES";}' \
|
||||
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
|
||||
'{"enabled" = 0;"name" = "MUSIC";}' \
|
||||
'{"enabled" = 0;"name" = "MOVIES";}' \
|
||||
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
|
||||
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
|
||||
'{"enabled" = 0;"name" = "SOURCE";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_DEFINITION";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_OTHER";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
|
||||
|
||||
# Spotlight - load new settings, enable indexing, and rebuild index
|
||||
killall mds > /dev/null 2>&1
|
||||
sudo mdutil -i on / > /dev/null
|
||||
sudo mdutil -E / > /dev/null
|
||||
|
||||
|
||||
# Terminal.app - Use UTF-8 and enable secure keyboard entry
|
||||
defaults write com.apple.terminal StringEncodings -array 4
|
||||
defaults write com.apple.terminal SecureKeyboardEntry -bool true
|
||||
|
||||
# Time Machine - don't open when disk connected
|
||||
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
|
||||
|
||||
# Activity Monitor - launch main window, use live CPU icon, show all processes
|
||||
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
|
||||
defaults write com.apple.ActivityMonitor IconType -int 5
|
||||
defaults write com.apple.ActivityMonitor ShowCategory -int 0
|
||||
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
|
||||
defaults write com.apple.ActivityMonitor SortDirection -int 0
|
||||
|
||||
# Use plain text mode for new TextEdit documents, and open in UTF-8
|
||||
defaults write com.apple.TextEdit RichText -int 0
|
||||
defaults write com.apple.TextEdit PlainTextEncoding -int 4
|
||||
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
|
||||
|
||||
# Enable the debug menu in Disk Utility, iCal, Address Book and Dev mode for dashboard
|
||||
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
|
||||
defaults write com.apple.DiskUtility advanced-image-options -bool true
|
||||
defaults write com.apple.iCal IncludeDebugMenu -bool true
|
||||
defaults write com.apple.addressbook ABShowDebugMenu -bool true
|
||||
defaults write com.apple.dashboard devmode -bool true
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Mac App Store #
|
||||
###############################################################################
|
||||
|
||||
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
|
||||
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
|
||||
defaults write com.apple.appstore ShowDebugMenu -bool true
|
||||
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
|
||||
|
||||
###############################################################################
|
||||
# Photos #
|
||||
###############################################################################
|
||||
|
||||
# Prevent Photos from opening automatically when devices are plugged in
|
||||
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
|
||||
|
||||
###############################################################################
|
||||
# Messages #
|
||||
###############################################################################
|
||||
|
||||
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
|
||||
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
|
||||
|
||||
###############################################################################
|
||||
# Transmission.app #
|
||||
###############################################################################
|
||||
|
||||
# Use `~/Downloads/Torrents` to store incomplete downloads
|
||||
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
|
||||
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
|
||||
|
||||
# Use `~/Downloads` to store completed downloads
|
||||
defaults write org.m0k.transmission DownloadLocationConstant -bool true
|
||||
|
||||
# Don’t prompt for confirmation before downloading
|
||||
defaults write org.m0k.transmission DownloadAsk -bool false
|
||||
defaults write org.m0k.transmission MagnetOpenAsk -bool false
|
||||
|
||||
# Don’t prompt for confirmation before removing non-downloading active transfers
|
||||
defaults write org.m0k.transmission CheckRemoveDownloading -bool true
|
||||
|
||||
# Trash original torrent files
|
||||
defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
|
||||
|
||||
# Hide the donate message
|
||||
defaults write org.m0k.transmission WarningDonate -bool false
|
||||
# Hide the legal disclaimer
|
||||
defaults write org.m0k.transmission WarningLegal -bool false
|
||||
|
||||
# IP block list.
|
||||
# Source: https://giuliomac.wordpress.com/2014/02/19/best-blocklist-for-transmission/
|
||||
defaults write org.m0k.transmission BlocklistNew -bool true
|
||||
defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz"
|
||||
defaults write org.m0k.transmission BlocklistAutoUpdate -bool true
|
||||
|
||||
# Randomize port on launch
|
||||
defaults write org.m0k.transmission RandomPort -bool true
|
||||
|
||||
###############################################################################
|
||||
# Kill affected applications #
|
||||
###############################################################################
|
||||
|
||||
for app in "Activity Monitor" \
|
||||
"Address Book" \
|
||||
"Calendar" \
|
||||
"cfprefsd" \
|
||||
"Contacts" \
|
||||
"Dock" \
|
||||
"Finder" \
|
||||
"Google Chrome Canary" \
|
||||
"Google Chrome" \
|
||||
"Mail" \
|
||||
"Messages" \
|
||||
"Opera" \
|
||||
"Photos" \
|
||||
"Safari" \
|
||||
"SizeUp" \
|
||||
"Spectacle" \
|
||||
"SystemUIServer" \
|
||||
"Terminal" \
|
||||
"Transmission" \
|
||||
"Tweetbot" \
|
||||
"Twitter" \
|
||||
"iCal"; do
|
||||
killall "${app}" &> /dev/null
|
||||
done
|
||||
echo "Done. Note that some of these changes require a logout/restart to take effect."
|
||||
|
246
install.sh
Normal file → Executable file
246
install.sh
Normal file → Executable file
@ -1,23 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
# Dotfile setup script
|
||||
# Fetches latest changes, symlinks files, and installs dependencies
|
||||
# For docs and more info, see: https://github.com/lissy93/dotfiles
|
||||
# Licensed under MIT - (C) Alicia Sykes, 2022 <https://aliciasykes.com>
|
||||
|
||||
# IMPORTANT: Before running, read through everything, and confirm it's what you want!
|
||||
|
||||
set -e
|
||||
######################################################################
|
||||
# 🧰 Lissy93/Dotfiles - All-in-One Install and Setup Script for Unix #
|
||||
######################################################################
|
||||
# Fetches latest changes, symlinks files, and installs dependencies #
|
||||
# Then sets up ZSH, TMUX, Vim as well as OS-specific tools and apps #
|
||||
# For docs and more info, see: https://github.com/lissy93/dotfiles #
|
||||
# #
|
||||
# IMPORTANT: Before running, read through everything very carefully! #
|
||||
# #
|
||||
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
######################################################################
|
||||
|
||||
# Configuration Params
|
||||
REPO_NAME="Lissy93/Dotfiles"
|
||||
REPO_NAME="${REPO_NAME:-Lissy93/Dotfiles}"
|
||||
REPO_PATH="https://github.com/${REPO_NAME}.git"
|
||||
CONFIG=".install.conf.yaml"
|
||||
SYMLINK_FILE="${SYMLINK_FILE:-symlinks.yaml}"
|
||||
DOTBOT_DIR="dotbot"
|
||||
DOTBOT_BIN="bin/dotbot"
|
||||
CURRENT_DIR=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd)
|
||||
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}"
|
||||
TITLE='🧰 Lissy93/Dotfiles Setup'
|
||||
TITLE="🧰 ${REPO_NAME} Setup"
|
||||
|
||||
# Color Variables
|
||||
CYAN_B='\033[1;96m'
|
||||
@ -26,13 +29,25 @@ RED_B='\033[1;31m'
|
||||
GREEN_B='\033[1;32m'
|
||||
PLAIN_B='\033[1;37m'
|
||||
RESET='\033[0m'
|
||||
GREEN='\033[0;32m'
|
||||
PURPLE='\033[0;35m'
|
||||
|
||||
# Start timer
|
||||
start_time=`date +%s`
|
||||
# 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
|
||||
|
||||
# Get system type - Linux / MacOS (Darwin)
|
||||
system_type=$(uname -s)
|
||||
# Clear the screen
|
||||
if [[ ! $params == *"--no-clear"* ]]; then
|
||||
clear
|
||||
fi
|
||||
|
||||
# If set to auto-yes - then don't wait for user reply
|
||||
if [[ $params == *"--auto-yes"* ]]; then
|
||||
PROMPT_TIMEOUT=1
|
||||
REPLY='Y'
|
||||
fi
|
||||
|
||||
# Function that prints important text in a banner with colored border
|
||||
# First param is the text to output, then optional color and padding
|
||||
@ -47,6 +62,23 @@ make_banner () {
|
||||
echo -e "\n${banner}\n${RESET}"
|
||||
}
|
||||
|
||||
# Explain to the user what changes will be made
|
||||
make_intro () {
|
||||
C2="\033[0;35m"
|
||||
C3="\x1b[2m"
|
||||
echo -e "${CYAN_B}The seup script will do the following:${RESET}"
|
||||
echo -e "${C2}(1) Pre-Setup Tasls"
|
||||
echo -e " ${C3}- Check that all requirements are met, and system is compatible"
|
||||
echo -e "${C2}(2) Setup Dotfiles"
|
||||
echo -e " ${C3}- Clone or update dotfiles from git, and apply symlinks"
|
||||
echo -e "${C2}(3) Install packages"
|
||||
echo -e " ${C3}- Update packeges, and prompt to install apps"
|
||||
echo -e "${C2}(4) Configure sytstem"
|
||||
echo -e " ${C3}- Setup Vim, Tmux and ZSH plugins"
|
||||
echo -e " ${C3}- Configure OS and apply app user preferences"
|
||||
echo -e "\n${PURPLE}You will be prompted at each stage, before any changes are made.${RESET}"
|
||||
}
|
||||
|
||||
# Checks if a given package is installed
|
||||
command_exists () {
|
||||
hash "$1" 2> /dev/null
|
||||
@ -59,7 +91,7 @@ terminate () {
|
||||
}
|
||||
|
||||
# Checks if command / package (in $1) exists and then shows
|
||||
# warning or error + terminates depending if required ($2)
|
||||
# either shows a warning or error, depending if package required ($2)
|
||||
system_verify () {
|
||||
if ! command_exists $1; then
|
||||
if $2; then
|
||||
@ -76,6 +108,18 @@ function pre_setup_tasks () {
|
||||
# Show starting banner
|
||||
make_banner "${TITLE}" "${CYAN_B}" 1
|
||||
|
||||
# Print list of what will be applied
|
||||
make_intro
|
||||
|
||||
# Confirm user would like to proceed
|
||||
echo -e "\n${CYAN_B}Are you happy to continue? (y/N)${RESET}"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "\n${PURPLE}No worries, feel free to come back another time.\nTerminating...${RESET}"
|
||||
exit 0
|
||||
fi
|
||||
echo
|
||||
|
||||
# Verify required packages are installed
|
||||
system_verify "git" true
|
||||
system_verify "zsh" false
|
||||
@ -87,24 +131,15 @@ function pre_setup_tasks () {
|
||||
# Downloads / updates dotfiles and symlinks them
|
||||
function setup_dot_files () {
|
||||
|
||||
# If ZSH not the default shell, ask user if they'd like to set it
|
||||
if [[ $SHELL != *"zsh"* ]] && command_exists zsh; then
|
||||
read -p "Would you like to set ZSH as your default shell? (y/N)" -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
chsh -s $(which zsh) $USER
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download / update dotfiles repo with git
|
||||
if [[ ! -d "$DOTFILES_DIR" ]]
|
||||
then
|
||||
echo "${PURPLE}Dotfiles not yet present. Will download ${REPO_NAME} into ${DOTFILES_DIR}"
|
||||
echo -e "${PURPLE}Dotfiles not yet present. Will download ${REPO_NAME} into ${DOTFILES_DIR}${RESET}"
|
||||
mkdir -p "${DOTFILES_DIR}"
|
||||
git clone --recursive ${REPO_PATH} ${DOTFILES_DIR}
|
||||
else
|
||||
echo -e "${PURPLE}Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}"
|
||||
cd "${DOTFILES_DIR}" && git pull && git submodule update --recursive
|
||||
echo -e "${PURPLE}Pulling changes from ${REPO_NAME} into ${DOTFILES_DIR}${RESET}"
|
||||
cd "${DOTFILES_DIR}" && git pull origin master && git submodule update --recursive
|
||||
fi
|
||||
|
||||
# If git clone / pull failed, then exit with error
|
||||
@ -116,42 +151,117 @@ function setup_dot_files () {
|
||||
fi
|
||||
|
||||
# Set up symlinks with dotbot
|
||||
echo -e "${PURPLE}Setting up Symlinks${RESET}"
|
||||
cd "${DOTFILES_DIR}"
|
||||
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
|
||||
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||
chmod +x dotbot/bin/dotbot
|
||||
"${DOTFILES_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${DOTFILES_DIR}" -c "${CONFIG}" "${@}"
|
||||
"${DOTFILES_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${DOTFILES_DIR}" -c "${SYMLINK_FILE}" "${@}"
|
||||
}
|
||||
|
||||
# Applies application-specific preferences, and runs some setup tasks
|
||||
function apply_preferences () {
|
||||
|
||||
# If ZSH not the default shell, ask user if they'd like to set it
|
||||
if [[ $SHELL != *"zsh"* ]] && command_exists zsh; then
|
||||
read -t $PROMPT_TIMEOUT -p "$(echo -e $CYAN_B)Would you like to set ZSH as your default shell? (y/N)" -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${PURPLE}Setting ZSH as default shell${RESET}"
|
||||
chsh -s $(which zsh) $USER
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install / update vim plugins with Plug
|
||||
echo -e "\n${PURPLE}Installing Vim Plugins${RESET}"
|
||||
vim +PlugInstall +qall
|
||||
|
||||
# Install / update Tmux plugins with TPM
|
||||
echo -e "${PURPLE}Installing TMUX Plugins${RESET}"
|
||||
chmod ug+x "${XDG_DATA_HOME}/tmux/tpm"
|
||||
sh "${TMUX_PLUGIN_MANAGER_PATH}/tpm/bin/install_plugins"
|
||||
sh "${XDG_DATA_HOME}/tmux/plugins/tpm/bin/install_plugins"
|
||||
|
||||
# Install / update ZSH plugins with Antigen
|
||||
echo -e "${PURPLE}Installing ZSH Plugins${RESET}"
|
||||
/bin/zsh -i -c "antigen update && antigen-apply"
|
||||
|
||||
# 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
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
if [ "$system_type" = "Darwin" ]; then
|
||||
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"
|
||||
for macScript in "macos-security.sh" "macos-preferences.sh" "macos-apps.sh"; do
|
||||
chmod +x $macos_settings_dir/$macScript && $macos_settings_dir/$macScript --quick-exit
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Setup Brew, install / update packages, organize launchpad and checks for macOS updates
|
||||
function intall_macos_packages () {
|
||||
# Homebrew not installed, ask user if they'd like to download it now
|
||||
if ! command_exists brew; then
|
||||
read -t $PROMPT_TIMEOUT -p "$(echo -e $CYAN_B)Would you like to install Homebrew? (y/N)" -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -en "🍺 ${PURPLE}Installing Homebrew...${RESET}\n"
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
||||
fi
|
||||
fi
|
||||
# Update / Install the Homebrew packages in ~/.Brewfile
|
||||
if command_exists brew && [ -f "$DOTFILES_DIR/installs/Brewfile" ]; then
|
||||
echo -e "\n${PURPLE}Updating homebrew and packages...${RESET}"
|
||||
brew update
|
||||
brew upgrade
|
||||
brew bundle --global --file $HOME/.Brewfile
|
||||
brew cleanup
|
||||
else
|
||||
echo -e "${PURPLE}Skipping Homebrew as requirements not met${RESET}"
|
||||
fi
|
||||
# Restore launchpad structure with lporg
|
||||
launchpad_layout="${DOTFILES_DIR}/system-specific/macos/app-configs/launchpad.yml"
|
||||
if command_exists lporg && [ -f $launchpad_layout ]; then
|
||||
echo -e "${PURPLE}Restoring Launchpad Layout...${RESET}"
|
||||
yes "" | lporg load $launchpad_layout
|
||||
fi
|
||||
# Check for MacOS software updates, and ask user if they'd like to install
|
||||
echo -e "${PURPLE}Checking for software updates...${RESET}"
|
||||
pending_updates=$(softwareupdate -l 2>&1)
|
||||
if [[ ! $pending_updates == *"No new software available."* ]]; then
|
||||
echo -e "${PURPLE}A new version of Mac OS is availbile${RESET}"
|
||||
read -t $PROMPT_TIMEOUT -p "$(echo -e $CYAN_B)Would you like to update to the latest version of MacOS? (y/N)" -n 1 -r
|
||||
echo -e "${RESET}"
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo "${PURPLE}Updating MacOS${RESET}"
|
||||
softwareupdate -i -a
|
||||
fi
|
||||
else
|
||||
echo -e "${GREEN}System is up-to-date."\
|
||||
"Running $(sw_vers -productName) version $(sw_vers -productVersion)${RESET}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Based on system type, uses appropriate package manager to install / updates apps
|
||||
function install_packages () {
|
||||
# Mac OS
|
||||
if [ "$system_type" = "Darwin" ]; then
|
||||
# Homebrew not installed, ask user if they'd like to download it now
|
||||
if ! command_exists brew; then
|
||||
read -p "Would you like to install Homebrew? (y/N)" -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -en "🍺 ${YELLOW_B}Installing Homebrew...${RESET}\n"
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
||||
fi
|
||||
fi
|
||||
# Update / Install the Homebrew packages in ~/.Brewfile
|
||||
if command_exists brew && [ -f "$HOME/.Brewfile" ]
|
||||
then
|
||||
echo -e "${PURPLE}Updating homebrew and packages...${RESET}"
|
||||
brew update
|
||||
brew upgrade
|
||||
BREW_PREFIX=$(brew --prefix)
|
||||
brew bundle --global --file $HOME/.Brewfile
|
||||
brew cleanup
|
||||
fi
|
||||
fi
|
||||
# Windows (WIP)
|
||||
if [ "$system_type" = "WindowsNT" ] || [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ]; then
|
||||
"${DOTFILES_DIR}/installs/windows.sh"
|
||||
fi
|
||||
read -t $PROMPT_TIMEOUT -p "$(echo -e $CYAN_B)Would you like to install / update system packages? (y/N) " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${PURPLE}Skipping package installs${RESET}"
|
||||
return
|
||||
fi
|
||||
# Mac OS
|
||||
if [ "$system_type" = "Darwin" ]; then
|
||||
intall_macos_packages
|
||||
fi
|
||||
# If running in Linux desktop mode, prompt to install desktop apps via Flatpak
|
||||
flatpak_script="${DOTFILES_DIR}/installs/flatpak.sh"
|
||||
if [[ $(uname -s) == "Linux" ]] && [ ! -z $XDG_CURRENT_DESKTOP ] && [ -f $flatpak_script ]; then
|
||||
chmod +x $flatpak_script
|
||||
$flatpak_script
|
||||
fi
|
||||
}
|
||||
|
||||
# Updates current session, and outputs summary
|
||||
@ -162,12 +272,28 @@ function finishing_up () {
|
||||
# Print success message, and time taken
|
||||
total_time=$((`date +%s`-start_time))
|
||||
make_banner "✨ Dotfiles configured succesfully in $total_time seconds" ${GREEN_B} 1
|
||||
echo -e "\033[0;92m .--.\n |o_o |\n |:_/ |\n // \
|
||||
\ \\ \n (| | ) \n /'\_ _/\`\\ \n \\___)=(___/\n"
|
||||
|
||||
# Refresh ZSH sesssion
|
||||
SKIP_WELCOME=true || exec zsh
|
||||
|
||||
# Exit script with success code
|
||||
echo -e "${CYAN_B}Press any key to exit.${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -s
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Begin!
|
||||
# If --help flag passed in, just show the help menu
|
||||
if [[ $params == *"--help"* ]]; then
|
||||
make_intro
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Let's Begin!
|
||||
pre_setup_tasks # Print start message, and check requirements are met
|
||||
setup_dot_files # Clone / updatae dotfiles, and create the symlinks
|
||||
install_packages # Prompt to install / update OS-specific packages
|
||||
finishing_up # Re-source .zshenv, and print summary
|
||||
# All done!
|
||||
apply_preferences # Apply settings for individual applications
|
||||
finishing_up # Refresh current session, print summary and exit
|
||||
# All done :)
|
||||
|
@ -1,123 +0,0 @@
|
||||
# ~/.Brewfile
|
||||
#
|
||||
# List of packages to be installed / updated via Homebrew
|
||||
# Apps are sorted by category, and arranged alphabetically
|
||||
# Be sure to delete / comment out anything you do not need
|
||||
# Usage, run: $ brew bundle --global --file $HOME/.Brewfile
|
||||
# See brew docs for more info: https://docs.brew.sh/Manpage
|
||||
|
||||
# Options
|
||||
cask_args appdir: '~/Applications', require_sha: true
|
||||
|
||||
# Taps
|
||||
tap 'homebrew/bundle'
|
||||
tap 'homebrew/core'
|
||||
tap 'homebrew/services'
|
||||
|
||||
# CLI Essentials
|
||||
brew 'git'
|
||||
brew 'neovim'
|
||||
brew 'ranger'
|
||||
brew 'tmux'
|
||||
|
||||
# CLI Utils
|
||||
brew 'ctags'
|
||||
brew 'exa'
|
||||
brew 'fzf'
|
||||
brew 'glances'
|
||||
brew 'gotop'
|
||||
brew 'iproute2mac'
|
||||
brew 'jq'
|
||||
brew 'lazydocker'
|
||||
brew 'scc'
|
||||
brew 'tldr'
|
||||
brew 'tree'
|
||||
brew 'xsel'
|
||||
|
||||
# CLI Fun
|
||||
brew 'figlet'
|
||||
brew 'lolcat'
|
||||
brew 'neofetch'
|
||||
|
||||
# Development
|
||||
cask 'android-studio'
|
||||
cask 'boop'
|
||||
brew 'gradle'
|
||||
# brew 'qemu'
|
||||
cask 'iterm2'
|
||||
cask 'postman'
|
||||
cask 'sourcetree'
|
||||
cask 'utm'
|
||||
cask 'visual-studio-code'
|
||||
|
||||
# Development Utils
|
||||
brew 'gh'
|
||||
cask 'ngrok'
|
||||
|
||||
# Languages and Compilers
|
||||
brew 'docker'
|
||||
brew 'gcc'
|
||||
brew 'go'
|
||||
brew 'lua'
|
||||
brew 'node'
|
||||
brew 'nvm'
|
||||
brew 'openjdk'
|
||||
brew 'python'
|
||||
brew 'rust'
|
||||
cask 'android-sdk'
|
||||
|
||||
# Network and Security Testing
|
||||
brew 'nmap'
|
||||
brew 'wrk'
|
||||
cask 'burp-suite'
|
||||
cask 'metasploit'
|
||||
cask 'owasp-zap'
|
||||
cask 'wireshark'
|
||||
|
||||
# Security Utilities
|
||||
brew 'bcrypt'
|
||||
cask 'gpg-suite'
|
||||
brew 'openssl'
|
||||
cask 'veracrypt'
|
||||
|
||||
# Fonts
|
||||
tap 'homebrew/cask-fonts'
|
||||
cask 'font-fira-code'
|
||||
cask 'font-hack'
|
||||
cask 'font-inconsolata'
|
||||
cask 'font-meslo-lg-nerd-font'
|
||||
|
||||
# Mac OS Mods and Imrovments
|
||||
brew 'm-cli'
|
||||
cask 'alt-tab'
|
||||
cask 'anybar'
|
||||
cask 'coteditor'
|
||||
cask 'finicky'
|
||||
cask 'hiddenbar'
|
||||
cask 'linearmouse'
|
||||
cask 'little-snitch'
|
||||
cask 'stats'
|
||||
|
||||
# Productivity Utils
|
||||
cask 'copyq'
|
||||
tap 'espanso/espanso'
|
||||
cask 'espanso'
|
||||
|
||||
# Media and Creativity
|
||||
brew 'handbrake'
|
||||
cask 'audacity'
|
||||
cask 'gimp'
|
||||
cask 'inkscape'
|
||||
cask 'obs'
|
||||
cask 'shotcut'
|
||||
cask 'spotify', args: { require_sha: false }
|
||||
cask 'transmission'
|
||||
cask 'vlc'
|
||||
|
||||
# General Applications
|
||||
cask '1password'
|
||||
cask 'tresorit'
|
||||
cask 'firefox'
|
||||
cask 'chromium'
|
||||
cask 'standard-notes'
|
||||
cask 'signal'
|
222
installs/Brewfile
Normal file
222
installs/Brewfile
Normal file
@ -0,0 +1,222 @@
|
||||
#############################################################
|
||||
# ~/.Brewfile - Software Installs for MacOS #
|
||||
# #
|
||||
# List of packages to be installed / updated via Homebrew #
|
||||
# Apps are sorted by category, and arranged alphabetically #
|
||||
# Be sure to delete / comment out anything you do not need #
|
||||
# Usage, run: $ brew bundle --global --file $HOME/.Brewfile #
|
||||
# See brew docs for more info: https://docs.brew.sh/Manpage #
|
||||
# #
|
||||
# License: MIT © Alicia Sykes 2022 <https://aliciasykes.com>#
|
||||
#############################################################
|
||||
|
||||
# Options
|
||||
cask_args appdir: '~/Applications', require_sha: true
|
||||
|
||||
# Taps
|
||||
tap 'homebrew/bundle'
|
||||
tap 'homebrew/core'
|
||||
tap 'homebrew/services'
|
||||
tap 'blacktop/tap'
|
||||
tap 'browsh-org/homebrew-browsh'
|
||||
tap 'espanso/espanso'
|
||||
tap 'jesseduffield/lazygit'
|
||||
tap 'koekeishiya/formulae'
|
||||
|
||||
#############################################################
|
||||
# Command Line #
|
||||
#############################################################
|
||||
|
||||
# CLI Essentials
|
||||
brew 'git' # Version controll
|
||||
brew 'neovim' # Text editor
|
||||
brew 'ranger' # Directory browser
|
||||
brew 'tmux' # Term multiplexer
|
||||
|
||||
# CLI Basics
|
||||
brew 'aria2' # Resuming download util (better wget)
|
||||
brew 'bat' # Output highlighting (better cat)
|
||||
brew 'broot' # Interactive directory navigation
|
||||
brew 'ctags' # Indexing of file info + headers
|
||||
brew 'diff-so-fancy'# Readable file compares (better diff)
|
||||
brew 'exa' # Listing files with info (better ls)
|
||||
brew 'fzf' # Fuzzy file finder and filtering
|
||||
brew 'hyperfine' # Benchmarking for arbitrary commands
|
||||
brew 'just' # Powerful command runner (better make)
|
||||
brew 'jq' # JSON parser, output and query files
|
||||
brew 'duf' # Get info on mounted disks (better df)
|
||||
brew 'procs' # Advanced process viewer (better ps)
|
||||
brew 'ripgrep' # Searching within files (better grep)
|
||||
brew 'scc' # Count lines of code (better cloc)
|
||||
brew 'sd' # RegEx find and replace (better sed)
|
||||
brew 'thefuck' # Auto-correct miss-typed commands
|
||||
brew 'tldr' # Community-maintained docs (better man)
|
||||
brew 'tree' # Directory listings as tree structure
|
||||
brew 'trash-cli' # Record and restore removed files
|
||||
brew 'xsel' # Copy paste access to the X clipboard
|
||||
brew 'zoxide' # Auto-learning navigation (better cd)
|
||||
|
||||
# CLI Monitoring and Performance Apps
|
||||
brew 'bmon' # Bandwidth utilization monitor
|
||||
brew 'ctop' # Container metrics and monitoring
|
||||
brew 'bpytop' # Resource monitoring (like htop)
|
||||
brew 'glances' # Resource monitor + web and API
|
||||
brew 'goaccess' # Web log analyzer and viewer
|
||||
brew 'gping' # Interactive ping tool, with graph
|
||||
brew 'ncdu' # Disk usage analyzer and monitor (better du)
|
||||
brew 'speedtest-cli'# Command line speed test utility
|
||||
|
||||
# CLI Productivity Apps
|
||||
brew 'browsh' # Web browser, in terminal
|
||||
brew 'buku' # Bookmark manager
|
||||
brew 'cmus' # Music player
|
||||
brew 'khal' # Calendar client
|
||||
brew 'mutt' # Email client
|
||||
brew 'newsboat' # RSS / ATOM reader
|
||||
brew 'pass' # Password store
|
||||
brew 'rclone' # Manage cloud storage
|
||||
brew 'task' # Todo + task management
|
||||
|
||||
# CLI Development Suits
|
||||
brew 'httpie' # HTTP / API testing testing client
|
||||
brew 'lazydocker' # Full Docker management app
|
||||
brew 'lazygit' # Full Git managemtne app
|
||||
|
||||
# CLI External Sercvices
|
||||
cask 'ngrok' # Reverse proxy for sharing localhost
|
||||
brew 'tmate' # Share a terminal session via internet
|
||||
brew 'asciinema' # Recording + sharing terminal sessions
|
||||
brew 'navi' # Browse, search, read cheat sheets
|
||||
|
||||
# CLI Fun
|
||||
brew 'cowsay' # Have an ASCII cow say your message
|
||||
brew 'figlet' # Output text as big ASCII art text
|
||||
brew 'lolcat' # Make console output raibow colored
|
||||
brew 'neofetch' # Show system data and ditstro info
|
||||
brew 'pipes-sh' # Cool terminal pipe screen saver
|
||||
brew 'pv' # Pipe viewer, with animation options
|
||||
|
||||
#############################################################
|
||||
# Software Development #
|
||||
#############################################################
|
||||
|
||||
# Development Apps
|
||||
cask 'android-studio' # IDE for Android development
|
||||
cask 'boop' # Test transformation tool
|
||||
brew 'gradle' # Build automation for Java
|
||||
cask 'iterm2' # Better terminal emulator
|
||||
cask 'postman' # HTTP API testing app
|
||||
cask 'sourcetree' # Git visual client
|
||||
cask 'utm' # VM management console
|
||||
cask 'visual-studio-code' # Code editor
|
||||
|
||||
# Development Langs, Compilers, Package Managers and SDKs
|
||||
brew 'docker' # Containers
|
||||
brew 'gcc' # GNU C++ compilers
|
||||
brew 'go' # Compiler for Go Lang
|
||||
brew 'lua' # Lua interpreter
|
||||
brew 'luarocks' # Package manager for Lua
|
||||
brew 'node' # Node.js
|
||||
brew 'nvm' # Switching node versions
|
||||
brew 'openjdk' # Java development kit
|
||||
brew 'python' # Python interpriter
|
||||
brew 'rust' # Rust language
|
||||
cask 'android-sdk' # Android software dev kit
|
||||
|
||||
# Development Utils
|
||||
brew 'gh' # Interact with GitHub PRs, issues, repos
|
||||
brew 'git-extras' # Extra git commands for common tasks
|
||||
brew 'scrcpy' # Display and control Andrdroid devices
|
||||
brew 'terminal-notifier' # Trigger Mac notifications from terminal
|
||||
brew 'tig' # Text-mode interface for git
|
||||
brew 'ttygif' # Generate GIF from terminal commands + output
|
||||
brew 'watchman' # Watch for changes and reload dev server
|
||||
|
||||
# Network and Security Testing
|
||||
brew 'bettercap' # Network, scanning and moniroting
|
||||
brew 'nmap' # Port scanning
|
||||
brew 'wrk' # HTTP benchmarking
|
||||
cask 'burp-suite' # Web security testing
|
||||
cask 'metasploit' # Pen testing framework
|
||||
cask 'owasp-zap' # Web app security scanner
|
||||
cask 'wireshark' # Network analyzer + packet capture
|
||||
|
||||
# Security Utilities
|
||||
brew 'bcrypt' # Encryption utility, using blowfish
|
||||
brew 'clamav' # Open source virus scanning suite
|
||||
cask 'gpg-suite' # PGP encryption for emails and files
|
||||
brew 'git-crypt' # Transparent encryption for git repos
|
||||
brew 'lynis' # Scan system for common security issues
|
||||
brew 'openssl' # Cryptography and SSL/TLS Toolkit
|
||||
brew 'rkhunter' # Search / detect potential root kits
|
||||
cask 'veracrypt' # File and volume encryption
|
||||
|
||||
#############################################################
|
||||
# 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
|
||||
cask 'audacity' # Audio editor / recorder
|
||||
cask 'gimp' # Photo editor
|
||||
brew 'handbrake' # Video transcoder
|
||||
cask 'inkscape' # Vector editor
|
||||
cask 'obs' # Screencasting / recording
|
||||
cask 'shotcut' # Video editor
|
||||
|
||||
# Media
|
||||
cask 'calibre' # E-Book reader
|
||||
cask 'spotify', args: { require_sha: false } # Propietary music streaming
|
||||
cask 'transmission' # Torrent client
|
||||
cask 'vlc' # Media player
|
||||
brew 'pandoc' # Universal file converter
|
||||
brew 'youtube-dl' # YouTube video downloader
|
||||
|
||||
# Personal Applications
|
||||
cask '1password' # Password manager (proprietary)
|
||||
cask 'tresorit' # Encrypted file backup (proprietary)
|
||||
cask 'standard-notes' # Encrypted synced notes
|
||||
cask 'signal' # Link to encrypted mobile messenger
|
||||
cask 'ledger-live' # Crypto hardware wallet manager
|
||||
cask 'mountain-duck' # Mount remote storage locations
|
||||
cask 'protonmail-bridge' # Decrypt ProtonMail emails
|
||||
cask 'protonvpn' # Client app for ProtonVPN
|
||||
|
||||
# Browsers
|
||||
cask 'firefox'
|
||||
cask 'chromium'
|
||||
cask 'orion'
|
||||
|
||||
# Fonts
|
||||
tap 'homebrew/cask-fonts'
|
||||
cask 'font-fira-code'
|
||||
cask 'font-hack'
|
||||
cask 'font-inconsolata'
|
||||
cask 'font-meslo-lg-nerd-font'
|
||||
|
||||
# EOF
|
99
installs/arch.sh
Normal file
99
installs/arch.sh
Normal file
@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
###############################################################
|
||||
# Installs listed packages on Arch-based systems via Pacman #
|
||||
# Doesn't include desktop apps, that're managed via Flatpak #
|
||||
# Apps are sorted by category, and arranged alphabetically #
|
||||
# Be sure to delete / comment out anything you do not need #
|
||||
# For more info, see: https://wiki.archlinux.org/title/Pacman #
|
||||
###############################################################
|
||||
# MIT Licensed (C) Alicia Sykes 2022 <https://aliciasykes.com>#
|
||||
###############################################################
|
||||
|
||||
# Apps to be installed via Pacman
|
||||
pacman_apps=(
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
# Colors
|
||||
CYAN_B='\033[1;96m'
|
||||
YELLOW='\033[0;93m'
|
||||
RESET='\033[0m'
|
||||
GREEN='\033[0;32m'
|
||||
PURPLE='\033[0;35m'
|
||||
LIGHT='\x1b[2m'
|
||||
|
||||
PROMPT_TIMEOUT=15 # When user is prompted for input, skip after x seconds
|
||||
|
||||
# Print intro message
|
||||
echo -e "${PURPLE}Starting Arch app install / update script"
|
||||
echo -e "${LIGHT}The following script is for Arch / Arch-based headless systems, and will"
|
||||
echo -e "update database, upgrade packages, clear cache then install all listed CLI apps."
|
||||
echo -e "${YELLOW}Before proceeding, ensure your happy with all the packages listed in \e[4m${0##*/}"
|
||||
echo -e "${RESET}"
|
||||
|
||||
# Check if running as root, and prompt for password if not
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo -e "${PURPLE}Elevated permissions are required to adjust system settings."
|
||||
echo -e "${CYAN_B}Please enter your password...${RESET}"
|
||||
sudo -v
|
||||
if [ $? -eq 1 ]; then
|
||||
echo -e "${YELLOW}Exiting, as not being run as sudo${RESET}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check pacman actually installed
|
||||
if ! hash pacman 2> /dev/null; then
|
||||
echo "${YELLOW_B}Pacman doesn't seem to be present on your system. Exiting...${RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prompt user to update package database
|
||||
echo -e "${CYAN_B}Would you like to update package database? (y/N)${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${PURPLE}Updating dadatbase...${RESET}"
|
||||
sudo pacman -Syy --noconfirm
|
||||
fi
|
||||
|
||||
# Prompt user to upgrade currently installed packages
|
||||
echo -e "${CYAN_B}Would you like to upgrade currently installed packages? (y/N)${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${PURPLE}Upgrading installed packages...${RESET}"
|
||||
sudo pacman -Syu --noconfirm
|
||||
fi
|
||||
|
||||
# Prompt user to clear old package caches
|
||||
echo -e "${CYAN_B}Would you like to clear unused package caches? (y/N)${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${PURPLE}Freeing up disk space...${RESET}"
|
||||
sudo pacman -Sc --noconfirm
|
||||
fi
|
||||
|
||||
# Prompt user to install all listed apps
|
||||
echo -e "${CYAN_B}Would you like to install listed apps? (y/N)${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${PURPLE}Starting install...${RESET}"
|
||||
for app in ${pacman_apps[@]}; do
|
||||
if hash "${app}" 2> /dev/null; then
|
||||
echo -e "${YELLOW}[Skipping]${LIGHT} ${app} is already installed${RESET}"
|
||||
elif hash flatpak 2> /dev/null && [[ ! -z $(echo $(flatpak list --columns=ref | grep $app)) ]]; then
|
||||
echo -e "${YELLOW}[Skipping]${LIGHT} ${app} is already installed via Flatpak${RESET}"
|
||||
else
|
||||
echo -e "${PURPLE}[Installing]${LIGHT} Downloading ${app}...${RESET}"
|
||||
# pacman -S ${app} --noconfirm
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo -e "${PURPLE}Finished installing / updating Arch packages.${RESET}"
|
169
installs/flatpak.sh
Normal file
169
installs/flatpak.sh
Normal file
@ -0,0 +1,169 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
######################################################################
|
||||
# Linux Desktop Application Installations via Flatpak #
|
||||
######################################################################
|
||||
# This script will: #
|
||||
# - Check that Flatpak is installed / promt to install #
|
||||
# - Update currently installed Flatpak apps from FlatHub #
|
||||
# - Check app not already installed via system package manager #
|
||||
# - Then install any not-yet-installed that are apps listed #
|
||||
# #
|
||||
# IMPORTANT: Be sure to remove / comment any apps you do not want! #
|
||||
# #
|
||||
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
######################################################################
|
||||
|
||||
# Remote origin to use for installations
|
||||
flatpak_origin='flathub'
|
||||
|
||||
# List of desktop apps to be installed via Flatpak
|
||||
flatpak_apps=(
|
||||
|
||||
# Communication
|
||||
'com.discordapp.Discord' # Team messaging and voice
|
||||
'im.riot.Riot' # Decentralized Matrix chat
|
||||
'info.mumble.Mumble' # Low latency VoIP client
|
||||
'org.jitsi.jitsi-meet' # Encrypted video calls
|
||||
'org.mozilla.Thunderbird' # Email + calendar client
|
||||
'org.signal.Signal' # Private messenger, mobile
|
||||
'com.slack.Slack' # Work and team messaging
|
||||
'com.github.eneshecan.WhatsAppForLinux' # WhatApp client
|
||||
|
||||
# Media
|
||||
'com.spotify.Client' # Music streaming
|
||||
'com.valvesoftware.Steam' # Gaming
|
||||
'org.gnome.Cheese' # Webcam client
|
||||
'org.libretro.RetroArch' # Retro game emulation
|
||||
'org.videolan.VLC' # Media player
|
||||
|
||||
# Creativity
|
||||
'com.ultimaker.cura' # 3D slicing
|
||||
'com.obsproject.Studio' # Video streaming
|
||||
'fr.handbrake.ghb' # Video transcoder
|
||||
'io.github.seadve.Kooha' # Screen recorder
|
||||
'org.audacityteam.Audacity' # Sound editor
|
||||
'org.blender.Blender' # 3D modeling
|
||||
'org.darktable.Darktable' # Video editor
|
||||
'org.gimp.GIMP' # Picture editor
|
||||
'org.inkscape.Inkscape' # Vector editor
|
||||
'org.shotcut.Shotcut' # Video editor
|
||||
'org.synfig.SynfigStudio' # 2D animation
|
||||
|
||||
# Software development
|
||||
'com.visualstudio.code' # Extendable IDE
|
||||
'com.getpostman.Postman' # API development
|
||||
'cc.arduino.IDE2' # IOT development
|
||||
'com.axosoft.GitKraken' # GUI git client
|
||||
'com.google.AndroidStudio' # Android dev IDE
|
||||
'io.podman_desktop.PodmanDesktop' # Docker / Podman UI
|
||||
|
||||
# Security testing
|
||||
'org.wireshark.Wireshark' # Packet capture and analyzer
|
||||
'org.zaproxy.ZAP' # Auto vulnerability scanning
|
||||
'org.nmap.Zenmap' # GUI for Nmap security scans
|
||||
|
||||
# Browsers
|
||||
'org.mozilla.firefox'
|
||||
'com.github.Eloston.UngoogledChromium'
|
||||
'com.github.micahflee.torbrowser-launcher'
|
||||
|
||||
# Office
|
||||
'org.libreoffice.LibreOffice'
|
||||
|
||||
# Personal
|
||||
'ch.protonmail.protonmail-bridge' # ProtonMail bridge
|
||||
'com.belmoussaoui.Authenticator' # OTP authenticator
|
||||
'org.cryptomator.Cryptomator' # Encryption for cloud
|
||||
'org.standardnotes.standardnotes' # Encrypted synced notes
|
||||
# Missing: Trewsorit, 1Password, EteSync, Veracrypt, Ledger
|
||||
)
|
||||
|
||||
# Color Variables
|
||||
CYAN_B='\033[1;96m'
|
||||
YELLOW='\033[0;93m'
|
||||
RED_B='\033[1;31m'
|
||||
RESET='\033[0m'
|
||||
GREEN='\033[0;32m'
|
||||
PURPLE='\033[0;35m'
|
||||
LIGHT='\x1b[2m'
|
||||
|
||||
PROMPT_TIMEOUT=15 # When user is prompted for input, skip after x seconds
|
||||
|
||||
# Helper function to install Flatpak for users current distro
|
||||
function install_flatpak () {
|
||||
# Arch, Manjaro
|
||||
if hash "pacman" 2> /dev/null; then
|
||||
echo -e "${PURPLE}Installing Flatpak via Pacman${RESET}"
|
||||
sudo pacman -S flatpak
|
||||
# Debian, Ubuntu, PopOS, Raspian
|
||||
elif hash "apt" 2> /dev/null; then
|
||||
echo -e "${PURPLE}Installing Flatpak via apt get${RESET}"
|
||||
sudo apt install flatpak
|
||||
# Alpine
|
||||
elif hash "apk" 2> /dev/null; then
|
||||
echo -e "${PURPLE}Installing Flatpak via apk add${RESET}"
|
||||
sudo apk add flatpak
|
||||
# Red Hat, CentOS
|
||||
elif hash "yum" 2> /dev/null; then
|
||||
echo -e "${PURPLE}Installing Flatpak via Yum${RESET}"
|
||||
sudo yum install flatpak
|
||||
fi
|
||||
echo -e "${PURPLE}Adding Flathub repo${RESET}"
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
}
|
||||
|
||||
# Ask user if they'd like to proceed, and exit if not
|
||||
echo -e "${CYAN_B}Would you like to install Flatpak desktop apps? (y/N)${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${YELLOW}Skipping Flatpak installations..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${CYAN_B}Starting Flatpak App Installation Script${RESET}"
|
||||
|
||||
# Check that Flatpak is present, prompt to install or exit if not
|
||||
if ! hash flatpak 2> /dev/null; then
|
||||
echo -e "${PURPLE}Flatpak isn't yet installed on your system${RESET}"
|
||||
echo -e "${CYAN_B}Would you like to install Flatpak now?${RESET}\n"
|
||||
read -t $PROMPT_TIMEOUT -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
install_flatpak
|
||||
else
|
||||
echo -e "${YELLOW}Skipping Flatpak installations, as Flatpack not installed"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Update currently installed apps
|
||||
echo -e "${PURPLE}Updating installed apps${RESET}"
|
||||
yes "" | flatpak update
|
||||
|
||||
# Itterate over each app, check if already installed, otherwise install now
|
||||
echo -e "${PURPLE}Installing apps defined in manifest${RESET}"
|
||||
for app in ${flatpak_apps[@]}; do
|
||||
app_name=$(echo $app | rev | cut -d "." -f1 | rev)
|
||||
is_in_flatpak=$(echo $(flatpak list --columns=ref | grep $app))
|
||||
is_in_pacman=$(echo $(pacman -Qk $(echo $app_name | tr 'A-Z' 'a-z') 2> /dev/null ))
|
||||
is_in_apt=$(echo $(dpkg -s $(echo $app_name | tr 'A-Z' 'a-z') 2> /dev/null ))
|
||||
# Check app not already installed via Flatpak
|
||||
if [ -n "$is_in_flatpak" ]; then
|
||||
echo -e "${YELLOW}[Skipping] ${LIGHT}${app_name} is already installed.${RESET}"
|
||||
# Check app not installed via Pacman (Arch Linux)
|
||||
elif [[ "${is_in_pacman}" == *"total files"* ]]; then
|
||||
echo -e "${YELLOW}[Skipping] ${LIGHT}${app_name} is already installed via Pacman.${RESET}"
|
||||
# Check app not installed via apt get (Debian)
|
||||
elif [[ "${is_in_apt}" == *"install ok installed"* ]]; then
|
||||
echo -e "${YELLOW}[Skipping] ${LIGHT}${app_name} is already installed via apt-get.${RESET}"
|
||||
else
|
||||
# Install app using Flatpak
|
||||
echo -e "${GREEN}[Installing] ${LIGHT}Downloading ${app_name} (from ${flatpak_origin}).${RESET}"
|
||||
flatpak install -y --noninteractive $flatpak_origin $app
|
||||
echo
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "${PURPLE}Finished processing Flatpak apps${RESET}"
|
38
lets-go.sh
Executable file
38
lets-go.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
######################################################################
|
||||
# Lissy93/dotfiles - Remote Runnable Dotfile Setup and Update Script #
|
||||
# Licensed under MIT (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
# #
|
||||
# This script will clone + install, or update dotfiles from git #
|
||||
# Be sure to read through the repo before running anything here #
|
||||
# For more info, read docs: https://github.com/Lissy93/dotfiles #
|
||||
# #
|
||||
# Config Options: #
|
||||
# - DOTFILES_REPO - Optionally sets the source repo to be cloned #
|
||||
# - DOTFILES_DIR - Optionally sets the local destination directory #
|
||||
######################################################################
|
||||
|
||||
# If not already set, specify dotfiles destination directory and source repo
|
||||
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}"
|
||||
DOTFILES_REPO="${DOTFILES_REPO:-https://github.com/lissy93/dotfiles.git}"
|
||||
|
||||
# Print starting message
|
||||
echo -e "\033[1;35m""Lissy93/Dotfiles Installation Script 🧰
|
||||
\033[0;35mThis script will install or update dotfiles from \033[4;35m\
|
||||
${DOTFILES_REPO}\033[0;35m into \033[4;35m${DOTFILES_DIR}\033[0;35m\n\
|
||||
Be sure that you have read and understood config which will be applied.
|
||||
If you don't want to proceed, press Ctrl+C to cancel now...\033[0m\n"
|
||||
|
||||
# If dotfiles not yet present then clone
|
||||
if [[ ! -d "$DOTFILES_DIR" ]]; then
|
||||
mkdir -p "${DOTFILES_DIR}" && \
|
||||
git clone --recursive ${DOTFILES_REPO} ${DOTFILES_DIR}
|
||||
fi
|
||||
|
||||
# Execute setup or update script
|
||||
cd "${DOTFILES_DIR}" && \
|
||||
chmod +x ./install.sh && \
|
||||
./install.sh
|
||||
|
||||
# EOF
|
43
symlinks.yaml
Normal file
43
symlinks.yaml
Normal file
@ -0,0 +1,43 @@
|
||||
- defaults:
|
||||
link:
|
||||
create: true
|
||||
relink: true
|
||||
|
||||
- clean: ['~', '${XDG_CONFIG_HOME}']
|
||||
|
||||
- shell:
|
||||
# Before symlinking, source .zshenv in order to set XDG variables
|
||||
- description: Set XDG environmental variables
|
||||
command: source ./zsh/.zshenv
|
||||
- link:
|
||||
~/.zshenv:
|
||||
path: zsh/.zshenv
|
||||
force: true
|
||||
${XDG_CONFIG_HOME}/zsh: zsh
|
||||
${XDG_CONFIG_HOME}/vim: vim
|
||||
${XDG_CONFIG_HOME}/nvim: vim
|
||||
${XDG_CONFIG_HOME}/bash: bash
|
||||
${XDG_DATA_HOME}/tmux/plugins/tpm: tpm
|
||||
${XDG_CONFIG_HOME}/tmux/tmux.conf: tmux/tmux.conf
|
||||
${XDG_CONFIG_HOME}/utils: utils
|
||||
${XDG_CONFIG_HOME}/git/.gitconfig: configs/.gitconfig
|
||||
# ~/.gitconfig: configs/.gitconfig
|
||||
${XDG_CONFIG_HOME}/.gitignore_global: configs/.gitignore_global
|
||||
# ${XDG_CONFIG_HOME}/curl/.curlrc: configs/.curlrc
|
||||
$XDG_CONFIG_HOME/yabai/yabairc:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: system-specific/macos/app-configs/yabairc
|
||||
$XDG_CONFIG_HOME/skhd/skhdrc:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: system-specific/macos/app-configs/skhdrc
|
||||
~/.Brewfile:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: installs/Brewfile
|
||||
~/.finicky.js:
|
||||
if: '[ `uname` = Darwin ]'
|
||||
path: system-specific/macos/app-configs/.finicky.js
|
||||
|
||||
- create:
|
||||
- ~/Downloads
|
||||
- ~/Documents
|
||||
- ~/Applications
|
11
system-specific/macos/.macos
Executable file
11
system-specific/macos/.macos
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# ~/.macos
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)/system-settings"
|
||||
|
||||
$DIR/macos-security.sh
|
||||
$DIR/macos-preferences.sh
|
||||
$DIR/macos-apps.sh
|
||||
|
||||
|
@ -13,16 +13,24 @@ module.exports = {
|
||||
{ // Open work non-coding stuff in Chromium
|
||||
browser: "/Applications/Chromium.app",
|
||||
match: [
|
||||
"*zoom.com/*",
|
||||
"google.com/*",
|
||||
"*.google.com/*",
|
||||
"*and-digital.zoom.us/*",
|
||||
"*luna.and-digital.com/*",
|
||||
"*and-digital.okta.com/*",
|
||||
"*and-digital.zoom.us/*",
|
||||
"*atlassian.com/*",
|
||||
"*dev.azure.com/*",
|
||||
"*docs.google.com/*",
|
||||
"*calendar.google.com/*",
|
||||
"*miro.com/*"
|
||||
"*luna.and-digital.com/*",
|
||||
"*miro.com/*",
|
||||
"*zoom.com/*",
|
||||
],
|
||||
},
|
||||
{ // Open coding stuff in Firefox
|
||||
browser: "/Applications/Firefox.app",
|
||||
match: [],
|
||||
},
|
||||
{ // Open personal stuff in Orion
|
||||
browser: "/Applications/Orion.app",
|
||||
match: [],
|
||||
},
|
||||
]
|
||||
};
|
190
system-specific/macos/app-configs/launchpad.yml
Normal file
190
system-specific/macos/app-configs/launchpad.yml
Normal file
@ -0,0 +1,190 @@
|
||||
# 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.
|
||||
# Requires lporg (brew install blacktop/tap/lporg), run `lporg load [file]` to restore layout.
|
||||
|
||||
apps:
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- folder: Dev
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Xcode
|
||||
- Android Studio
|
||||
- Docker
|
||||
- Postman
|
||||
- Boop
|
||||
- Sourcetree
|
||||
- UTM
|
||||
- Visual Studio
|
||||
- folder: Work Coms
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- zoom.us
|
||||
- Slack
|
||||
- Google Chrome
|
||||
- Calendar
|
||||
- Mail
|
||||
- Microsoft Teams
|
||||
- folder: Security
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Wireshark
|
||||
- OWASP ZAP
|
||||
- Burp Suite Community Edition
|
||||
- folder: Media
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- GIMP-2.10
|
||||
- VLC
|
||||
- Transmission
|
||||
- Audacity
|
||||
- OBS
|
||||
- Spotify
|
||||
- Inkscape
|
||||
- Shotcut
|
||||
- calibre
|
||||
- folder: Personal
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Standard Notes
|
||||
- 1Password
|
||||
- VeraCrypt
|
||||
- Tresorit
|
||||
- Proton Mail Bridge
|
||||
- ProtonVPN
|
||||
- GPG Keychain
|
||||
- Signal
|
||||
- Ledger Live
|
||||
- etesync-dav
|
||||
- folder: Mac Mods
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Raycast
|
||||
- Scroll Reverser
|
||||
- Hidden Bar
|
||||
- AltTab
|
||||
- Finicky
|
||||
- Stats
|
||||
- Little Snitch
|
||||
- Espanso
|
||||
- CopyQ
|
||||
- PopClip
|
||||
- OpenInTerminal
|
||||
- AnyBar
|
||||
- Marta
|
||||
- Mjolnir
|
||||
- LinearMouse
|
||||
- Übersicht
|
||||
- Shottr
|
||||
- OnyX
|
||||
- folder: Other
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Shortcuts
|
||||
- QuickTime Player
|
||||
- TextEdit
|
||||
- Grapher
|
||||
- Time Machine
|
||||
- Font Book
|
||||
- Chess
|
||||
- Stickies
|
||||
- Image Capture
|
||||
- VoiceOver Utility
|
||||
- AirPort Utility
|
||||
- Migration Assistant
|
||||
- Terminal
|
||||
- Activity Monitor
|
||||
- Console
|
||||
- Keychain Access
|
||||
- System Information
|
||||
- Automator
|
||||
- Script Editor
|
||||
- Disk Utility
|
||||
- Digital Color Meter
|
||||
- ColorSync Utility
|
||||
- Screenshot
|
||||
- Bluetooth File Exchange
|
||||
- Audio MIDI Setup
|
||||
- Developer
|
||||
- Jabra Firmware Update
|
||||
- Jabra Direct
|
||||
- System Preferences
|
||||
- Calculator
|
||||
- Dictionary
|
||||
- CotEditor
|
||||
- VMware Fusion Tech Preview
|
||||
- TestFlight
|
||||
- Simulator
|
||||
- number: 2
|
||||
items:
|
||||
- Orion
|
||||
- Keka
|
||||
- Mountain Duck
|
||||
- DaisyDisk
|
||||
- folder: Apple Crap
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Contacts
|
||||
- Reminders
|
||||
- Notes
|
||||
- FaceTime
|
||||
- Messages
|
||||
- Maps
|
||||
- Find My
|
||||
- Photo Booth
|
||||
- Photos
|
||||
- Preview
|
||||
- Music
|
||||
- Podcasts
|
||||
- TV
|
||||
- Voice Memos
|
||||
- Numbers
|
||||
- Keynote
|
||||
- Pages
|
||||
- News
|
||||
- Stocks
|
||||
- Books
|
||||
- Siri
|
||||
- App Store
|
||||
- Mission Control
|
||||
- Safari
|
||||
- Home
|
||||
- folder: Corporate Spyware
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Netskope Client
|
||||
- Self Service
|
||||
- Solarwinds Discovery Agent
|
||||
- Sophos Endpoint
|
||||
- Sophos Endpoint Self Help
|
||||
- Sophos Network Extension
|
||||
- Sophos Scan
|
||||
- Remove Sophos Endpoint
|
||||
- Remove Netskope Client
|
||||
- folder: Voldermort
|
||||
pages:
|
||||
- number: 1
|
||||
items:
|
||||
- Google Sheets
|
||||
- Google Slides
|
||||
- Google Docs
|
||||
- Google Drive
|
||||
- Firefox
|
||||
- Chromium
|
||||
- Visual Studio Code
|
||||
- iTerm
|
||||
# widgets:
|
||||
# pages: []
|
||||
# dock_items:
|
||||
# - ============
|
||||
# desktop: {}
|
0
system-specific/macos/app-configs/skhdrc
Normal file
0
system-specific/macos/app-configs/skhdrc
Normal file
8
system-specific/macos/app-configs/yabairc
Normal file
8
system-specific/macos/app-configs/yabairc
Normal file
@ -0,0 +1,8 @@
|
||||
# Set all padding and gaps to 20pt (default: 0)
|
||||
yabai -m config top_padding 20
|
||||
yabai -m config bottom_padding 20
|
||||
yabai -m config left_padding 20
|
||||
yabai -m config right_padding 20
|
||||
yabai -m config window_gap 20
|
||||
|
||||
|
499
system-specific/macos/system-settings/macos-apps.sh
Executable file
499
system-specific/macos/system-settings/macos-apps.sh
Executable file
@ -0,0 +1,499 @@
|
||||
#!/bin/bash
|
||||
|
||||
##############################################################################
|
||||
# Security improvments for Mac OS systems #
|
||||
# Covers Siri, firewall, account security, connections and network protocols #
|
||||
# #
|
||||
# CAUTION: This script will apply changes to your OS X system configuration #
|
||||
# Be sure to read it through carefully, and remove anything you don't want. #
|
||||
# #
|
||||
# Options: #
|
||||
# --silent - Don't log any status outputs #
|
||||
# --skip-intro - Skip the warning and intro section #
|
||||
# --yes-to-all - Don't ptompt user to agree to changes #
|
||||
# #
|
||||
# Licensed under MIT - (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
##############################################################################
|
||||
|
||||
############################################################
|
||||
# Initialize variables, check requirements, and print info #
|
||||
############################################################
|
||||
|
||||
# Record start time
|
||||
start_time=`date +%s`
|
||||
|
||||
# Get params
|
||||
params="$params $*"
|
||||
|
||||
# Color variables
|
||||
PRIMARY_COLOR='\033[1;33m'
|
||||
ACCENT_COLOR='\033[0;34m'
|
||||
INFO_COLOR='\033[0;30m'
|
||||
INFO_COLOR_U='\033[4;30m'
|
||||
SUCCESS_COLOR='\033[0;32m'
|
||||
WARN_1='\033[1;31m'
|
||||
WARN_2='\033[0;31m'
|
||||
RESET_COLOR='\033[0m'
|
||||
|
||||
# Current and total taslks, used for progress updates
|
||||
current_event=0
|
||||
total_events=90
|
||||
|
||||
if [ ! "$(uname -s)" = "Darwin" ]; then
|
||||
echo -e "${PRIMARY_COLOR}Incompatible System${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}This script is specific to Mac OS,\
|
||||
and only intended to be run on Darwin-based systems${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! $params == *"--skip-intro"* ]]; then
|
||||
clear
|
||||
|
||||
# Prints intro message
|
||||
echo -e "${PRIMARY_COLOR} MacOS App Preference Script${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}Settings will be applied to the following apps:"
|
||||
echo -e " - Finder"
|
||||
echo -e " - Safari"
|
||||
echo -e " - Mail App"
|
||||
echo -e " - Terminal"
|
||||
echo -e " - Time Machine"
|
||||
echo -e " - Activity Monitor"
|
||||
echo -e " - Mac App Store"
|
||||
echo -e " - Photos App"
|
||||
echo -e " - Messages App"
|
||||
echo -e " - Chromium"
|
||||
echo -e " - Transmission"
|
||||
# Informs user what they're running, and cautions them to read first
|
||||
echo -e "\n${INFO_COLOR}You are running ${0} on\
|
||||
$(hostname -f | sed -e 's/^[^.]*\.//') as $(id -un)${RESET_COLOR}"
|
||||
echo -e "${WARN_1}IMPORTANT:${WARN_2} This script will make changes to your system."
|
||||
echo -e "${WARN_2}Ensure that you've read it through before continuing.${RESET_COLOR}"
|
||||
|
||||
# Ask for user confirmation before proceeding (if skip flag isn't passed)
|
||||
if [[ ! $params == *"--yes-to-all"* ]]; then
|
||||
echo -e "\n${PRIMARY_COLOR}Would you like to proceed? (y/N)${RESET_COLOR}"
|
||||
read -t 15 -n 1 -r
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${ACCENT_COLOR}\nNo worries, nothing will be applied - feel free to come back another time."
|
||||
echo -e "${PRIMARY_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# Check have got admin privilages
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo -e "${ACCENT_COLOR}\nElevated permissions are required to adjust system settings."
|
||||
echo -e "${PRIMARY_COLOR}Please enter your password...${RESET_COLOR}"
|
||||
script_path=$([[ "$0" = /* ]] && echo "$0" || echo "$PWD/${0#./}")
|
||||
params="--skip-intro ${params}"
|
||||
sudo "$script_path" $params || (
|
||||
echo -e "${ACCENT_COLOR}Unable to continue without sudo permissions"
|
||||
echo -e "${PRIMARY_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 1
|
||||
)
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Helper function to log progress to console
|
||||
function log_msg () {
|
||||
current_event=$(($current_event + 1))
|
||||
if [[ ! $params == *"--silent"* ]]; then
|
||||
if (("$current_event" < 10 )); then sp='0'; else sp=''; fi
|
||||
echo -e "${PRIMARY_COLOR}[${sp}${current_event}/${total_events}] ${ACCENT_COLOR}${1}${INFO_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to log section to console
|
||||
function log_section () {
|
||||
if [[ ! $params == *"--silent"* ]]; then
|
||||
echo -e "${PRIMARY_COLOR}[INFO ] ${1}${INFO_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\n${PRIMARY_COLOR}Starting...${RESET_COLOR}"
|
||||
|
||||
|
||||
|
||||
##########
|
||||
# Finder #
|
||||
##########
|
||||
log_section "Finder"
|
||||
|
||||
log_msg "Open new tabs to Home"
|
||||
defaults write com.apple.finder NewWindowTarget -string "PfHm"
|
||||
|
||||
log_msg "Open new windows to file root"
|
||||
defaults write com.apple.finder NewWindowTargetPath -string "file:///"
|
||||
|
||||
log_msg "Show hidden files"
|
||||
defaults write com.apple.finder AppleShowAllFiles -bool true
|
||||
|
||||
log_msg "Show file extensions"
|
||||
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
|
||||
|
||||
log_msg "Don't ask before emptying trash"
|
||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||
|
||||
log_msg "View all network locations"
|
||||
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
|
||||
|
||||
log_msg "Show the ~/Library folder"
|
||||
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
|
||||
|
||||
log_msg "Show the /Volumes folder"
|
||||
sudo chflags nohidden /Volumes
|
||||
|
||||
log_msg "Allow finder to be fully quitted with ⌘ + Q"
|
||||
defaults write com.apple.finder QuitMenuItem -bool true
|
||||
|
||||
log_msg "Show the status bar in Finder"
|
||||
defaults write com.apple.finder ShowStatusBar -bool true
|
||||
|
||||
log_msg "Show the path bar in finder"
|
||||
defaults write com.apple.finder ShowPathbar -bool true
|
||||
|
||||
log_msg "Display full POSIX path as Finder window title"
|
||||
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
|
||||
|
||||
log_msg "Expand the General, Open and Privlages file info panes"
|
||||
defaults write com.apple.finder FXInfoPanesExpanded -dict \
|
||||
General -bool true \
|
||||
OpenWith -bool true \
|
||||
Privileges -bool true
|
||||
|
||||
|
||||
log_msg "Keep directories at top of search results"
|
||||
defaults write com.apple.finder _FXSortFoldersFirst -bool true
|
||||
|
||||
log_msg "Search current directory by default"
|
||||
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
|
||||
|
||||
log_msg "Don't show warning when changing extension"
|
||||
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
||||
|
||||
log_msg "Don't add .DS_Store to network drives"
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
|
||||
log_msg "Don't add .DS_Store to USB devices"
|
||||
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
|
||||
|
||||
log_msg "Disable disk image verification"
|
||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||
|
||||
log_msg "Open a new Finder window when a volume is mounted"
|
||||
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
|
||||
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
|
||||
|
||||
log_msg "Open a new Finder window when a disk is mounted"
|
||||
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
|
||||
|
||||
log_msg "Show item info"
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
log_msg "Enable snap-to-grid for icons on the desktop and finder"
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
log_msg "Set grid spacing for icons on the desktop and finder"
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
log_msg "Set icon size on desktop and in finder"
|
||||
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
|
||||
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
|
||||
|
||||
########################################
|
||||
# Safari & Webkit Privacy Enchanements #
|
||||
########################################
|
||||
log_section "Safari and Webkit"
|
||||
|
||||
log_msg "Don't send search history to Apple"
|
||||
defaults write com.apple.Safari UniversalSearchEnabled -bool false
|
||||
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
|
||||
|
||||
log_msg "Allow using tab to highlight elements"
|
||||
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
|
||||
|
||||
log_msg "Show full URL"
|
||||
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
|
||||
|
||||
log_msg "Set homepage"
|
||||
defaults write com.apple.Safari HomePage -string "about:blank"
|
||||
|
||||
log_msg "Don't open downloaded files automatically"
|
||||
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
|
||||
|
||||
log_msg "Hide favorites bar"
|
||||
defaults write com.apple.Safari ShowFavoritesBar -bool false
|
||||
|
||||
log_msg "Hide sidebar"
|
||||
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
|
||||
|
||||
log_msg "Disable thumbnail cache"
|
||||
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
|
||||
|
||||
log_msg "Enable debug menu"
|
||||
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
||||
|
||||
log_msg "Search feature matches any part of word"
|
||||
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
||||
|
||||
log_msg "Remove unneeded icons from bookmarks bar"
|
||||
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
|
||||
|
||||
log_msg "Enable developer options"
|
||||
defaults write com.apple.Safari IncludeDevelopMenu -bool true
|
||||
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
|
||||
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
||||
|
||||
log_msg "Enable spell check"
|
||||
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true
|
||||
|
||||
log_msg "Disable auto-correct"
|
||||
defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false
|
||||
|
||||
log_msg "Disable auto-fill addressess"
|
||||
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
|
||||
|
||||
log_msg "Disable auto-fill passwords"
|
||||
defaults write com.apple.Safari AutoFillPasswords -bool false
|
||||
|
||||
log_msg "Disable auto-fill credit cards"
|
||||
defaults write com.apple.Safari AutoFillCreditCardData -bool false
|
||||
|
||||
log_msg "Disable auto-fill misc forms"
|
||||
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false
|
||||
|
||||
log_msg "Enable fraud warnings"
|
||||
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
|
||||
|
||||
log_msg "Disable web plugins"
|
||||
defaults write com.apple.Safari WebKitPluginsEnabled -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false
|
||||
|
||||
log_msg "Disable Java"
|
||||
defaults write com.apple.Safari WebKitJavaEnabled -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles -bool false
|
||||
|
||||
log_msg "Prevent pop-ups"
|
||||
defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false
|
||||
|
||||
log_msg "Dissallow auto-play"
|
||||
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
|
||||
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
|
||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
|
||||
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
|
||||
|
||||
log_msg "Use Do not Track header"
|
||||
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
|
||||
|
||||
log_msg "Auto-update Extensions"
|
||||
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
|
||||
|
||||
##################
|
||||
# Apple Mail App #
|
||||
##################
|
||||
log_section "Apple Mail App"
|
||||
|
||||
log_msg "Copy only email address, not name"
|
||||
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
|
||||
|
||||
log_msg "Use ⌘ + Enter shortcut to quick send emails"
|
||||
defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\U21a9"
|
||||
|
||||
log_msg "Display messages in thread mode"
|
||||
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
|
||||
|
||||
log_msg "Sort messages by date"
|
||||
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
|
||||
|
||||
log_msg "Sort by newest to oldest"
|
||||
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
|
||||
|
||||
log_msg "Disable inline attatchment viewing"
|
||||
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
|
||||
|
||||
################
|
||||
# Terminal App #
|
||||
################
|
||||
log_section "Terminal App"
|
||||
|
||||
log_msg "Set Terminal to only use UTF-8"
|
||||
defaults write com.apple.terminal StringEncodings -array 4
|
||||
|
||||
log_msg "Enable secure entry for Terminal"
|
||||
defaults write com.apple.terminal SecureKeyboardEntry -bool true
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Time Machine #
|
||||
###############################################################################
|
||||
log_section "Time Machine"
|
||||
|
||||
log_msg "Prevent Time Machine prompting to use new drive as backup"
|
||||
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
|
||||
|
||||
log_msg "Disable local Time Machine backups"
|
||||
hash tmutil &> /dev/null && sudo tmutil disablelocal
|
||||
|
||||
###############################################################################
|
||||
# Activity Monitor #
|
||||
###############################################################################
|
||||
log_section "Activity Monitor"
|
||||
|
||||
log_msg "Show the main window when launching Activity Monitor"
|
||||
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
|
||||
|
||||
log_msg "Visualize CPU usage in the Activity Monitor Dock icon"
|
||||
defaults write com.apple.ActivityMonitor IconType -int 5
|
||||
|
||||
log_msg "Show all processes in Activity Monitor"
|
||||
defaults write com.apple.ActivityMonitor ShowCategory -int 0
|
||||
|
||||
log_msg "Sort results by CPU usage"
|
||||
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
|
||||
defaults write com.apple.ActivityMonitor SortDirection -int 0
|
||||
|
||||
###################
|
||||
# Apple Mac Store #
|
||||
###################
|
||||
log_section "Apple Mac Store"
|
||||
|
||||
log_msg "Allow automatic update checks"
|
||||
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
|
||||
|
||||
log_msg "Auto install criticial security updates"
|
||||
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
|
||||
|
||||
log_msg "Enable the debug menu"
|
||||
defaults write com.apple.appstore ShowDebugMenu -bool true
|
||||
|
||||
log_msg "Enable extra dev tools"
|
||||
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
|
||||
|
||||
####################
|
||||
# Apple Photos App #
|
||||
####################
|
||||
log_section "Apple Photos App"
|
||||
|
||||
log_msg "Prevent Photos from opening automatically when devices are plugged in"
|
||||
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
|
||||
|
||||
######################
|
||||
# Apple Messages App #
|
||||
######################
|
||||
log_section "Apple Messages App"
|
||||
|
||||
log_msg "Disable automatic emoji substitution"
|
||||
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
|
||||
|
||||
log_msg "Disable smart quotes"
|
||||
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
|
||||
|
||||
#############################################################
|
||||
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
|
||||
#############################################################
|
||||
log_section "Address Book, Calendar, TextEdit"
|
||||
|
||||
log_msg "Enable the debug menu in Address Book"
|
||||
defaults write com.apple.addressbook ABShowDebugMenu -bool true
|
||||
|
||||
log_msg "Enable Dashboard dev mode"
|
||||
defaults write com.apple.dashboard devmode -bool true
|
||||
|
||||
log_msg "Use plaintext for new text documents"
|
||||
defaults write com.apple.TextEdit RichText -int 0
|
||||
|
||||
log_msg "Use UTF-8 for opening text files"
|
||||
defaults write com.apple.TextEdit PlainTextEncoding -int 4
|
||||
|
||||
log_msg "Use UTF-8 for saving text files"
|
||||
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
|
||||
|
||||
log_msg "Enable the debug menu in Disk Utility"
|
||||
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
|
||||
defaults write com.apple.DiskUtility advanced-image-options -bool true
|
||||
|
||||
log_msg "Auto-play videos when opened with QuickTime Player"
|
||||
defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true
|
||||
|
||||
########################################
|
||||
# Google Chrome & Google Chrome Canary #
|
||||
########################################
|
||||
log_section "Chromium"
|
||||
|
||||
log_msg "Use the system-native print preview dialog"
|
||||
defaults write com.google.Chrome DisablePrintPreview -bool true
|
||||
defaults write com.google.Chrome.canary DisablePrintPreview -bool true
|
||||
|
||||
log_msg "Expand the print dialog by default"
|
||||
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
|
||||
defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true
|
||||
|
||||
####################
|
||||
# Transmission.app #
|
||||
####################
|
||||
log_section "Transmission"
|
||||
|
||||
log_msg "Store incomplete downloads in the Downloads/torrents dir"
|
||||
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
|
||||
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
|
||||
|
||||
log_msg "Store completed downloads in Downloads directory"
|
||||
defaults write org.m0k.transmission DownloadLocationConstant -bool true
|
||||
|
||||
log_msg "Dont prompt for confirmation before downloading"
|
||||
defaults write org.m0k.transmission DownloadAsk -bool false
|
||||
defaults write org.m0k.transmission MagnetOpenAsk -bool false
|
||||
|
||||
log_msg "No confirmation before removing non-downloading transfers"
|
||||
defaults write org.m0k.transmission CheckRemoveDownloading -bool true
|
||||
|
||||
log_msg "Trash original torrents"
|
||||
defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
|
||||
|
||||
log_msg "Hide the donate message"
|
||||
defaults write org.m0k.transmission WarningDonate -bool false
|
||||
|
||||
log_msg "Hide the legal disclaimer"
|
||||
defaults write org.m0k.transmission WarningLegal -bool false
|
||||
|
||||
log_msg "Set IP blocklists"
|
||||
defaults write org.m0k.transmission BlocklistNew -bool true
|
||||
defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz"
|
||||
defaults write org.m0k.transmission BlocklistAutoUpdate -bool true
|
||||
|
||||
log_msg "Randomize port on launch"
|
||||
defaults write org.m0k.transmission RandomPort -bool true
|
||||
|
||||
#####################################
|
||||
# Print finishing message, and exit #
|
||||
#####################################
|
||||
echo -e "${PRIMARY_COLOR}\nFinishing...${RESET_COLOR}"
|
||||
echo -e "${SUCCESS_COLOR}✔ ${current_event}/${total_events} tasks were completed \
|
||||
succesfully in $((`date +%s`-start_time)) seconds${RESET_COLOR}"
|
||||
echo -e "\n${PRIMARY_COLOR} .:'\n __ :'__\n .'\`__\`-'__\`\`.\n \
|
||||
:__________.-'\n :_________:\n :_________\`-;\n \`.__.-.__.'\n${RESET_COLOR}"
|
||||
|
||||
if [[ ! $params == *"--quick-exit"* ]]; then
|
||||
echo -e "${ACCENT_COLOR}Press any key to continue.${RESET_COLOR}"
|
||||
read -t 5 -n 1 -s
|
||||
fi
|
||||
exit 0
|
463
system-specific/macos/system-settings/macos-preferences.sh
Executable file
463
system-specific/macos/system-settings/macos-preferences.sh
Executable file
@ -0,0 +1,463 @@
|
||||
#!/bin/bash
|
||||
|
||||
##############################################################################
|
||||
# Applies MacOS settings and preferences in /Library/Preferences #
|
||||
# Covers Spotlight, layout, colors, fonts, mouse, keyboard and shortcuts #
|
||||
# #
|
||||
# CAUTION: This script will apply changes to your OS X system configuration #
|
||||
# Be sure to read it through carefully, and remove anything you don't want. #
|
||||
# #
|
||||
# Options: #
|
||||
# --silent - Don't log any status outputs #
|
||||
# --skip-intro - Skip the warning and intro section #
|
||||
# --yes-to-all - Don't ptompt user to agree to changes #
|
||||
# #
|
||||
# Licensed under MIT - (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
##############################################################################
|
||||
|
||||
############################################################
|
||||
# Initialize variables, check requirements, and print info #
|
||||
############################################################
|
||||
|
||||
# Record start time
|
||||
start_time=`date +%s`
|
||||
|
||||
# Get params
|
||||
params="$params $*"
|
||||
|
||||
# Color variables
|
||||
PRIMARY_COLOR='\033[1;33m'
|
||||
ACCENT_COLOR='\033[0;34m'
|
||||
INFO_COLOR='\033[0;30m'
|
||||
INFO_COLOR_U='\033[4;30m'
|
||||
SUCCESS_COLOR='\033[0;32m'
|
||||
WARN_1='\033[1;31m'
|
||||
WARN_2='\033[0;31m'
|
||||
RESET_COLOR='\033[0m'
|
||||
|
||||
# Current and total taslks, used for progress updates
|
||||
current_event=0
|
||||
total_events=68
|
||||
|
||||
# Check system is compatible
|
||||
if [ ! "$(uname -s)" = "Darwin" ]; then
|
||||
echo -e "${PRIMARY_COLOR}Incompatible System${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}This script is specific to Mac OS,\
|
||||
and only intended to be run on Darwin-based systems${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Print info, and prompt for confrimation
|
||||
if [[ ! $params == *"--skip-intro"* ]]; then
|
||||
# Output what stuff will be updated
|
||||
echo -e "${PRIMARY_COLOR} MacOS User Preferences${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}The following sections will be executed:"
|
||||
echo -e " - Device info"
|
||||
echo -e " - Localization"
|
||||
echo -e " - UI Settings"
|
||||
echo -e " - Opening, saving and printing files"
|
||||
echo -e " - System power and lock screen options"
|
||||
echo -e " - Sound and display quality"
|
||||
echo -e " - Keyboard and input"
|
||||
echo -e " - Mouse and trackpad"
|
||||
echo -e " - Spotlight and search"
|
||||
echo -e " - Dock and Launchpad"
|
||||
|
||||
# Inform user what they're running, and cautions them to read first
|
||||
echo -e "\n${INFO_COLOR}You are running ${0} on\
|
||||
$(hostname -f | sed -e 's/^[^.]*\.//') as $(id -un)${RESET_COLOR}"
|
||||
echo -e "${WARN_1}IMPORTANT:${WARN_2} This script will make changes to your system.\
|
||||
Ensure you've read it through before continuing${RESET_COLOR}"
|
||||
|
||||
# Ask for user confirmation before proceeding (if skip flag isn't passed)
|
||||
if [[ ! $params == *"--yes-to-all"* ]]; then
|
||||
echo -e "\n${PRIMARY_COLOR}Would you like to proceed? (y/N)${RESET_COLOR}"
|
||||
read -t 15 -n 1 -r
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${ACCENT_COLOR}\nNo worries, nothing will be applied - feel free to come back another time."
|
||||
echo -e "${PRIMARY_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check have got admin privilages
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo -e "${ACCENT_COLOR}\nElevated permissions are required to adjust system settings."
|
||||
echo -e "${PRIMARY_COLOR}Please enter your password...${RESET_COLOR}"
|
||||
script_path=$([[ "$0" = /* ]] && echo "$0" || echo "$PWD/${0#./}")
|
||||
params="--skip-intro ${params}"
|
||||
sudo "$script_path" $params || (
|
||||
echo -e "${ACCENT_COLOR}Unable to continue without sudo permissions"
|
||||
echo -e "${PRIMARY_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 1
|
||||
)
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Helper function to log progress to console
|
||||
function log_msg () {
|
||||
current_event=$(($current_event + 1))
|
||||
if [[ ! $params == *"--silent"* ]]; then
|
||||
if (("$current_event" < 10 )); then sp='0'; else sp=''; fi
|
||||
echo -e "${PRIMARY_COLOR}[${sp}${current_event}/${total_events}] ${ACCENT_COLOR}${1}${INFO_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to log section to console
|
||||
function log_section () {
|
||||
if [[ ! $params == *"--silent"* ]]; then
|
||||
echo -e "${PRIMARY_COLOR}[INFO ] ${1}${INFO_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\n${PRIMARY_COLOR}Starting...${RESET_COLOR}"
|
||||
|
||||
# Vzariables for system preferences
|
||||
COMPUTER_NAME="AS-AND-MacBook"
|
||||
HIGHLIGHT_COLOR="0 0.8 0.7"
|
||||
|
||||
# Quit System Preferences before starting
|
||||
osascript -e 'tell application "System Preferences" to quit'
|
||||
|
||||
###################
|
||||
# Set Device Info #
|
||||
###################
|
||||
log_section "Device Info"
|
||||
|
||||
# Set computer name and hostname
|
||||
log_msg "Set computer name"
|
||||
sudo scutil --set ComputerName "$COMPUTER_NAME"
|
||||
|
||||
log_msg "Set remote hostname"
|
||||
sudo scutil --set HostName "$COMPUTER_NAME"
|
||||
|
||||
log_msg "Set local hostname"
|
||||
sudo scutil --set LocalHostName "$COMPUTER_NAME"
|
||||
|
||||
log_msg "Set SMB hostname"
|
||||
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "$COMPUTER_NAME"
|
||||
|
||||
############################
|
||||
# Location and locale info #
|
||||
############################
|
||||
log_section "Local Preferences"
|
||||
|
||||
log_msg "Set language to English"
|
||||
defaults write NSGlobalDomain AppleLanguages -array "en"
|
||||
|
||||
log_msg "Set locale to British"
|
||||
defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=GBP"
|
||||
|
||||
log_msg "Set time zone to London"
|
||||
sudo systemsetup -settimezone "Europe/London" > /dev/null
|
||||
|
||||
log_msg "Set units to metric"
|
||||
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
|
||||
defaults write NSGlobalDomain AppleMetricUnits -bool true
|
||||
|
||||
###############
|
||||
# UI Settings #
|
||||
###############
|
||||
log_section "UI Settings"
|
||||
|
||||
# Set highlight color
|
||||
log_msg "Set text highlight color"
|
||||
defaults write NSGlobalDomain AppleHighlightColor -string "${HIGHLIGHT_COLOR}"
|
||||
|
||||
##################
|
||||
# File Locations #
|
||||
##################
|
||||
log_section "File Locations"
|
||||
|
||||
log_msg "Set location to save screenshots to"
|
||||
defaults write com.apple.screencapture location -string "${HOME}/Downloads/screenshots"
|
||||
|
||||
log_msg "Save screenshots in .png format"
|
||||
defaults write com.apple.screencapture type -string "png"
|
||||
|
||||
###############################################
|
||||
# Saving, Opening, Printing and Viewing Files #
|
||||
###############################################
|
||||
log_section "Opening, Saving and Printing Files"
|
||||
|
||||
log_msg "Set scrollbar to always show"
|
||||
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
|
||||
|
||||
log_msg "Set sidebar icon size to medium"
|
||||
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
|
||||
|
||||
log_msg "Set toolbar title rollover delay"
|
||||
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0
|
||||
|
||||
log_msg "Set increased window resize speed"
|
||||
defaults write NSGlobalDomain NSWindowResizeTime -float 0.05
|
||||
|
||||
log_msg "Set file save dialog to expand to all files by default"
|
||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
|
||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
|
||||
|
||||
log_msg "Set print dialog to expand to show all by default"
|
||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
|
||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
|
||||
|
||||
log_msg "Set files to save to disk, not iCloud by default"
|
||||
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
|
||||
|
||||
log_msg "Set printer app to quit once job is completed"
|
||||
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
|
||||
|
||||
log_msg "Disables the app opening confirmation dialog"
|
||||
defaults write com.apple.LaunchServices LSQuarantine -bool false
|
||||
|
||||
log_msg "Remove duplicates in the Open With menu"
|
||||
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \
|
||||
-kill -r -domain local -domain system -domain user
|
||||
|
||||
log_msg "Show ASCII control characters using caret notation in text views"
|
||||
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
|
||||
|
||||
#####################################
|
||||
# System Power, Resuming, Lock, etc #
|
||||
#####################################
|
||||
log_section "System Power and Lock Screen"
|
||||
|
||||
log_msg "Disable waking on lid opening"
|
||||
sudo pmset -a lidwake 1
|
||||
|
||||
log_msg "Prevent automatic restart when power restored"
|
||||
sudo pmset -a autorestart 1
|
||||
|
||||
log_msg "Set display to sleep after 15 minutes"
|
||||
sudo pmset -a displaysleep 15
|
||||
|
||||
log_msg "Set sysyem sleep time to 30 minutes when on battery"
|
||||
sudo pmset -b sleep 30
|
||||
|
||||
log_msg "Set system to not sleep automatically when on mains power"
|
||||
sudo pmset -c sleep 0
|
||||
|
||||
log_msg "Require password immediatley after sleep or screensaver"
|
||||
defaults write com.apple.screensaver askForPassword -int 1
|
||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
||||
|
||||
log_msg "Disable system wide resuming of windows"
|
||||
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
|
||||
|
||||
log_msg "Disable auto termination of inactive apps"
|
||||
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
|
||||
|
||||
log_msg "Disable the crash reporter"
|
||||
defaults write com.apple.CrashReporter DialogType -string "none"
|
||||
|
||||
log_msg "Add host info to the login screen"
|
||||
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
|
||||
|
||||
##############################
|
||||
# Sound and Display Settings #
|
||||
##############################
|
||||
log_section "Sound and Display"
|
||||
|
||||
log_msg "Increase sound quality for Bluetooth devivces"
|
||||
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
|
||||
|
||||
log_msg "Enable subpixel font rendering on non-Apple LCDs"
|
||||
defaults write NSGlobalDomain AppleFontSmoothing -int 1
|
||||
|
||||
log_msg "Enable HiDPI display modes"
|
||||
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
|
||||
|
||||
########################
|
||||
# Keyboard, Text Input #
|
||||
########################
|
||||
log_section "Keyboard and Input"
|
||||
|
||||
log_msg "Disable automatic text capitalization"
|
||||
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
|
||||
|
||||
log_msg "Disable automatic dash substitution"
|
||||
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
|
||||
|
||||
log_msg "Disable automatic periord substitution"
|
||||
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
|
||||
|
||||
log_msg "Disable automatic period substitution"
|
||||
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
|
||||
|
||||
log_msg "Disable automatic spell correction"
|
||||
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
||||
|
||||
log_msg "Enable full keyboard navigation in all windows"
|
||||
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
||||
|
||||
log_msg "Allow modifier key to be used for mouse zooming"
|
||||
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
|
||||
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
|
||||
|
||||
log_msg "Follow the keyboard focus while zoomed in"
|
||||
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
|
||||
|
||||
log_msg "Set time before keys start repeating"
|
||||
defaults write NSGlobalDomain InitialKeyRepeat -int 50
|
||||
|
||||
log_msg "Set super fast key repeat rate"
|
||||
defaults write NSGlobalDomain KeyRepeat -int 8
|
||||
|
||||
log_msg "Fix UTF-8 bug in QuickLook"
|
||||
echo "0x08000100:0" > ~/.CFUserTextEncoding
|
||||
|
||||
#####################################
|
||||
# Mouse, Trackpad, Pointing Devices #
|
||||
#####################################
|
||||
log_section "Mouse and Trackpad"
|
||||
|
||||
log_msg "Enable tap to click for trackpad"
|
||||
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
|
||||
|
||||
log_msg "Enable tab to click for current user"
|
||||
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
|
||||
|
||||
log_msg "Enable tap to click for the login screen"
|
||||
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
|
||||
|
||||
log_msg "Set hot corners for trackpad"
|
||||
defaults write com.apple.dock wvous-tl-corner -int 11
|
||||
defaults write com.apple.dock wvous-tl-modifier -int 0
|
||||
defaults write com.apple.dock wvous-bl-corner -int 2
|
||||
defaults write com.apple.dock wvous-bl-modifier -int 1048576
|
||||
defaults write com.apple.dock wvous-br-corner -int 5
|
||||
defaults write com.apple.dock wvous-br-modifier -int 1048576
|
||||
defaults write com.apple.dock wvous-tr-corner -int 0
|
||||
defaults write com.apple.dock wvous-tr-modifier -int 0
|
||||
|
||||
# ##############################
|
||||
# Spotlight Search Preferences #
|
||||
# ##############################
|
||||
log_section "Spotlight and Search"
|
||||
|
||||
# Emable / disable search locations, and indexing order
|
||||
log_msg "Set Spotlight Search Locations Order"
|
||||
defaults write com.apple.spotlight orderedItems -array \
|
||||
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
|
||||
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
|
||||
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
|
||||
'{"enabled" = 1;"name" = "PDF";}' \
|
||||
'{"enabled" = 0;"name" = "FONTS";}' \
|
||||
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
|
||||
'{"enabled" = 0;"name" = "MESSAGES";}' \
|
||||
'{"enabled" = 0;"name" = "CONTACT";}' \
|
||||
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
|
||||
'{"enabled" = 0;"name" = "IMAGES";}' \
|
||||
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
|
||||
'{"enabled" = 0;"name" = "MUSIC";}' \
|
||||
'{"enabled" = 0;"name" = "MOVIES";}' \
|
||||
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
|
||||
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
|
||||
'{"enabled" = 0;"name" = "SOURCE";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_DEFINITION";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_OTHER";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
|
||||
'{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
|
||||
|
||||
# Spotlight - load new settings, enable indexing, and rebuild index
|
||||
log_msg "Refreshing Spotlight"
|
||||
killall mds > /dev/null 2>&1
|
||||
sudo mdutil -i on / > /dev/null
|
||||
sudo mdutil -E / > /dev/null
|
||||
|
||||
###############################
|
||||
# Dock and Launchpad Settings #
|
||||
###############################
|
||||
log_section "Dock and Launchpad"
|
||||
|
||||
log_msg "Add highlight effect to dock stacks"
|
||||
defaults write com.apple.dock mouse-over-hilite-stack -bool true
|
||||
|
||||
log_msg "Set item size within dock stacks"
|
||||
defaults write com.apple.dock tilesize -int 24
|
||||
|
||||
log_msg "Set dock to use genie animation"
|
||||
defaults write com.apple.dock mineffect -string "genie"
|
||||
|
||||
log_msg "Set apps to minimize into their dock icon"
|
||||
defaults write com.apple.dock minimize-to-application -bool true
|
||||
|
||||
log_msg "Enable spring loading, for opening files by dragging to dock"
|
||||
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
|
||||
|
||||
log_msg "Enable process indicator for apps within dock"
|
||||
defaults write com.apple.dock show-process-indicators -bool true
|
||||
|
||||
log_msg "Enable app launching animations"
|
||||
defaults write com.apple.dock launchanim -bool true
|
||||
|
||||
log_msg "Set opening animation speed"
|
||||
defaults write com.apple.dock expose-animation-duration -float 1
|
||||
|
||||
log_msg "Disable auntomatic rearanging of spaces"
|
||||
defaults write com.apple.dock mru-spaces -bool false
|
||||
|
||||
log_msg "Set dock to auto-hide by default"
|
||||
defaults write com.apple.dock autohide -bool true
|
||||
|
||||
log_msg "Set the dock's auto-hide delay to fast"
|
||||
defaults write com.apple.dock autohide-delay -float 0.05
|
||||
|
||||
log_msg "Set the dock show / hide animation time"
|
||||
defaults write com.apple.dock autohide-time-modifier -float 0.25
|
||||
|
||||
log_msg "Show which dock apps are hidden"
|
||||
defaults write com.apple.dock showhidden -bool true
|
||||
|
||||
log_msg "Hide recent files from the dock"
|
||||
defaults write com.apple.dock show-recents -bool false
|
||||
|
||||
# If DockUtil installed, then use it to remove default dock items, and add useful ones
|
||||
if hash dockutil 2> /dev/null; then
|
||||
apps_to_remove_from_dock=(
|
||||
'App Store' 'Calendar' 'Contacts' 'FaceTime'
|
||||
'Keynote' 'Mail' 'Maps' 'Messages' 'Music'
|
||||
'News' 'Notes' 'Numbers'
|
||||
'Pages' 'Photos' 'Podcasts'
|
||||
'Reminders' 'TV'
|
||||
)
|
||||
apps_to_add_to_dock=(
|
||||
'iTerm' 'Firefox' 'Standard Notes' 'Visual Studio Code'
|
||||
)
|
||||
IFS=""
|
||||
# Removes useless apps from dock
|
||||
for app in ${apps_to_remove_from_dock[@]}; do
|
||||
dockutil --remove ~/Applications/${app}.app
|
||||
done
|
||||
# Adds useful apps to dock, if installed
|
||||
for app in ${apps_to_add_to_dock[@]}; do
|
||||
if [[ -d "~/Applications/${app}.app" ]]; then
|
||||
dockutil --add ~/Applications/${app}.app
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
log_msg "Add iOS Simulator to Launchpad"
|
||||
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app" "/Applications/Simulator.app"
|
||||
|
||||
log_msg "Add Apple Watch simulator to Launchpad"
|
||||
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator (Watch).app" "/Applications/Simulator (Watch).app"
|
||||
|
||||
|
||||
#####################################
|
||||
# Print finishing message, and exit #
|
||||
#####################################
|
||||
echo -e "${PRIMARY_COLOR}\nFinishing...${RESET_COLOR}"
|
||||
echo -e "${SUCCESS_COLOR}✔ ${current_event}/${total_events} tasks were completed \
|
||||
succesfully in $((`date +%s`-start_time)) seconds${RESET_COLOR}"
|
||||
echo -e "\n${PRIMARY_COLOR} .:'\n __ :'__\n .'\`__\`-'__\`\`.\n \
|
||||
:__________.-'\n :_________:\n :_________\`-;\n \`.__.-.__.'\n${RESET_COLOR}"
|
||||
|
||||
if [[ ! $params == *"--quick-exit"* ]]; then
|
||||
echo -e "${ACCENT_COLOR}Press any key to continue.${RESET_COLOR}"
|
||||
read -t 5 -n 1 -s
|
||||
fi
|
||||
exit 0
|
272
system-specific/macos/system-settings/macos-security.sh
Executable file
272
system-specific/macos/system-settings/macos-security.sh
Executable file
@ -0,0 +1,272 @@
|
||||
#!/bin/bash
|
||||
|
||||
##############################################################################
|
||||
# Security improvments for Mac OS systems #
|
||||
# Covers Siri, firewall, account security, connections and network protocols #
|
||||
# #
|
||||
# CAUTION: This script will apply changes to your OS X system configuration #
|
||||
# Be sure to read it through carefully, and remove anything you don't want. #
|
||||
# #
|
||||
# Options: #
|
||||
# --silent - Don't log any status outputs #
|
||||
# --skip-intro - Skip the warning and intro section #
|
||||
# --yes-to-all - Don't ptompt user to agree to changes #
|
||||
# #
|
||||
# Licensed under MIT - (C) Alicia Sykes 2022 <https://aliciasykes.com> #
|
||||
##############################################################################
|
||||
|
||||
############################################################
|
||||
# Initialize variables, check requirements, and print info #
|
||||
############################################################
|
||||
|
||||
# Record start time
|
||||
start_time=`date +%s`
|
||||
|
||||
# Get params
|
||||
params="$params $*"
|
||||
|
||||
# Color variables
|
||||
PRIMARY_COLOR='\033[1;33m'
|
||||
ACCENT_COLOR='\033[0;34m'
|
||||
INFO_COLOR='\033[0;30m'
|
||||
INFO_COLOR_U='\033[4;30m'
|
||||
SUCCESS_COLOR='\033[0;32m'
|
||||
WARN_1='\033[1;31m'
|
||||
WARN_2='\033[0;31m'
|
||||
RESET_COLOR='\033[0m'
|
||||
|
||||
# Current and total taslks, used for progress updates
|
||||
current_event=0
|
||||
total_events=25
|
||||
|
||||
if [ ! "$(uname -s)" = "Darwin" ]; then
|
||||
echo -e "${PRIMARY_COLOR}Incompatible System${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}This script is specific to Mac OS,\
|
||||
and only intended to be run on Darwin-based systems${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! $params == *"--skip-intro"* ]]; then
|
||||
# Prints intro message
|
||||
echo -e "${PRIMARY_COLOR} MacOS Security Settings${RESET_COLOR}"
|
||||
echo -e "${ACCENT_COLOR}The following options will be applied:"
|
||||
echo -e " - Disabling Siri and voice feedback"
|
||||
echo -e " - Configures firewall for security"
|
||||
echo -e " - Apply login + screen security settings"
|
||||
echo -e " - Prevent unauthorised connections"
|
||||
echo -e " - Disable printer and sharing protocols"
|
||||
|
||||
# Informs user what they're running, and cautions them to read first
|
||||
echo -e "\n${INFO_COLOR}You are running ${0} on\
|
||||
$(hostname -f | sed -e 's/^[^.]*\.//') as $(id -un)${RESET_COLOR}"
|
||||
echo -e "${WARN_1}IMPORTANT:${WARN_2} This script will make changes to your system."
|
||||
echo -e "${WARN_2}Ensure that you've read it through before continuing.${RESET_COLOR}"
|
||||
|
||||
# Ask for user confirmation before proceeding (if skip flag isn't passed)
|
||||
if [[ ! $params == *"--yes-to-all"* ]]; then
|
||||
echo -e "\n${PRIMARY_COLOR}Would you like to proceed? (y/N)${RESET_COLOR}"
|
||||
read -t 15 -n 1 -r
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${ACCENT_COLOR}\nNo worries, nothing will be applied - feel free to come back another time."
|
||||
echo -e "${PRIMARY_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# Check have got admin privilages
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo -e "${ACCENT_COLOR}\nElevated permissions are required to adjust system settings."
|
||||
echo -e "${PRIMARY_COLOR}Please enter your password...${RESET_COLOR}"
|
||||
script_path=$([[ "$0" = /* ]] && echo "$0" || echo "$PWD/${0#./}")
|
||||
params="--skip-intro ${params}"
|
||||
sudo "$script_path" $params || (
|
||||
echo -e "${ACCENT_COLOR}Unable to continue without sudo permissions"
|
||||
echo -e "${PRIMARY_COLOR}Exiting...${RESET_COLOR}"
|
||||
exit 1
|
||||
)
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Helper function to log progress to console
|
||||
function log_msg () {
|
||||
current_event=$(($current_event + 1))
|
||||
if [[ ! $params == *"--silent"* ]]; then
|
||||
if (("$current_event" < 10 )); then sp='0'; else sp=''; fi
|
||||
echo -e "${PRIMARY_COLOR}[${sp}${current_event}/${total_events}] ${ACCENT_COLOR}${1}${INFO_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to log section to console
|
||||
function log_section () {
|
||||
if [[ ! $params == *"--silent"* ]]; then
|
||||
echo -e "${PRIMARY_COLOR}[INFO ] ${1}${INFO_COLOR}"
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\n${PRIMARY_COLOR}Starting...${RESET_COLOR}"
|
||||
|
||||
# Quit System Preferences before starting
|
||||
osascript -e 'tell application "System Preferences" to quit'
|
||||
|
||||
# ######################################
|
||||
# Disabling Siri and related features #
|
||||
# ######################################
|
||||
log_section "Disable Assistant Features"
|
||||
|
||||
# Disable Ask Siri
|
||||
log_msg "Disable 'Ask Siri'"
|
||||
defaults write com.apple.assistant.support 'Assistant Enabled' -bool false
|
||||
|
||||
# Disable Siri voice feedback
|
||||
log_msg "Disable Siri voice feedback"
|
||||
defaults write com.apple.assistant.backedup 'Use device speaker for TTS' -int 3
|
||||
|
||||
# Disable Siri services (Siri and assistantd)
|
||||
log_msg "Disable Siri services (Siri and assistantd)"
|
||||
launchctl disable "user/$UID/com.apple.assistantd"
|
||||
launchctl disable "gui/$UID/com.apple.assistantd"
|
||||
sudo launchctl disable 'system/com.apple.assistantd'
|
||||
launchctl disable "user/$UID/com.apple.Siri.agent"
|
||||
launchctl disable "gui/$UID/com.apple.Siri.agent"
|
||||
sudo launchctl disable 'system/com.apple.Siri.agent'
|
||||
if [ $(/usr/bin/csrutil status | awk '/status/ {print $5}' | sed 's/\.$//') = "enabled" ]; then
|
||||
>&2 echo 'This script requires SIP to be disabled. Read more: \
|
||||
https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection'
|
||||
fi
|
||||
|
||||
# Disable "Do you want to enable Siri?" pop-up
|
||||
log_msg "Disable 'Do you want to enable Siri?' pop-up"
|
||||
defaults write com.apple.SetupAssistant 'DidSeeSiriSetup' -bool True
|
||||
|
||||
# Hide Siri from menu bar
|
||||
log_msg "Hide Siri from menu bar"
|
||||
defaults write com.apple.systemuiserver 'NSStatusItem Visible Siri' 0
|
||||
|
||||
# Hide Siri from status menu
|
||||
log_msg "Hide Siri from status menu"
|
||||
defaults write com.apple.Siri 'StatusMenuVisible' -bool false
|
||||
defaults write com.apple.Siri 'UserHasDeclinedEnable' -bool true
|
||||
|
||||
# Opt-out from Siri data collection
|
||||
log_msg "Opt-out from Siri data collection"
|
||||
defaults write com.apple.assistant.support 'Siri Data Sharing Opt-In Status' -int 2
|
||||
|
||||
|
||||
############################
|
||||
# MacOS Firefwall Security #
|
||||
############################
|
||||
log_section "Firewall Config"
|
||||
|
||||
# Prevent automatically allowing incoming connections to signed apps
|
||||
log_msg "Prevent automatically allowing incoming connections to signed apps"
|
||||
sudo defaults write /Library/Preferences/com.apple.alf allowsignedenabled -bool false
|
||||
|
||||
# Prevent automatically allowing incoming connections to downloaded signed apps
|
||||
log_msg "Prevent automatically allowing incoming connections to downloaded signed apps"
|
||||
sudo defaults write /Library/Preferences/com.apple.alf allowdownloadsignedenabled -bool false
|
||||
|
||||
# Enable application firewall
|
||||
log_msg "Enable application firewall"
|
||||
/usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
|
||||
sudo defaults write /Library/Preferences/com.apple.alf globalstate -bool true
|
||||
defaults write com.apple.security.firewall EnableFirewall -bool true
|
||||
|
||||
# Turn on firewall logging
|
||||
log_msg "Turn on firewall logging"
|
||||
/usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on
|
||||
sudo defaults write /Library/Preferences/com.apple.alf loggingenabled -bool true
|
||||
|
||||
# Turn on stealth mode
|
||||
log_msg "Turn on stealth mode"
|
||||
/usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on
|
||||
sudo defaults write /Library/Preferences/com.apple.alf stealthenabled -bool true
|
||||
defaults write com.apple.security.firewall EnableStealthMode -bool true
|
||||
|
||||
|
||||
####################################
|
||||
# Log In and User Account Security #
|
||||
####################################
|
||||
log_section "Account Security"
|
||||
|
||||
# Require a password to wake the computer from sleep or screen saver
|
||||
log_msg "Require a password to wake the computer from sleep or screen saver"
|
||||
sudo defaults write /Library/Preferences/com.apple.screensaver askForPassword -bool true
|
||||
|
||||
# Initiate session lock five seconds after screen saver is started
|
||||
log_msg "Initiate session lock five seconds after screen saver is started"
|
||||
sudo defaults write /Library/Preferences/com.apple.screensaver 'askForPasswordDelay' -int 5
|
||||
|
||||
# Disables signing in as Guest from the login screen
|
||||
|
||||
log_msg "Disables signing in as Guest from the login screen"
|
||||
sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool NO
|
||||
|
||||
# Disables Guest access to file shares over AF
|
||||
log_msg "Disables Guest access to file shares over AF"
|
||||
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool NO
|
||||
|
||||
|
||||
####################################
|
||||
# Prevent Unauthorized Connections #
|
||||
####################################
|
||||
log_section "Prevent Unauthorized Connections"
|
||||
|
||||
# Disables Guest access to file shares over SMB
|
||||
log_msg "Disables Guest access to file shares over SMB"
|
||||
sudo defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool NO
|
||||
|
||||
# Disable remote login (incoming SSH and SFTP connections)
|
||||
log_msg "Disable remote login (incoming SSH and SFTP connections)"
|
||||
echo 'yes' | sudo systemsetup -setremotelogin off
|
||||
|
||||
# Disable insecure TFTP service
|
||||
log_msg "Disable insecure TFTP service"
|
||||
sudo launchctl disable 'system/com.apple.tftpd'
|
||||
|
||||
# Disable Bonjour multicast advertising
|
||||
log_msg "Disable Bonjour multicast advertising"
|
||||
sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true
|
||||
|
||||
# Disable insecure telnet protocol
|
||||
log_msg "Disable insecure telnet protocol"
|
||||
sudo launchctl disable system/com.apple.telnetd
|
||||
|
||||
|
||||
#########################################
|
||||
# Disable Printers and Sharing Protocols #
|
||||
#########################################
|
||||
log_section "Printers and Sharing Protocols"
|
||||
|
||||
# Disable sharing of local printers with other computers
|
||||
log_msg "Disable sharing of local printers with other computers"
|
||||
cupsctl --no-share-printers
|
||||
|
||||
# Disable printing from any address including the Internet
|
||||
log_msg "Disable printing from any address including the Internet"
|
||||
cupsctl --no-remote-any
|
||||
|
||||
# Disable remote printer administration
|
||||
log_msg "Disable remote printer administration"
|
||||
cupsctl --no-remote-admin
|
||||
|
||||
# Disable Captive portal
|
||||
log_msg "Disable Captive portal"
|
||||
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control.plist Active -bool false
|
||||
|
||||
#####################################
|
||||
# Print finishing message, and exit #
|
||||
#####################################
|
||||
echo -e "${PRIMARY_COLOR}\nFinishing...${RESET_COLOR}"
|
||||
echo -e "${SUCCESS_COLOR}✔ ${current_event}/${total_events} tasks were completed \
|
||||
succesfully in $((`date +%s`-start_time)) seconds${RESET_COLOR}"
|
||||
echo -e "\n${PRIMARY_COLOR} .:'\n __ :'__\n .'\`__\`-'__\`\`.\n \
|
||||
:__________.-'\n :_________:\n :_________\`-;\n \`.__.-.__.'\n${RESET_COLOR}"
|
||||
|
||||
if [[ ! $params == *"--quick-exit"* ]]; then
|
||||
echo -e "${ACCENT_COLOR}Press any key to continue.${RESET_COLOR}"
|
||||
read -t 5 -n 1 -s
|
||||
fi
|
||||
exit 0
|
@ -1,6 +1,7 @@
|
||||
|
||||
# To copy, left click and drag to highlight text in yellow,
|
||||
# once you release left click yellow text will disappear and will automatically be available in clibboard
|
||||
|
||||
# Use vim keybindings in copy mode
|
||||
setw -g mode-keys vi
|
||||
|
||||
@ -25,6 +26,9 @@ set -g visual-activity on
|
||||
# Use wider color pallete
|
||||
set -g default-terminal screen-256color
|
||||
|
||||
# Set install location for plugins
|
||||
set-environment -g TMUX_PLUGIN_MANAGER_PATH "${XDG_DATA_HOME}/tmux/plugins"
|
||||
|
||||
# Install productivity plugins
|
||||
set -g @plugin 'tmux-plugins/tmux-sessionist' # Easily manage sessions
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum' # Contineous saves environment for next time
|
||||
@ -73,4 +77,4 @@ set -g @ram_high_bg_color "#[bg=1]"
|
||||
set -g @ram_high_fg_color "#[bg=white]"
|
||||
|
||||
# Import TPM
|
||||
run -b '~/.local/share/tmux/tpm'
|
||||
run "${XDG_DATA_HOME}/tmux/plugins/tpm/tpm"
|
10
utils/am-i-online.sh
Normal file → Executable file
10
utils/am-i-online.sh
Normal file → Executable file
@ -19,7 +19,7 @@ function aio_check-dns() {
|
||||
|
||||
# Checks if can ping default getway
|
||||
function aio_ping-gateway() {
|
||||
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && \
|
||||
ping -q -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && \
|
||||
echo -e "${pre_success} Gateway Availible${post_string}" || \
|
||||
echo -e "${pre_failure} Gateway Unavailible${post_string}"
|
||||
}
|
||||
@ -37,9 +37,11 @@ function aio_check-url() {
|
||||
|
||||
# Checks there are network interfaces
|
||||
function aio_check-interfaces() {
|
||||
for interface in $(ls /sys/class/net/ | grep -v lo); do
|
||||
if [[ $(cat /sys/class/net/$interface/carrier) = 1 ]]; then OnLine=1; fi
|
||||
done
|
||||
if [[ -d /sys/class/net/ ]]; then
|
||||
for interface in $(ls /sys/class/net/ | grep -v lo); do
|
||||
if [[ $(cat /sys/class/net/$interface/carrier) = 1 ]]; then OnLine=1; fi
|
||||
done
|
||||
fi
|
||||
if ! [ $OnLine ]; then
|
||||
echo -e "${pre_failure} Interfaces not Configured${post_string}"
|
||||
else
|
||||
|
50
utils/color-map.sh
Executable file
50
utils/color-map.sh
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Utilities for checking terminal color support, and printing color pallete
|
||||
|
||||
TEXT_COL="\033[1;30m"
|
||||
RESET='\033[0m'
|
||||
|
||||
# Outputs the number of colors supported by your terminal emulator
|
||||
function check_color_support () {
|
||||
echo -e "\n${TEXT_COL}Your terminal supports $(tput colors) colors."
|
||||
}
|
||||
|
||||
# Prints main 16 colors
|
||||
function color_map_16_bit () {
|
||||
echo -e "\n${TEXT_COL}16-Bit Pallete${RESET}\n"
|
||||
base_colors='40m 41m 42m 43m 44m 45m 46m 47m'
|
||||
for BG in $base_colors; do echo -en "$EINS \033[$BG \033[0m"; done; echo
|
||||
for BG in $base_colors; do printf " \033[1;30m\033[%b %b \033[0m" $BG $BG; done; echo
|
||||
for BG in $base_colors; do echo -en "$EINS \033[$BG \033[0m"; done; echo
|
||||
}
|
||||
|
||||
# Prints all 256 supported colors
|
||||
function color_map_256_bit () {
|
||||
echo -e "\n${TEXT_COL}256-Bit Pallete${RESET}\n"
|
||||
for i in {0..255}; do printf '\e[38;5;%dm%3d ' $i $i; (((i+3) % 18)) || printf '\e[0m\n'; done
|
||||
echo
|
||||
}
|
||||
|
||||
# Executes Python script by @grawity for interactivley selecting colors
|
||||
function color_chooser () {
|
||||
curl -s https://raw.githubusercontent.com/grawity/code/master/term/xterm-color-chooser | python3
|
||||
}
|
||||
|
||||
# Determine if file is being run directly or sourced
|
||||
([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] ||
|
||||
[[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" &&
|
||||
printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] ||
|
||||
[[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)) && sourced=1 || sourced=0
|
||||
|
||||
# If script being called directly run immediatley, otherwise register aliases
|
||||
if [ $sourced -eq 0 ]; then
|
||||
check_color_support
|
||||
color_map_16_bit
|
||||
color_map_256_bit
|
||||
else
|
||||
alias color-map-16="color_map_16_bit"
|
||||
alias color-map-256="color_map_256_bit"
|
||||
alias color-map="color_map_16_bit && color_map_256_bit"
|
||||
alias color-support="check_color_support"
|
||||
fi
|
@ -20,9 +20,9 @@ hr_reset="\u001b[0m"
|
||||
hr_draw_char() {
|
||||
local CHAR="$1"
|
||||
local LINE=''
|
||||
LINE=$(printf "%*s" "$hr_col_count")
|
||||
LINE=$(printf "%*s" "$hr_col_count - 2")
|
||||
LINE="${LINE// /${CHAR}}"
|
||||
printf "${hr_color}${LINE:0:${hr_col_count}}${hr_reset}"
|
||||
printf "◀${hr_color}${LINE:0:${hr_col_count}}${hr_reset}▶"
|
||||
}
|
||||
|
||||
# Passes param and calls hr()
|
||||
|
@ -5,9 +5,8 @@ multiline="0" # flag that indicates multiline option
|
||||
fileoutput="0" # flag indicating the -f option
|
||||
|
||||
|
||||
## This function determines which http get tool the system has installed and returns an error if there isnt one
|
||||
getConfiguredClient()
|
||||
{
|
||||
# Determine which HTTP GET tool installed
|
||||
getConfiguredClient () {
|
||||
if command -v curl &>/dev/null; then
|
||||
configuredClient="curl"
|
||||
elif command -v wget &>/dev/null; then
|
||||
@ -22,9 +21,14 @@ getConfiguredClient()
|
||||
fi
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
## Allows to call the users configured client without if statements everywhere
|
||||
httpGet()
|
||||
{
|
||||
=======
|
||||
# Call appropriate http get method
|
||||
httpGet() {
|
||||
>>>>>>> fe6ffbba54ca34778e1f4245466e1efc3394b896
|
||||
case "$configuredClient" in
|
||||
curl) curl -A curl -s "$@" ;;
|
||||
wget) wget -qO- "$@" ;;
|
||||
@ -33,8 +37,8 @@ httpGet()
|
||||
esac
|
||||
}
|
||||
|
||||
getConfiguredPython()
|
||||
{
|
||||
# Get installed version of Python / show error if none
|
||||
getConfiguredPython() {
|
||||
if command -v python3 &>/dev/null; then
|
||||
configuredPython="python3"
|
||||
elif command -v python2 &>/dev/null; then
|
||||
@ -48,8 +52,7 @@ getConfiguredPython()
|
||||
}
|
||||
|
||||
if [[ $(uname) != "Darwin" ]]; then
|
||||
python()
|
||||
{
|
||||
python() {
|
||||
case "$configuredPython" in
|
||||
python3) python3 "$@" ;;
|
||||
python2) python2 "$@" ;;
|
||||
@ -58,21 +61,20 @@ if [[ $(uname) != "Darwin" ]]; then
|
||||
}
|
||||
fi
|
||||
|
||||
makeqr()
|
||||
{
|
||||
# Encode input, and call to qrenco.de to get response
|
||||
makeqr() {
|
||||
input=$(echo "$input" | sed s/" "/%20/g ) ## replace all spaces in the sentence with HTML-encoded space %20
|
||||
httpGet qrenco.de/"$input" ## get a response for the qrcode
|
||||
}
|
||||
|
||||
# redirects the image obtained from the goqr api into a png file
|
||||
# Redirects returned QR impage into a png file
|
||||
makeQRFile() {
|
||||
input=$(echo "$input" | sed -e s/" "/%20/g -e s/'\\n'/%0A/g ) ##same as in the makeqr function
|
||||
|
||||
addFileExt
|
||||
|
||||
httpGet "api.qrserver.com/v1/create-qr-code/?size=150x150&data=$input" > "$fileName"
|
||||
}
|
||||
|
||||
# If filename doesn't already have .png extension, append it
|
||||
addFileExt() {
|
||||
if ! echo "$fileName" | grep -E -q ".*\.png$|.*\.PNG$"
|
||||
then
|
||||
@ -80,8 +82,7 @@ addFileExt() {
|
||||
fi
|
||||
}
|
||||
|
||||
makeMultiLineQr()
|
||||
{
|
||||
makeMultiLineQr() {
|
||||
if [[ ${configuredClient} != "curl" ]]; then ## prevent usage without curl it is unreliable
|
||||
echo "Multiline currently only supports curl!"
|
||||
return 1
|
||||
@ -202,4 +203,4 @@ else
|
||||
makeMultiLineQr || exit 1 ## if multiline that means a flag existed so start from the second argument
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
2
utils/radio.sh
Normal file
2
utils/radio.sh
Normal file
@ -0,0 +1,2 @@
|
||||
alias kiss='mplayer http://oom-cmg.streamguys1.com/atl1041/atl1041.mp3'
|
||||
#Kiss 104.1-WALR-FM-FM 104.1-Atlanta,GA :SOURCE:view-source:http://streema.com/radios/play/3806
|
0
utils/test.sh
Executable file
0
utils/test.sh
Executable file
34
utils/transfer.sh
Normal file → Executable file
34
utils/transfer.sh
Normal file → Executable file
@ -5,46 +5,54 @@
|
||||
# Can be either source'd then call`transfer` function, or invoked directly
|
||||
# Licensed under MIT, (C) Alicia Sykes 2022: https://aliciasykes.com
|
||||
|
||||
# Once upload is complete, checks response is correct and prints to console
|
||||
output_secret_link() {
|
||||
echo -e "\033[1;96m\nTransfer Complete 📤\033[0m"
|
||||
echo -e "\033[4;36m${1}\033[0m"
|
||||
}
|
||||
|
||||
# Uploads file to file share service
|
||||
transfer-file () {
|
||||
curl --upload-file $1 $FILE_TRANSFER_SERVICE
|
||||
transfer_file () {
|
||||
output_secret_link $(curl --upload-file $1 $FILE_TRANSFER_SERVICE)
|
||||
}
|
||||
|
||||
# Combines files into an archive, uploads it, then removes
|
||||
transfer-files () {
|
||||
transfer_files () {
|
||||
zip $TMP_FILE $@
|
||||
curl --upload-file $TMP_FILE $FILE_TRANSFER_SERVICE
|
||||
output_secret_link $(curl --upload-file $TMP_FILE $FILE_TRANSFER_SERVICE)
|
||||
rm $TMP_FILE
|
||||
}
|
||||
|
||||
# Zips directory up, uploads it, then removes it
|
||||
transfer-directory () {
|
||||
transfer_directory () {
|
||||
zip -r $TMP_FILE $1
|
||||
curl --upload-file $TMP_FILE $FILE_TRANSFER_SERVICE
|
||||
output_secret_link $(curl --upload-file $TMP_FILE $FILE_TRANSFER_SERVICE)
|
||||
rm $TMP_FILE
|
||||
}
|
||||
|
||||
# Determine the type of transfer, and call appropriate function
|
||||
transfer () {
|
||||
FILE_TRANSFER_SERVICE="${FILE_TRANSFER_SERVICE:=https://transfer.sh}"
|
||||
if [[ $@ == *"--help" ]] transfer-help && return
|
||||
if [[ $@ == *"--help" ]]; then
|
||||
transfer_help && return
|
||||
fi
|
||||
TMP_FILE="/tmp/file-transfer-$(date +%s).zip"
|
||||
if [ -z "$1" ]; then
|
||||
transfer-help
|
||||
transfer_help
|
||||
return
|
||||
fi
|
||||
if [[ -f $1 ]] && [ "$#" -eq 1 ]; then
|
||||
transfer-file $@
|
||||
transfer_file $@
|
||||
elif [ -d $1 ] && [ "$#" -eq 1 ]; then
|
||||
transfer-directory $@
|
||||
transfer_directory $@
|
||||
elif [ "$#" -gt 1 ]; then
|
||||
transfer-files $@
|
||||
transfer_files $@
|
||||
fi
|
||||
unset TMP_FILE
|
||||
}
|
||||
|
||||
# Shows usage instructions
|
||||
transfer-help () {
|
||||
transfer_help () {
|
||||
welcome_msg="\033[1;33mHelper script for transfering files via transfer.sh\n"
|
||||
welcome_msg="$welcome_msg\033[0;33mInvoke script with file(s) or a directory to upload\n"
|
||||
welcome_msg="$welcome_msg\033[1;33mE.g.\033[0;93m\n $ transfer hello.txt\n"
|
||||
@ -61,7 +69,7 @@ transfer-help () {
|
||||
# If script being called directly, invoke transfer or show help
|
||||
if [ $sourced -eq 0 ]; then
|
||||
if [ ! -n "${1+set}" ] || [[ $@ == *"--help"* ]]; then
|
||||
transfer-help
|
||||
transfer_help
|
||||
else
|
||||
transfer $@
|
||||
fi
|
||||
|
14
zsh/.zshenv
14
zsh/.zshenv
@ -18,7 +18,6 @@ export PAGER="less"
|
||||
## Respect XDG directories
|
||||
export ADOTDIR="${XDG_CACHE_HOME}/zsh/antigen"
|
||||
export OPENSSL_DIR="/usr/local/ssl"
|
||||
export ANTIBODY_HOME=${XDG_DATA_HOME}/antibody
|
||||
export CARGO_HOME="${XDG_DATA_HOME}/cargo"
|
||||
export CURL_HOME="${XDG_CONFIG_HOME}/curl"
|
||||
export DOCKER_CONFIG="${XDG_CONFIG_HOME}/docker"
|
||||
@ -28,6 +27,7 @@ export LESSHISTFILE="-" # Disable less history.
|
||||
export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/pass"
|
||||
export PIP_CONFIG_FILE="${XDG_CONFIG_HOME}/pip/pip.conf"
|
||||
export PIP_LOG_FILE="${XDG_DATA_HOME}/pip/log"
|
||||
export TMUX_PLUGIN_MANAGER_PATH="${XDG_DATA_HOME}/tmux/plugins"
|
||||
export VIMINIT=":source $XDG_CONFIG_HOME/vim/vimrc"
|
||||
export WGETRC="${XDG_CONFIG_HOME}/wget/wgetrc"
|
||||
export XINITRC="${XDG_CONFIG_HOME}/X11/xinitrc"
|
||||
@ -48,10 +48,10 @@ if [ "$(uname -s)" = "Darwin" ] && [[ -d /opt/homebrew/bin ]]; then
|
||||
fi
|
||||
|
||||
# And Android SDK to path, if within Library direcroty
|
||||
if [ "$(uname -s)" = "Darwin" ] && [[ -d ~/Library/Android/ ]]; then
|
||||
export PATH="/Users/alicia/Library/Android/sdk/emulator:${PATH}"
|
||||
export ANDROID_HOME="~/Library/Android/sdk"
|
||||
export ANDROID_SDK_ROOT="~/Library/Android/sdk"
|
||||
export ANDROID_AVD_HOME="~/.android/avd"
|
||||
export NODE_BINARY=node
|
||||
if [ "$(uname -s)" = "Darwin" ] && [[ -d "${HOME}/Library/Android/" ]]; then
|
||||
export PATH="${HOME}/Library/Android/sdk/emulator:${PATH}"
|
||||
export ANDROID_HOME="${HOME}/Library/Android/sdk"
|
||||
export ANDROID_SDK_ROOT="${HOME}/Library/Android/sdk"
|
||||
export ANDROID_AVD_HOME="${ANDROID_SDK_ROOT}/tools/emulator"
|
||||
export NODE_BINARY="/usr/local/bin/node"
|
||||
fi
|
||||
|
@ -11,7 +11,7 @@ source ${zsh_dir}/aliases/general.zsh
|
||||
source ${zsh_dir}/aliases/git.zsh
|
||||
source ${zsh_dir}/aliases/node-js.zsh
|
||||
source ${zsh_dir}/aliases/flutter.zsh
|
||||
source ${zsh_dir}/aliases/alias-tips.zsh
|
||||
# source ${zsh_dir}/aliases/alias-tips.zsh
|
||||
|
||||
# Setup Antigen, and import plugins
|
||||
source ${zsh_dir}/helpers/setup-antigen.zsh
|
||||
@ -35,6 +35,7 @@ source ${utils_dir}/hr.sh
|
||||
source ${utils_dir}/web-search.sh
|
||||
source ${utils_dir}/am-i-online.sh
|
||||
source ${utils_dir}/welcome-banner.sh
|
||||
source ${utils_dir}/color-map.sh
|
||||
|
||||
# Left over tasks
|
||||
source ${zsh_dir}/helpers/misc-stuff.zsh
|
||||
@ -43,6 +44,6 @@ source ${zsh_dir}/helpers/misc-stuff.zsh
|
||||
[[ ! -f ${zsh_dir}/.p10k.zsh ]] || source ${zsh_dir}/.p10k.zsh
|
||||
|
||||
# If not running in nested shell, then show welcome message :)
|
||||
if [[ "${SHLVL}" -lt 2 ]]; then
|
||||
if [[ "${SHLVL}" -lt 2 ]] && [[ -z "$SKIP_WELCOME" ]]; then
|
||||
welcome
|
||||
fi
|
||||
|
@ -179,4 +179,4 @@ alias dog='cat'
|
||||
alias gtfo='exit'
|
||||
|
||||
# Alias for install script
|
||||
alias dotfiles="sh ${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}/install.sh"
|
||||
alias dotfiles="${DOTFILES_DIR:-$HOME/Documents/config/dotfiles}/install.sh"
|
||||
|
Loading…
Reference in New Issue
Block a user