-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_install_config.sh
executable file
·94 lines (62 loc) · 1.92 KB
/
01_install_config.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# === Begin ===
echo
echo "====================================================================="
echo "BEGIN - Beginning setup of dotfiles, folders and other configuration."
echo "====================================================================="
# === Create Folders ===
echo
echo "=== Create Folders ==="
echo "Creates folders, if not already present. Prints message otherwise."
echo
for f in ~/R ~/R/R-library-primary ~/Sync ~/.newsboat
do
if [ ! -d ${f} ]; then
mkdir ${f}
echo "Created ${f}."
echo
else
echo "${f} already exists."
echo
fi
done
# === Dot Files ===
echo
echo "=== Dot Files ==="
echo "Removes old dot files, if present, and replaces them with links to the dot files in the local git repository."
echo
for f in .bash_profile .bashrc .emacs .gitignore .Rprofile .newsboat/config .newsboat/urls
do
echo "--- ${f} ---"
if [ -e ${f} ]
then
echo "Found old ${f}."
rm ~/${f}
echo "Deleted old ${f}."
fi
ln -s ~/github/dotfiles-config/${f} ~/${f}
echo "Linked new ${f} from local git repository."
echo
done
# === Git Config ===
git config --global user.name "Sean Fobbe"
git config --global pull.rebase false
git config --global core.editor vim
git config --global init.defaultBranch main
git config --global color.ui auto
git config --global receive.fsckObjects true
git config --global core.excludesfile ~/.gitignore
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
# === Deactivate Power Save Mode ===
echo
echo "=== Deactivate Power Save Mode ==="
echo "Note: can be reversed by using 'unmask' in the same command."
echo
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
echo "Sleep, suspend, hibernate and hybrid-sleep deactivated."
# === END ===
echo
echo "======================"
echo "END - Setup completed."
echo "======================"
echo