-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
95 lines (74 loc) · 2.73 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Read up on just here: https://github.com/casey/just
set fallback := true
set shell := ["bash", "-uc"]
set windows-shell := ["sh", "-uc"]
set ignore-comments
_default:
@just --list
# Print help.
help:
@just --list
# =============================================================================
# Simulate sub-commands by invoking with the directory and justfile set.
# =============================================================================
# See: https://github.com/casey/just/issues/208#issuecomment-453529888
# Tasks for the repo itself, not dotfile management.
[group("repo")]
repo +args="help":
@just -d `pwd` -f "tasks/repo/justfile" {{ args }}
# =============================================================================
# Dotfiles management.
# =============================================================================
home_dir := env_var('HOME')
@_check_program name:
command -v {{name}} >/dev/null 2>&1 || { echo >&2 "{{name}} is required but it's not installed. Aborting."; exit 1; }
@_check_install:
just _check_program cat
just _check_program grep
just _check_program brew
just _check_program xargs
@_check_link:
just _check_install
just _check_program ls
just _check_program stow
# Install recipes using brew.
install:
@just _check_install
cat ./src/homebrew/recipes.txt | grep -v "^#" | grep -v "^[[:space:]]*$" | xargs brew install
# Links dotfiles into home directory.
link:
ls -A links | grep -v "^\.\+$" | xargs stow -d ./links -t "{{home_dir}}"
# [confirm("Symlink contents of ./links in home directory? (y/N)")]
# Links dotfiles into test directory (./links-test).
[group("test")]
link-test:
ls -A links | grep -v "^\.\+$" | xargs stow -d ./links -t ./links-test
# Export installed brew commands. Useful when leaving a system.
[group("leaving")]
@export-brew:
brew leaves
# =============================================================================
# Manual scripts while getting things working. Should move to better places.
# =============================================================================
# Install fonts.
fonts:
# Do you even need --cask?
brew install --cask font-jetbrains-mono-nerd-font
aero:
brew install --cask nikitabobko/tap/aerospace
# move windows by holding ctrl + cmd and dragging any part of the window
defaults write -g NSWindowShouldDragOnGesture YES
# disable window opening animation
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# Setup Sketchy bar.
sketchybar:
brew tap FelixKratz/formulae
# TODO: Check "Displays have separate Spaces" setting.
brew install sketchybar
borders:
brew tap FelixKratz/formulae
brew install borders
# Update xcode
xcode:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install