Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·95 lines (74 loc) · 2.03 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·95 lines (74 loc) · 2.03 KB
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
#!/bin/bash
set -eo pipefail
trap on_error ERR
exec 2> >(while read -r line; do echo -e "\e[01;31m$line\e[0m"; done)
dotfiles_dir="$(
cd "$(dirname "$0")"
pwd
)"
cd "$dotfiles_dir"
on_error() {
ret=$?
echo "[$0] Error on line $LINENO: $BASH_COMMAND"
exit $ret
}
link() {
orig_file="$dotfiles_dir/$1"
if [ -n "$2" ]; then
dest_file="$HOME/$2"
else
dest_file="$HOME/$1"
fi
mkdir -p "$(dirname "$orig_file")"
mkdir -p "$(dirname "$dest_file")"
rm -rf "$dest_file"
ln -s "$orig_file" "$dest_file"
echo "$dest_file -> $orig_file"
}
link ".profile"
link ".config/fontconfig"
link ".config/gtk-3.0"
link ".config/dunst"
link ".config/wezterm"
link ".config/sway"
link ".config/zsh"
link ".config/gdb"
link ".config/git"
link ".config/gammastep"
link ".config/kanshi"
link ".config/nvim"
link ".config/ruff"
link ".config/ls-colors"
link ".config/chromium-flags.conf"
link ".config/electron-flags.conf"
link ".config/python-startup.py"
link ".config/mimeapps.list"
link ".config/user-dirs.dirs"
link ".mozilla/firefox/user-overrides.js"
link ".local/share/applications"
link ".local/share/wallpaper.jpg"
link ".local/bin" # Maybe I should link individual executables instead of the whole folder
# Create home directories
cut -s -d'"' -f2 "$HOME/.config/user-dirs.dirs" | sed "s|\$HOME|$HOME|g" | xargs -L 1 mkdir -p
mkdir "$HOME/dev"
# Source XDG variables
source "$HOME/.config/user-dirs.dirs"
# Mark download folder nodatacow
chattr +C "$XDG_DOWNLOAD_DIR"
# Mark cache folder nodatacow
chattr +C "$XDG_CACHE_HOME"
# Mark firefox nodatacow
mkdir -p "$HOME/.mozilla"
chattr +C "$HOME/.mozilla"
# Mark chromium nodatacow
mkdir -p "$XDG_CONFIG_HOME/chromium"
chattr +C "$XDG_CONFIG_HOME/chromium"
# Configure Rust toolchain
rustup default stable
current_user="$(whoami)"
if [ "$current_user" != "shellcode" ]; then
# Change my username by your own
grep -rl shellcode --exclude install.sh --exclude-dir .git | xargs sed -i "s/shellcode/$current_user/g"
# Remove my git config, create your own if needed
rm .config/git/config
fi