-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-linux-tricks.sh
More file actions
executable file
·32 lines (30 loc) · 1.23 KB
/
install-linux-tricks.sh
File metadata and controls
executable file
·32 lines (30 loc) · 1.23 KB
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
#!/bin/bash
# TODO: First check if aliases is already sourced in bashrc
cd ~
# echo "export IWantHaraldsPersonalAliases=false" >> ~/.bashrc
isInFile=$(cat ~/.bashrc | grep -c "linux-tricks")
if [ $isInFile -eq 0 ]; then
echo "" >> ~/.bashrc
echo "# Harald's Linux Tricks Aliases" >> ~/.bashrc
echo "source ~/linux-tricks/.bash_aliases" >> ~/.bashrc
echo "Successfully installed linux-tricks bash_aliases!"
echo "Congratulation!"
echo ""
echo "Try using some of them:"
echo " 'l' = list all files neatly"
echo " '..' = cd .."
echo " 'g' = git status"
echo " 's' = source ~/.bashrc"
echo " 'b' = vim ~/.bashrc"
echo " 'bb' = edit Harald's aliases"
echo ""
echo "NB! Open a new terminal to use them, or source .bashrc"
echo ""
echo "I also recommend installing useful lightweight linux programs. Simply run:"
echo "cd && ./linux-tricks/installs/install_basic_linux_programs.sh"
. ~/linux-tricks/.bash_aliases
notification "Successfully installed linux-tricks!" "You have now installed linux-tricks, which makes you able to use a whole lot of new aliases. Take a look at them at ~/linux-tricks/.bash_aliases" 30 "accept.png"
else
echo "It seems like you have already added linux-tricks/.bash_aliases to your .bashrc"
echo "Aborting!"
fi