-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
106 lines (86 loc) · 4.41 KB
/
setup.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
#!/bin/sh
# Usage:
# curl -s https://raw.githubusercontent.com/orleanski/dotfiles/master/setup.sh | sh && source .config/bash/bashrc
# curl -s https://raw.githubusercontent.com/orleanski/dotfiles/master/setup.sh | sh && source .config/zsh/.zshrc
echo " Installing dotfiles, it will be quick!"
echo ""
cd "$HOME/"
echo "Moving .config to .config.bak, can be deleted afterwards"
[[ -d .config ]] && mv .config .config.bak
echo "Obtaining github archive with config files"
wget -nc "https://github.com/orleanski/dotfiles/archive/master.zip"
echo "Unzipping archive"
unzip master.zip -d "$HOME/"
echo "Moving dir structure to the homedir"
mv -v dotfiles-master/.config $HOME/
mv -v dotfiles-master/.local $HOME/
mv -v dotfiles-master/Desktop $HOME/
mv -v dotfiles-master/Documents $HOME/
mv -v dotfiles-master/Downloads $HOME/
mv -v dotfiles-master/Media $HOME/
mv -v dotfiles-master/Projects $HOME/
mv -v dotfiles-master/Public $HOME/
mv -v dotfiles-master/Makefile $HOME/
mkdir -v $HOME/.cache
echo " .... cleaning up now .... "
echo "Deleting temp unzipped dir"
[[ -d dotfiles-master ]] && rm -rf dotfiles-master
echo "Checking and removing master.zip"
[[ -f master.zip ]] && rm master.zip
echo "Checking and removing .wget-hsts"
[[ -f .wget-hsts ]] && rm .wget-hsts
echo "Checking and removing .bash_history"
[[ -f .bash_history ]] && rm .bash_history
# echo "Creating homedir structure, may ways"
# [ -d "$HOME/Desktop" ] || mkdir -p "$HOME/Desktop"
# [ -d "$HOME/Documents/Templates" ] || mkdir -p "$HOME/Documents/Templates"
# [ -d "$HOME/Downloads" ] || mkdir "$HOME/Downloads"
# [ -d "$HOME/Media/Books" ] || mkdir -p "$HOME/Media/Books"
# [ -d "$HOME/Media/Music" ] || mkdir "$HOME/Media/Music"
# [ -d "$HOME/Media/Picture/Backgrounds" ] || mkdir -p "$HOME/Media/Pictures/Backgrounds"
# [ -d "$HOME/Media/Picture/Screenshots" ] || mkdir -p "$HOME/Media/Pictures/Screenshots"
# [ -d "$HOME/Media/Videos" ] || mkdir "$HOME/Media/Videos"
# [ -d "$HOME/Projects" ] || mkdir "$HOME/Projects"
# [ -d "$HOME/Public" ] || mkdir "$HOME/Public"
# echo "Checking on XDG directories and creating them if needed"
# [ -d "${XDG_CACHE_HOME:-$HOME/.cache}" ] || mkdir "${XDG_CACHE_HOME}"
# [ -d "${XDG_CONFIG_HOME:-$HOME/.config}" ] || mkdir "${XDG_CONFIG_HOME}"
# [ -d "${XDG_DATA_HOME:-$HOME/.local/share}" ] || mkdir -p "${XDG_DATA_HOME}"
# [ -d "${XDG_DATA_HOME/templates}" ] || mkdir -p "${XDG_DATA_HOME/templates}"
echo "Updating current state of the users user-dirs.dir"
xdg-user-dirs-update --force
echo "Changing permissions on 700 to .cache .config and .data"
chmod -v -R 700 $HOME/.cache $HOME/.config $HOME/.local
# echo "check for some dotfiles, move them into ~/.local and link it"
# [ -d "$HOME/.local/.ssh" ] || mkdir -p "$HOME/.local/.ssh" && ln -s ".local/.ssh" "$HOME/"
# [ -d "$HOME/.local/.gnupg" ] || mkdir -p "$HOME/.local/.gnupg" && ln -s ".local/.gnupg" "$HOME/"
# [ -d "$HOME/.local/.dbus" ] || mkdir -p "$HOME/.local/.dbus" && ln -s ".local/.dbus" "$HOME/"
# [ -d "$HOME/.local/.kde4" ] || mkdir -p "$HOME/.local/.kde4" && ln -s ".local/.kde4" "$HOME/"
#[ -d "$HOME/.local/.cargo" ] || mkdir -p "$HOME/.local/.cargo" && ln -s ".local/.cargo" "$HOME/"
echo ""
echo " Done "
echo "it's time for the POST INSTALL steps"
echo "- please add xdg.sh to /etc/profile.d/ see .config/sys_etc/profile.d/"
echo "- please change /etc/bash/bashrc and let it read our bashrc see .config/sys_etc/bash/"
echo "- to install additional software lets create extra file ~/install-enviroment.list"
echo "app-eselect/eselect-repository" >> install-enviroment.list
echo "app-admin/doas" >> install-enviroment.list
echo "app-mist/tmux" >> install-enviroment.list
echo "app-editor/neovim" >> install-enviroment.list
echo "app-sheels/bash-completion" >> install-enviroment.list
echo "x11-misc/xdg-user-dirs" >> install-enviroment.list
echo "dev-vcs/git" >> install-enviroment.list
echo "dev-lang/rust" >> install-enviroment.list
echo "virtual/rust" >> install-enviroment.list
echo "- the app-shells/starship is from repository guru, so enable the repo"
echo "app-shells/starship" >> install-enviroment.list
echo "app-shells/atuin" >> install-enviroment.list
echo "sys-apps/bat" >> install-enviroment.list
echo "" >> install-enviroment.list
echo 'emerge $(< install-enviroment.list)'
echo "- to restart bash run exec bash -l"
echo "- run nvim and :PlugInstall"
echo "and you should be set"
echo " Goodbye now ... "
echo " "
# read -e -n 1 -p "press any key to continue" \n;