-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (62 loc) · 2.29 KB
/
Makefile
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
.PHONY: install dotfiles-stow dotfiles-copy dotfiles-clean oh-my-zsh wsl sublime-text windows-terminal powershell
configs=$(subst ./config/,,$(wildcard ./config/*))
install:
sudo apt-get update -q -y
sudo apt-get upgrade -y
sudo apt-get install -y $(shell grep -vE "^\s*#" package.list | tr "\n" " ")
dotfiles-stow:
@for dir in ./dotfiles/*/ ; do \
dir=$$(basename $${dir});\
echo $${dir};\
stow -v -d ./dotfiles -t ~ $${dir};\
done
dotfiles-copy:
@IFS='\
';\
for dir in ./dotfiles/*/; do \
files="$$(find $${dir} -type f -print | sed "s|$${dir}||")";\
# echo "|- $${dir}";\
for file in $${files}; do \
# echo "| |-> $${file}";\
dest=~/"$${file}";\
dest_dir=$$(dirname "$${dest}");\
if [ -e ~/$${file} ]; then \
echo "Skiping $${dest}";\
continue;\
fi;\
if [ ! -d "$${dest_dir}" ]; then \
echo "Creating $${dest_dir}";\
mkdir -p $${dest_dir};\
fi;\
echo "Copying $${dir}$${file} to $${dest}";\
cp "$${dir}$${file}" "$${dest}";\
done;\
done
dotfiles-clean:
@IFS='\
';\
for dir in ./dotfiles/*/; do \
files="$$(find $${dir} -type f -print | sed "s|$${dir}||")";\
for file in $${files}; do \
if [ -e ~/$${file} ]; then \
rm ~/$${file};\
fi;\
done;\
done
oh-my-zsh:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
stow -v -d ./dotfiles -t ~ oh-my-zsh
wsl:
cd ~ && ln -s "$(shell wslpath "$(shell wslvar USERPROFILE)")" "$(shell wslvar USERNAME)"
cd ~ && ln -s "$(shell wslpath "$(shell wslvar OneDrive)")" "OneDrive"
cd ~ && ln -s "$(shell wslpath "$(shell wslvar -l Desktop)")" "Desktop"
cd ~ && ln -s "$(shell wslpath "$(shell wslvar -l Personal)")" "Documents"
cd ~ && ln -s "$(shell wslpath "$(shell wslvar -l {374DE290-123F-4565-9164-39C4925E467B})")" "Downloads"
sublime-text:
cp -a -u "Sublime Text 3" "$(shell wslpath "$(shell wslvar APPDATA)")"
windows-terminal:
cp -a -u WindowsTerminal/* "$(shell wslpath "$(shell wslvar LOCALAPPDATA)")/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState"
powershell:
powershell.exe -Command "Install-Module posh-git -Scope CurrentUser; Install-Module oh-my-posh -Scope CurrentUser"
mkdir -p "$(shell wslpath "$(shell wslvar -l Personal)")/WindowsPowerShell"
cp -a -u WindowsPowerShell/* "$(shell wslpath "$(shell wslvar -l Personal)")/WindowsPowerShell"