-
Notifications
You must be signed in to change notification settings - Fork 0
/
gato.sh
executable file
·72 lines (58 loc) · 1.84 KB
/
gato.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
#!/bin/sh
if [[ $# -eq 0 ]] then
echo "Usage: 'gato <command> <options>'"
echo ""
echo "gato link <folder_name> # creates a symlink to the ~/.config folder"
echo "gato gnome # sets default gnome settings"
echo "gato git # sets default git settings"
echo ""
exit 1
fi
# lib
link_config() {
local config_name="$1"
local config_path="$(pwd)/$config_name"
local target_dir="$HOME/.config/$config_name"
if [ -d "$target_dir" ]; then
echo "skipping $config_name, already exists"
else
echo "linking $config_name"
ln -s "$config_path" "$HOME/.config/"
fi
}
# command handling
command=$1
case $command in
"link")
if [[ -z "$2" ]] then
echo "Usage: 'gato link <folder_name>"
exit 1
fi
link_config $2
;;
"gnome")
echo "set keyboard repeat speeds"
gsettings set org.gnome.desktop.peripherals.keyboard delay 360
gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 25
echo "set mouse accel and speed"
gsettings set org.gnome.desktop.peripherals.mouse accel-profile 'flat'
gsettings set org.gnome.desktop.peripherals.mouse speed 0.25
echo "set workspaces and shortcuts"
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.desktop.wm.preferences num-workspaces 3
echo "set other gnome settings"
gsettings set org.gnome.mutter check-alive-timeout 20000
gsettings set org.gnome.desktop.interface enable-hot-corners false
gsettings set org.gnome.shell.app-switcher current-workspace-only true
echo "done"
;;
"git")
echo "setting up git config"
git config --global init.defaultBranch main
git config --global pager.branch false
git config --global credential.helper store
git config --global pull.rebase true
git config --global commit.gpgsign true
echo "all done"
;;
esac