-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_before-install_ubuntu_packages.sh.tmpl
49 lines (38 loc) · 1.43 KB
/
run_once_before-install_ubuntu_packages.sh.tmpl
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
#!//bin/bash
# Packages hash: {{ include "ubuntu/snaps.txt" | sha256sum }}
# Packages hash: {{ include "ubuntu/snaps-classic.txt" | sha256sum }}
# Packages hash: {{ include "ubuntu/apt.txt" | sha256sum }}
# Packages hash: {{ include "ubuntu/favorite-apps.txt" | sha256sum }}
OS="{{ .chezmoi.os }}"
DISTRO="{{ .chezmoi.osRelease.id }}"
echo $OS
echo $DISTRO
if [[ $OS -ne "linux" && $DISTRO -ne 'ubuntu' ]]; then
exit 0
fi;
cd "{{ .chezmoi.workingTree }}"
SNAPS=$(cat ubuntu/snaps.txt)
SNAPS_CLASSIC=$(cat ubuntu/snaps-classic.txt)
APT_PACKAGES=$(cat ubuntu/apt.txt)
echo "Adding external repositories"
sudo add-apt-repository ppa:libreoffice/ppa
echo "Installing apt packages"
sudo apt update
for apt_package in $APT_PACKAGES;
do
sudo apt install $apt_package;
done
echo "Installing snaps:"
for current_snap in $SNAPS;
do
sudo snap install $current_snap;
done
for current_snap in $SNAPS_CLASSIC;
do
sudo snap install $current_snap --classic;
done
# Pin some applications in the Dash
# use `ls /usr/share/applications /var/lib/snapd/desktop/applications | grep -i <package>` to find the application launcher name
FAVORITE_APP=$(cat ubuntu/favorite-apps.txt | xargs -I {} echo -n "'{}', " | sed 's/, $//')
#gsettings set org.gnome.shell favorite-apps "['firefox_firefox.desktop', 'google-chrome.desktop', 'code.desktop', 'org.gnome.Terminal.desktop', 'zoom-client_zoom-client.desktop']"
gsettings set org.gnome.shell favorite-apps "[$FAVORITE_APP]"