-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathinstall-setup.bash
executable file
·108 lines (89 loc) · 3.95 KB
/
install-setup.bash
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
#!/bin/bash
# Run this script after running install.yml
set -euo pipefail
source functions.bash
confirm_user_is 'normal'
clear
idle_delay=1200
title_bar_buttons_on="true"
clock_show_date="true"
capslock_delete="true"
night_light="true"
helix_src_folder="$HOME/src/helix"
helix_config_folder="$HOME/.config/helix"
terminal_program=kitty # terminal program to use for desktop integration
#==============================================================================
# Set host name
#==============================================================================
read -rp "What is this computer's name? [$HOSTNAME] " hostname
if [[ ! -z "$hostname" ]]; then
hostnamectl set-hostname "$hostname"
fi
#==============================================================================
# Optional sub-pixel rendering
#==============================================================================
read -p "Use sub-pixel rendering? (recommended for monitors with less than 4k resolution) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
add_to_file "$HOME/.Xresources" "Xft.lcdfilter: lcddefault"
dconf write /org/gnome/settings-daemon/plugins/xsettings/antialiasing "'rgba'"
echo "Sub-pixel rendering on"
fi
#==============================================================================
# Gnome desktop settings
#==============================================================================
gsettings set org.gnome.desktop.session \
idle-delay $idle_delay
if [[ "${title_bar_buttons_on}" == "true" ]]; then
gsettings set org.gnome.desktop.wm.preferences \
button-layout 'appmenu:minimize,maximize,close'
fi
if [[ "${clock_show_date}" == "true" ]]; then
gsettings set org.gnome.desktop.interface \
clock-show-date true
fi
if [[ "${capslock_delete}" == "true" ]]; then
gsettings set org.gnome.desktop.input-sources \
xkb-options "['caps:backspace', 'terminate:ctrl_alt_bksp']"
fi
if [[ "${night_light}" == "true" ]]; then
gsettings set org.gnome.settings-daemon.plugins.color \
night-light-enabled true
fi
#==============================================================================
# Install and setup various programs
#==============================================================================
curl -fsSL https://deno.land/x/install/install.sh | sh
echo
curl https://rclone.org/install.sh | sudo bash || true
if [ ! -d "$HOME/.fzf" ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git "$HOME/.fzf"
"$HOME/.fzf/install"
fi
if ! [ -x "$(command -v cargo)" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup component add rust-analyzer
fi
if ! [ -x "$(command -v hx)" ]; then
mkdir -p "$helix_src_folder"
git clone https://github.com/helix-editor/helix "$helix_src_folder"
git -C "$helix_src_folder" checkout 23.05
cargo install --locked --path "$helix_src_folder"/helix-term
[ ! -e "$helix_config_folder"/runtime ] && ln -s "$helix_src_folder"/runtime "$helix_config_folder" # if there is no symlink create one to the source directory
cp "$helix_src_folder"/contrib/helix.png "$HOME/.icons"
cp "$helix_src_folder"/contrib/Helix.desktop "$HOME/.local/share/applications"
sed -i "s|Exec=hx %F|Exec=$terminal_program hx %F|g;s|Terminal=true|Terminal=false|g" "$HOME/.local/share/applications/Helix.desktop"
fi
touch "$HOME/Templates/text-file.txt" # create template file for nautilus
read -p "Open Firefox on pages for installing extensions and improving privacy? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
firefox https://addons.mozilla.org/en-GB/firefox/addon/ublock-origin/ \
https://addons.mozilla.org/en-US/firefox/addon/surfingkeys_ff/ \
https://addons.mozilla.org/en-US/firefox/addon/copy-selection-as-markdown/ \
https://restoreprivacy.com/firefox-privacy/ \
https://addons.mozilla.org/en-US/firefox/addon/keepassxc-browser/ &
fi
echo
echo "Everything is installed and setup, please log out or reboot."