-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaliases.sh
More file actions
executable file
·31 lines (26 loc) · 1.13 KB
/
Copy pathaliases.sh
File metadata and controls
executable file
·31 lines (26 loc) · 1.13 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
#!/bin/bash
echo "********************************************************"
echo "Adding aliases (only if they don't already exist)"
echo "********************************************************"
echo
add_alias_if_missing() {
local alias_line="$1"
local alias_name=$(echo "$alias_line" | cut -d'=' -f1 | awk '{print $2}')
if ! grep -Fxq "$alias_line" ~/.bashrc; then
echo "$alias_line" >> ~/.bashrc
echo "✔️ Added: $alias_name"
else
echo "⚠️ Already exists: $alias_name"
fi
}
add_alias_if_missing "alias clipboard='xclip -selection clipboard'"
add_alias_if_missing "alias c='cd'"
add_alias_if_missing "alias св='cd'"
add_alias_if_missing "alias dotfiles='zed ~/github/dotfiles'"
add_alias_if_missing "alias lock='cinnamon-screensaver-command --lock'"
add_alias_if_missing "alias internet_check='python3 ~/github/dotfiles/internet_check.py'"
add_alias_if_missing "alias specs='inxi -b -c 0'"
# Line below enables ctrl+backspace - to delete whole word in terminal (without it only alt+backspace works)
echo "stty werase '^H'" >> ~/.bashrc
echo
echo "Please run 'source ~/.bashrc' to apply the changes or open a new terminal."