mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-06 07:55:27 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7921e079da | ||
|
|
2369eae0ef | ||
|
|
6dc5849f9c | ||
|
|
5cc0018f1d | ||
| 8fbeca17a4 | |||
| 1d1a95fad2 |
@@ -17,13 +17,13 @@ indent_size = 2
|
|||||||
indent_size = 2
|
indent_size = 2
|
||||||
tab_width = 2
|
tab_width = 2
|
||||||
|
|
||||||
shell_variant = posix # like -ln=posix
|
shell_variant = bash # like -ln=posix
|
||||||
binary_next_line = true # like -bn
|
binary_next_line = true # like -bn
|
||||||
switch_case_indent = true # like -ci
|
switch_case_indent = true # like -ci
|
||||||
space_redirects = true # like -sr
|
space_redirects = true # like -sr
|
||||||
keep_padding = false # like -kp
|
keep_padding = false # like -kp
|
||||||
function_next_line = true # like -fn
|
function_next_line = true # like -fn
|
||||||
never_split = true # like -ns
|
never_split = false # like -ns
|
||||||
|
|
||||||
[local/bin/antigen.zsh]
|
[local/bin/antigen.zsh]
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|||||||
19
Brewfile
19
Brewfile
@@ -7,6 +7,7 @@ tap "github/gh"
|
|||||||
tap "homebrew/autoupdate"
|
tap "homebrew/autoupdate"
|
||||||
tap "homebrew/bundle"
|
tap "homebrew/bundle"
|
||||||
tap "homebrew/cask"
|
tap "homebrew/cask"
|
||||||
|
tap "homebrew/cask-fonts"
|
||||||
tap "homebrew/core"
|
tap "homebrew/core"
|
||||||
tap "homebrew/services"
|
tap "homebrew/services"
|
||||||
tap "shivammathur/extensions"
|
tap "shivammathur/extensions"
|
||||||
@@ -68,6 +69,8 @@ brew "git-extras"
|
|||||||
brew "git-flow-avh"
|
brew "git-flow-avh"
|
||||||
# See your latest local git branches, formatted real fancy
|
# See your latest local git branches, formatted real fancy
|
||||||
brew "git-recent"
|
brew "git-recent"
|
||||||
|
# Open-source GitLab command-line tool
|
||||||
|
brew "glab"
|
||||||
# GNU implementation of the famous stream editor
|
# GNU implementation of the famous stream editor
|
||||||
brew "gnu-sed"
|
brew "gnu-sed"
|
||||||
# Validating, recursive, caching DNS resolver
|
# Validating, recursive, caching DNS resolver
|
||||||
@@ -128,6 +131,8 @@ brew "ruby"
|
|||||||
brew "shellcheck"
|
brew "shellcheck"
|
||||||
# Autoformat shell script source code
|
# Autoformat shell script source code
|
||||||
brew "shfmt"
|
brew "shfmt"
|
||||||
|
# Version control system designed to be a better CVS
|
||||||
|
brew "subversion"
|
||||||
# Send macOS User Notifications from the command-line
|
# Send macOS User Notifications from the command-line
|
||||||
brew "terminal-notifier", link: false
|
brew "terminal-notifier", link: false
|
||||||
# Tool to build, change, and version infrastructure
|
# Tool to build, change, and version infrastructure
|
||||||
@@ -186,6 +191,18 @@ cask "docker"
|
|||||||
cask "fig"
|
cask "fig"
|
||||||
# Unofficial overcast.fm podcast app
|
# Unofficial overcast.fm podcast app
|
||||||
cask "fog"
|
cask "fog"
|
||||||
|
# Typeface made for developers
|
||||||
|
cask "font-jetbrains-mono"
|
||||||
|
# Developer targeted fonts with a high number of glyphs
|
||||||
|
cask "font-jetbrains-mono-nerd-font"
|
||||||
|
cask "font-lato"
|
||||||
|
cask "font-open-sans"
|
||||||
|
# Font with a mechanical skeleton and the forms are largely geometric
|
||||||
|
cask "font-roboto"
|
||||||
|
cask "font-source-code-pro"
|
||||||
|
cask "font-source-code-pro-for-powerline"
|
||||||
|
cask "font-source-sans-pro"
|
||||||
|
cask "font-source-serif-pro"
|
||||||
# Open Source Webfont Converter
|
# Open Source Webfont Converter
|
||||||
cask "fontplop"
|
cask "fontplop"
|
||||||
# GIT client
|
# GIT client
|
||||||
@@ -200,6 +217,8 @@ cask "jetbrains-toolbox"
|
|||||||
cask "lens"
|
cask "lens"
|
||||||
# Reverse proxy, secure introspectable tunnels to localhost
|
# Reverse proxy, secure introspectable tunnels to localhost
|
||||||
cask "ngrok"
|
cask "ngrok"
|
||||||
|
# Collaboration platform for API development
|
||||||
|
cask "postman"
|
||||||
# Display image info and preview unsupported formats in QuickLook
|
# Display image info and preview unsupported formats in QuickLook
|
||||||
cask "qlimagesize"
|
cask "qlimagesize"
|
||||||
# QuickLook generator for Markdown files
|
# QuickLook generator for Markdown files
|
||||||
|
|||||||
63
README.md
63
README.md
@@ -1,39 +1,58 @@
|
|||||||
# .dotfiles
|
# .dotfiles
|
||||||
|
|
||||||
The folder structure follows [XDG Base Directory Specification][xdg] where possible.
|
Welcome to [ivuorinen](https://github.com/ivuorinen)'s .dotfiles repository. It's a hodgepodge of scripts
|
||||||
|
and configurations, tests and mistakes I'm not aware of yet. As I find more interesting tools, configs and
|
||||||
|
other stuff, this repository will live accordingly.
|
||||||
|
|
||||||
|
Please for the love of everything good do not use these 1:1 as your own dotfiles,
|
||||||
|
fork or download the repo as a zip and go from there with your own configs.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
## rcrc
|
### First time setup
|
||||||
|
|
||||||
Update install script
|
1. Clone this repository to `$HOME/.dotfiles`
|
||||||
|
2. `bash $HOME/.dotfiles/scripts/settler.sh`
|
||||||
|
3. ???
|
||||||
|
4. Profit
|
||||||
|
|
||||||
```bash
|
Note: there's a bit chicken/egg situation, because settler assumes you don't have git,
|
||||||
rcup -B 0 -g > ~/.dotfiles/install.sh | shfmt -w -l ~/.dotfiles/install.sh
|
and you need git to clone the repo. This will change soon™.
|
||||||
```
|
|
||||||
|
|
||||||
## brew
|
## Interesting files and locations
|
||||||
|
|
||||||
Install everything described in `Brewfile`
|
### Special folders
|
||||||
|
|
||||||
```bash
|
| Path | Description |
|
||||||
brew bundle install --force --file=~/.dotfiles/Brewfile
|
|--------------------|-------------------------------------------------------------------------------------|
|
||||||
```
|
| `.github` | GitHub Repository configuration files. Not part of the dotfiles per se. |
|
||||||
|
| `host-{hostname}/` | Host specific dotfiles. Configurations that should apply to that host only. |
|
||||||
|
| `local/bin` | Helper scripts that I've collected or wrote to make life easier. |
|
||||||
|
| `scripts` | Setup scripts. Some can be run many times, some are meant only for the first round. |
|
||||||
|
|
||||||
|
### dotfile folders
|
||||||
|
|
||||||
Update `Brewfile`
|
| Repo | Destination | Description |
|
||||||
|
|-----------|-------------|------------------------------------------------------------------|
|
||||||
|
| `config/` | `.config/` | Configurations for applications. |
|
||||||
|
| `local/` | `.local/` | XDG Base folder, contains `bin`, `share` and `state` for example |
|
||||||
|
| `ssh/` | `.ssh/` | SSH Configurations. |
|
||||||
|
|
||||||
```bash
|
### dfm - the dotfiles manager
|
||||||
brew bundle dump --force --file=~/.dotfiles/Brewfile --describe
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable automatic brew updates and upgrades.
|
`.local/bin/dfm` is a shell script that has some tools that help with dotfiles management.
|
||||||
|
|
||||||
```bash
|
### `scripts/install.sh` - dotfiles linker
|
||||||
brew autoupdate start 43200 --upgrade --cleanup --immediate
|
|
||||||
```
|
|
||||||
|
|
||||||
## XDG Variables
|
The `scripts/install.sh` is a `rcm` generated shell script that does all the necessary linking.
|
||||||
|
|
||||||
|
To refresh the file, you can run `dfm dotfiles update`
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The folder structure follows [XDG Base Directory Specification][xdg] where possible.
|
||||||
|
|
||||||
|
### XDG Variables
|
||||||
|
|
||||||
| Var | Default |
|
| Var | Default |
|
||||||
|--------------------|----------------------|
|
|--------------------|----------------------|
|
||||||
@@ -42,8 +61,7 @@ brew autoupdate start 43200 --upgrade --cleanup --immediate
|
|||||||
| `$XDG_STATE_HOME` | `$HOME/.local/state` |
|
| `$XDG_STATE_HOME` | `$HOME/.local/state` |
|
||||||
| `$XDG_CONFIG_HOME` | `$HOME/.config` |
|
| `$XDG_CONFIG_HOME` | `$HOME/.config` |
|
||||||
|
|
||||||
|
- `$XDG_DATA_HOME` defines the base directory relative to which user-specific data files should be stored. If `$XDG_DATA_HOME` is either not set or empty, a default equal to `$HOME/.local/share` should be used.
|
||||||
- `$XDG_DATA_HOME` defines the base directory relative to which user-specific data files should be stored. If `$XDG_DATA_HOME` is either not set or empty, a default equal to ` $HOME/.local/share` should be used.
|
|
||||||
- `$XDG_CONFIG_HOME` defines the base directory relative to which user-specific configuration files should be stored. If `$XDG_CONFIG_HOME` is either not set or empty, a default equal to `$HOME/.config` should be used.
|
- `$XDG_CONFIG_HOME` defines the base directory relative to which user-specific configuration files should be stored. If `$XDG_CONFIG_HOME` is either not set or empty, a default equal to `$HOME/.config` should be used.
|
||||||
- `$XDG_STATE_HOME` defines the base directory relative to which user-specific state files should be stored. If `$XDG_STATE_HOME` is either not set or empty, a default equal to `$HOME/.local/state` should be used.
|
- `$XDG_STATE_HOME` defines the base directory relative to which user-specific state files should be stored. If `$XDG_STATE_HOME` is either not set or empty, a default equal to `$HOME/.local/state` should be used.
|
||||||
- The `$XDG_STATE_HOME` contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in `$XDG_DATA_HOME`. It may contain:
|
- The `$XDG_STATE_HOME` contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in `$XDG_DATA_HOME`. It may contain:
|
||||||
@@ -52,5 +70,4 @@ brew autoupdate start 43200 --upgrade --cleanup --immediate
|
|||||||
- User-specific executable files may be stored in `$HOME/.local/bin`. Distributions should ensure this directory shows up in the UNIX `$PATH` environment variable, at an appropriate place.
|
- User-specific executable files may be stored in `$HOME/.local/bin`. Distributions should ensure this directory shows up in the UNIX `$PATH` environment variable, at an appropriate place.
|
||||||
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories to search for data files in addition to the `$XDG_DATA_HOME` base directory. The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
|
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories to search for data files in addition to the `$XDG_DATA_HOME` base directory. The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
|
||||||
|
|
||||||
|
|
||||||
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
|
|||||||
@@ -81,15 +81,15 @@ function section_dotfiles
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
link)
|
link)
|
||||||
rcup -B "$HOSTNAME" -v && echo "🎉 Done!"
|
rcup -B "$HOSTNAME" -f -v && echo "🎉 Done!"
|
||||||
;;
|
;;
|
||||||
update)
|
update)
|
||||||
# Updates .dotfiles/scripts/install.sh and formats it
|
# Updates .dotfiles/scripts/install.sh and formats it
|
||||||
rcup -B 0 -g \
|
rcup -B 0 -g \
|
||||||
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
| tee "$INSTALL_SCRIPT" 1> /dev/null \
|
||||||
&& shfmt -w -l "$INSTALL_SCRIPT" \
|
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT"
|
||||||
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \
|
$0 dotfiles shfmt
|
||||||
&& echo "🎉 Done!"
|
echo "🎉 Done!"
|
||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# Format shell scripts according to following rules.
|
# Format shell scripts according to following rules.
|
||||||
|
|||||||
16
local/bin/foreach
Normal file
16
local/bin/foreach
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# foreach <folder> <commands that should be run to each file>
|
||||||
|
#
|
||||||
|
# Source: https://github.com/mvdan/dotfiles/blob/master/.bin/foreach
|
||||||
|
|
||||||
|
cmd=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
for dir in $($cmd); do
|
||||||
|
(
|
||||||
|
echo "$dir"
|
||||||
|
cd "$dir" || exit 1
|
||||||
|
eval "$@" # allow multiple commands like "foo && bar"
|
||||||
|
)
|
||||||
|
done
|
||||||
@@ -6,14 +6,15 @@
|
|||||||
# Originally from: https://www.commandlinefu.com/commands/view/8951
|
# Originally from: https://www.commandlinefu.com/commands/view/8951
|
||||||
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
|
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
|
||||||
#
|
#
|
||||||
echo 'User: Command: Port:'
|
echo 'User: Command: PID: Port:'
|
||||||
echo '====================================================='
|
echo '========================================================='
|
||||||
|
|
||||||
lsof -i 4 -P -n +c 0 \
|
lsof -i 4 -P -n +c 0 \
|
||||||
| grep -i 'listen' \
|
| grep -i 'listen' \
|
||||||
| awk '{print $3, $1, $9}' \
|
| awk '{print $3, $1, $2, $9}' \
|
||||||
| sed 's/ [a-z0-9\.\*]*:/ /' \
|
| sed 's/ [a-z0-9\.\*]*:/ /' \
|
||||||
| sort -k 3 -n \
|
| sort -k 3 -n \
|
||||||
| xargs printf '%-20s %-25s %-5s\n' | uniq
|
| xargs printf '%-15s %-25s %-8s %-5s\n' \
|
||||||
|
| uniq
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ handle_file_ln "$HOME/.dotfiles/git_profiles" "$HOME/.git_profiles"
|
|||||||
handle_file_ln "$HOME/.dotfiles/huskyrc" "$HOME/.huskyrc"
|
handle_file_ln "$HOME/.dotfiles/huskyrc" "$HOME/.huskyrc"
|
||||||
handle_file_ln "$HOME/.dotfiles/local/bin/antigen.zsh" "$HOME/.local/bin/antigen.zsh"
|
handle_file_ln "$HOME/.dotfiles/local/bin/antigen.zsh" "$HOME/.local/bin/antigen.zsh"
|
||||||
handle_file_ln "$HOME/.dotfiles/local/bin/dfm" "$HOME/.local/bin/dfm"
|
handle_file_ln "$HOME/.dotfiles/local/bin/dfm" "$HOME/.local/bin/dfm"
|
||||||
|
handle_file_ln "$HOME/.dotfiles/local/bin/foreach" "$HOME/.local/bin/foreach"
|
||||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-check-git-attributes" "$HOME/.local/bin/x-check-git-attributes"
|
handle_file_ln "$HOME/.dotfiles/local/bin/x-check-git-attributes" "$HOME/.local/bin/x-check-git-attributes"
|
||||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-open-ports" "$HOME/.local/bin/x-open-ports"
|
handle_file_ln "$HOME/.dotfiles/local/bin/x-open-ports" "$HOME/.local/bin/x-open-ports"
|
||||||
handle_file_ln "$HOME/.dotfiles/rcrc" "$HOME/.rcrc"
|
handle_file_ln "$HOME/.dotfiles/rcrc" "$HOME/.rcrc"
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo 'start osx/set-defaults.sh'
|
#
|
||||||
|
# set-defaults.sh - Sets macOS Defaults that I like
|
||||||
|
#
|
||||||
|
# This script contains large portions from following scripts:
|
||||||
|
# - https://github.com/freekmurze/dotfiles/blob/main/macos/set-defaults.sh
|
||||||
|
#
|
||||||
|
|
||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
sudo -v
|
sudo -v
|
||||||
@@ -226,8 +231,11 @@ defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
|||||||
|
|
||||||
# Enable the Develop menu and the Web Inspector in Safari
|
# Enable the Develop menu and the Web Inspector in Safari
|
||||||
defaults write com.apple.Safari IncludeDevelopMenu -bool true
|
defaults write com.apple.Safari IncludeDevelopMenu -bool true
|
||||||
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
|
defaults write com.apple.Safari \
|
||||||
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
|
WebKitDeveloperExtrasEnabledPreferenceKey -bool true
|
||||||
|
defaults write com.apple.Safari \
|
||||||
|
com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled \
|
||||||
|
-bool true
|
||||||
|
|
||||||
# Don’t display the annoying prompt when quitting iTerm
|
# Don’t display the annoying prompt when quitting iTerm
|
||||||
#defaults write com.googlecode.iterm2 PromptOnQuit -bool false
|
#defaults write com.googlecode.iterm2 PromptOnQuit -bool false
|
||||||
@@ -268,10 +276,16 @@ defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Disable smart quotes as it’s annoying for messages that contain code
|
# Disable smart quotes as it’s annoying for messages that contain code
|
||||||
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
|
defaults write com.apple.messageshelper.MessageController \
|
||||||
|
SOInputLineSettings \
|
||||||
|
-dict-add "automaticQuoteSubstitutionEnabled" \
|
||||||
|
-bool false
|
||||||
|
|
||||||
# Disable continuous spell checking
|
# Disable continuous spell checking
|
||||||
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
|
defaults write com.apple.messageshelper.MessageController \
|
||||||
|
SOInputLineSettings \
|
||||||
|
-dict-add "continuousSpellCheckingEnabled" \
|
||||||
|
-bool false
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Kill affected applications #
|
# Kill affected applications #
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Settler - my macOS setup automator
|
# Settler - my macOS setup automator
|
||||||
# Ismo Vuorinen <https://github.com/ivuorinen> 2018
|
# Ismo Vuorinen <https://github.com/ivuorinen> 2018
|
||||||
|
#
|
||||||
|
|
||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
sudo -v
|
sudo -v
|
||||||
@@ -43,8 +44,8 @@ else
|
|||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash ../local/bin/dfm brew install && "Installed Brewfile contents"
|
bash "$HOME/.dotfiles/local/bin/dfm" brew install && "Installed Brewfile contents"
|
||||||
bash ../local/bin/dfm dotfiles link && "Linked all dotfiles"
|
bash "$HOME/.dotfiles/local/bin/dfm" dotfiles link && "Linked all dotfiles"
|
||||||
|
|
||||||
read -r -p "Do you want to set macOS defaults? (y/N) " yn
|
read -r -p "Do you want to set macOS defaults? (y/N) " yn
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user