-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·57 lines (45 loc) · 1.88 KB
/
install.sh
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
#!/bin/bash
set -ue
DOT_DIR=$HOME/dotfiles
[[ ! -d "$HOME/.local/state/zsh" ]] && mkdir -p "$HOME/.local/state/zsh"
[[ ! -d "$HOME/.devcontainer_history" ]] && mkdir -p "$HOME/.devcontainer_history"
[[ ! -x "$HOME/.devcontainer_history/history" ]] && touch "$HOME/.devcontainer_history/history"
[[ -d "$HOME/.local" ]] && rm -rf "$HOME/.local"
ln -snf $DOT_DIR/files/.local $HOME
[[ -d "$HOME/.config" ]] && rm -rf "$HOME/.config"
ln -snf $DOT_DIR/files/.config $HOME
# Since environment variables cannot be used in the service definition file, embed the path to the program to be run as a daemon in the install script.
[[ ! -d "$HOME/.donfig/systemd/user" ]] && mkdir -p "$HOME/.config/systemd/user"
cat <<EOF > $HOME/.config/systemd/user/BrowserPipe.service
[Unit]
Description = demonize named pipe to xdg-open
After=local-fs.target
ConditionPathExists=$HOME/.local/bin
[Service]
ExecStart=$HOME/.local/bin/browser-pipe-handler
Restart=no
Type=simple
[Install]
WantedBy=default.target
EOF
if "${IS_CONTAINER:-false}"; then
echo 'export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/remote_starship.toml"' > $DOT_DIR/files/.config/zsh/.zshenv.local
else
echo 'export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/host_starship.toml"' > $DOT_DIR/files/.config/zsh/.zshenv.local
fi
ln -snf $DOT_DIR/files/.config/zsh/.zshrc $HOME
ln -snf $DOT_DIR/files/.config/zsh/.zshenv $HOME
ln -snf $DOT_DIR/files/.config/bash/.bash_profile $HOME
ln -snf $DOT_DIR/files/.config/git/.gitconfig $HOME
ln -snf $DOT_DIR/files/.config/.lnav $HOME
$DOT_DIR/.bin/install-aqua.sh
$DOT_DIR/.bin/install-mise.sh
if [[ "${1:-}" == "wsl" ]]; then
$DOT_DIR/.bin/setup-windows.sh
systemctl --user daemon-reload
systemctl --user enable BrowserPipe
systemctl --user start BrowserPipe
fi
sudo apt-get update
sudo apt-get install -y zsh build-essential unzip xdg-utils
xdg-settings set default-web-browser file-protocol-handler.desktop