-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·73 lines (53 loc) · 1.72 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
if [ -d "$HOME/dotfiles-swayfx" ]; then
mv $HOME/dotfiles-swayfx $HOME/dotfiles-swayfx.bak 2> /dev/null
fi
cd $HOME
git clone --depth 1 https://github.com/owpk/dotfiles-swayfx
cd $HOME/dotfiles-swayfx
DOT=$(pwd)
# install terminal utils
git submodule update --init --recursive
TERM_UTILS="server-dots"
git config user.name "$USER"
git config user.email "--auto--"
curl -Ls https://raw.githubusercontent.com/owpk/dots-misc/refs/heads/main/install-deps.sh | bash -s -- $DOT/deps
CFG=$HOME/.config
LOCAL_BIN=$HOME/.local/bin
mkdir -p $LOCAL_BIN 2> /dev/null
mkdir -p $CFG 2> /dev/null
function prepareBackups() {
echo "Creating backup..."
BACKUP_DIR="$HOME/dotfiles-backups"
mkdir -p $BACKUP_DIR/.config 2> /dev/null
TR=$(ls $DOT/.config)
for filename in $TR; do
echo "Processing backup for file: $filename"
if [ -d "$HOME/$filename" ]; then
echo "MV: $CFG/$filename -> $BACKUP_DIR/.config"
mv $CFG/$filename $BACKUP_DIR/.config
fi
done
if [ -d "$HOME/.themes" ]; then
mv $HOME/.themes $BACKUP_DIR/
fi
}
prepareBackups
stow --adopt -vt $CFG .config
stow --adopt -vt $LOCAL_BIN scripts
sudo mkdir -p /usr/share/fonts/TTF 2> /dev/null
sudo cp ./fonts/* /usr/share/fonts/TTF/
fc-cache
ln -nsf $(pwd)/.themes $HOME/
git checkout -b "$USER"
cd $TERM_UTILS
./install.sh
sleep 2
sudo curl -L https://github.com/owpk/sway-keyhints/releases/latest/download/swaykeyhints --output /usr/bin/swaykehints
sudo chmod +x /usr/bin/swaykehints
echo " ::KEYBINDINGS:: "
/usr/bin/swaykehints -h 100 -w 200
echo "All done! Please check current keybindings above"
echo "Use '/usr/bin/swaykehints' for keybindings help"
echo "Your backup files created at: $BACKUP_DIR"