-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·114 lines (99 loc) · 3.42 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
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
106
107
108
109
110
111
112
113
#!/bin/bash
function requiresudo {
if [ $(id -u $real_user) = 0 ]; then
echo "The script should be run by escalating (sudo) from a non-root account." >&2
exit 1
fi
}
function installohmyzsh {
if [ -d ~/.oh-my-zsh ]; then
echo "oh-my-zsh already installed. Skipping"
return 0
fi
echo "Installing oh-my-zsh"
sudo -u $real_user sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
}
function installzshrc {
echo "Copying .zshrc"
sudo -u $real_user cp .zshrc ~/
}
function installclipboardmgr {
if [ -d ~/.local/share/gnome-shell/extensions/[email protected] ]; then
echo "clipboard manager already installed. Skipping"
return 0
fi
echo "Installing clipboard manager"
git clone https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator.git ~/.local/share/gnome-shell/extensions/[email protected] > /dev/null
pushd ~/.local/share/gnome-shell/extensions/[email protected] > /dev/null
gnome-shell-extension-tool -e [email protected]
glib-compile-schemas schemas
gsettings --schemadir schemas set org.gnome.shell.extensions.clipboard-indicator toggle-menu "['<Ctrl>grave']"
gsettings --schemadir schemas set org.gnome.shell.extensions.clipboard-indicator notify-on-copy false
popd > /dev/null
}
function installshelltile {
if [ -d ~/.local/share/gnome-shell/extensions/[email protected] ]; then
echo "shelltile already installed. Skipping"
return 0
fi
echo "Installing shelltile"
git clone https://github.com/emasab/shelltile.git ~/.local/share/gnome-shell/extensions/[email protected] > /dev/null
pushd ~/.local/share/gnome-shell/extensions/[email protected] > /dev/null
gnome-shell-extension-tool -e [email protected]
glib-compile-schemas schemas
gsettings --schemadir schemas set org.gnome.shell.extensions.shelltile gap-between-windows 3
popd > /dev/null
}
function installremovedropdownarrows {
if [ -d ~/.local/share/gnome-shell/extensions/[email protected] ]; then
echo "Remove Dropdown Arrows already installed. Skipping"
return 0
fi
echo "Installing Remove Dropdown Arrows"
git clone https://github.com/mpdeimos/gnome-shell-remove-dropdown-arrows.git ~/.local/share/gnome-shell/extensions/[email protected] > /dev/null
pushd ~/.local/share/gnome-shell/extensions/[email protected] > /dev/null
gnome-shell-extension-tool -e [email protected]
popd > /dev/null
}
function addmicrok8scompletion {
mkdir ~/.oh-my-zsh/plugins/microk8s
cp ./microk8s.plugin.zsh ~/.oh-my-zsh/plugins/microk8s/
}
function enablemicrok8sdns {
microk8s.enable dns
}
function addzshtobashrc {
grep -Pzoq 'if \[ -t 1 ]; then\n exec zsh\nfi' ~/.bashrc
if [ $? -eq 0 ]; then
echo "zsh already in bashrc. Skipping"
return 0
fi
echo "Adding zsh execution to bashrc"
sudo -u $real_user cat <<EOT >> ~/.bashrc
if [ -t 1 ]; then
exec zsh
fi
EOT
}
function addzshtheme {
cp ./jesse-agnoster.zsh-theme ~/.oh-my-zsh/themes/
}
function vimrcandplugins {
cp ./.vimrc ~/
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
}
if [ $SUDO_USER ]; then
real_user=$SUDO_USER
else
real_user=$(whoami)
fi
sudo ./elevatedsteps.sh
installohmyzsh
installclipboardmgr
installshelltile
installremovedropdownarrows
addmicrok8scompletion
enablemicrok8sdns
addzshtheme
addzshtobashrc
vimrcandplugins