-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupDots
executable file
·105 lines (88 loc) · 2.43 KB
/
setupDots
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
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env bash
set -euo pipefail
# Color variables
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
run_command() {
echo -e "${YELLOW}Running:${NC} $*"
"$@"
}
user_config() {
run_command ln -sf "$PWD"/.local/bin/ ~/.local/
run_command ln -sf "$PWD"/.gitconfig ~/
for f in "$PWD"/.config/*; do
run_command ln -sf "$f" ~/.config/
done
for f in "$PWD"/.ssh/*; do
run_command ln -sf "$f" ~/.ssh/
done
for f in "$PWD"/shell/.[!.]*; do
run_command ln -sf "$f" ~
done
}
system_config() {
run_command sudo ln -sf "$PWD"/keymaps/colemak /usr/share/X11/xkb/symbols/colemak
run_command sudo ln -sf "$PWD"/keymaps/keyd.conf /etc/keyd/default.conf
run_command sudo mkdir -p -m 755 \
/etc/systemd/sleep.conf.d/ \
/etc/systemd/logind.conf.d/ \
/etc/systemd/resolved.conf.d/
run_command sudo ln -sf "$PWD"/misc/99-sleep.conf /etc/systemd/sleep.conf.d/
run_command sudo ln -sf "$PWD"/misc/99-logind.conf /etc/systemd/logind.conf.d/
run_command sudo ln -sf "$PWD"/misc/99-sudoers /etc/sudoers.d/
run_command sudo chown 0 /etc/sudoers.d/
}
arch_config() {
[ ! -x "$(command -v pacman)" ] && return
run_command sudo sed -i '/Color/s/^#//g' /etc/pacman.conf
# run_command sudo sed -i '/VerbosePkgLists/s/^#//g' /etc/pacman.conf
run_command sudo ln -sf "$PWD"/hooks /etc/pacman.d/
run_command sudo ln -sfT dash /usr/bin/sh
}
ssh_agent() {
run_command systemctl --user enable ssh-agent
run_command systemctl --user start ssh-agent
}
kde() {
run_command kwriteconfig5 --file kwalletrc --group 'Wallet' --key 'Enabled' 'false'
run_command kwriteconfig5 --file kwalletrc --group 'Wallet' --key 'First Use' 'false'
}
complete_message() {
echo -e "${GREEN}$1 completed.${NC}"
}
main_menu() {
echo -e "${YELLOW}Select an option:${NC}"
options=("User Configuration" "System Configuration" "Arch Configuration" "SSH Agent Setup" "Disable KDE Wallet" "Quit")
select _ in "${options[@]}"; do
case $REPLY in
1)
user_config
complete_message "${options[0]}"
;;
2)
system_config
complete_message "${options[1]}"
;;
3)
arch_config
complete_message "${options[2]}"
;;
4)
ssh_agent
complete_message "${options[3]}"
;;
5)
kde
complete_message "${options[4]}"
;;
6) break ;;
*)
echo -e "${RED}Invalid option${NC}"
break
;;
esac
done
}
main_menu