2020-09-17 10:24:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DIR=$(readlink -f $(dirname $0))
|
|
|
|
. $DIR/../env.sh
|
|
|
|
|
2020-09-17 16:02:24 +00:00
|
|
|
# install basic gui stuff, including fonts/system utilties/keyring etc
|
2020-09-17 10:24:35 +00:00
|
|
|
case "$PM" in
|
|
|
|
apt)
|
2020-09-17 16:02:24 +00:00
|
|
|
# fonts
|
2020-09-17 10:24:35 +00:00
|
|
|
sudo apt install \
|
|
|
|
fonts-cascadia-code \
|
2020-09-18 04:16:15 +00:00
|
|
|
fonts-urw-base35 \
|
2020-09-20 09:52:57 +00:00
|
|
|
fonts-droid-fallback \
|
2020-09-17 10:24:35 +00:00
|
|
|
gucharmap
|
2020-09-17 16:02:24 +00:00
|
|
|
# network manager
|
|
|
|
sudo apt install \
|
|
|
|
network-manager network-manager-gnome
|
|
|
|
# bluetooth
|
|
|
|
if has-bluetooth; then
|
|
|
|
sudo apt install \
|
|
|
|
bluez bluez-tools blueman pulseaudio-module-bluetooth
|
2020-09-18 04:16:15 +00:00
|
|
|
sudo systemctl enable bluetooth
|
|
|
|
sudo systemctl start bluetooth
|
2020-09-17 16:02:24 +00:00
|
|
|
fi
|
2020-09-17 10:24:35 +00:00
|
|
|
;;
|
|
|
|
pacman)
|
2020-09-17 16:02:24 +00:00
|
|
|
# fonts
|
2020-09-18 18:01:58 +00:00
|
|
|
sudo pacman -S --needed \
|
2020-09-17 10:24:35 +00:00
|
|
|
freetype2 \
|
2020-09-20 09:52:57 +00:00
|
|
|
terminus-font \
|
2020-09-17 10:24:35 +00:00
|
|
|
ttf-cascadia-code \
|
2020-09-20 09:52:57 +00:00
|
|
|
ttf-droid \
|
2020-09-17 10:24:35 +00:00
|
|
|
gucharmap
|
2020-09-17 16:02:24 +00:00
|
|
|
# clipboard
|
2020-09-18 18:01:58 +00:00
|
|
|
sudo pacman -S --needed \
|
2020-09-17 16:02:24 +00:00
|
|
|
xclip xsel
|
|
|
|
# keyring
|
2020-09-18 18:01:58 +00:00
|
|
|
sudo pacman -S --needed \
|
2020-09-17 16:02:24 +00:00
|
|
|
gnome-keyring libsecret
|
|
|
|
# network manager
|
2020-09-18 18:01:58 +00:00
|
|
|
sudo pacman -S --needed \
|
2020-09-17 16:02:24 +00:00
|
|
|
networkmanager network-manager-applet
|
|
|
|
# bluetooth
|
|
|
|
if has-bluetooth; then
|
2020-09-18 18:01:58 +00:00
|
|
|
sudo pacman -S --needed \
|
2020-09-17 16:02:24 +00:00
|
|
|
bluez bluez-utils blueman pulseaudio-bluetooth xorg-xbacklight
|
2020-09-18 04:16:15 +00:00
|
|
|
sudo systemctl enable bluetooth
|
|
|
|
sudo systemctl start bluetooth
|
2020-09-17 16:02:24 +00:00
|
|
|
fi
|
2020-09-17 10:24:35 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-09-17 16:02:24 +00:00
|
|
|
|
2020-09-17 10:24:35 +00:00
|
|
|
# install hermit nerd font
|
|
|
|
if ! ls /usr/share/fonts | grep -i hurmit > /dev/null; then
|
|
|
|
if [ ! -f /tmp/hermit.zip ]; then
|
|
|
|
if in-china; then
|
|
|
|
git clone https://gitee.com/klesh/nerd-fonts.git /tmp/nerd-fonts
|
|
|
|
mv /tmp/nerd-fonts/Hermit-v2.1.0.zip /tmp/hermit.zip
|
|
|
|
rm -rf /tmp/nerd-fonts
|
|
|
|
else
|
|
|
|
echo 'for rest of the world'
|
|
|
|
HNF_PATH=$(curl -L https://github.com/ryanoasis/nerd-fonts/releases/latest | grep -i hermit | sed -n 's/.*href="\([^"]*\).*/\1/p')
|
|
|
|
HNF_URL="https://github.com$HNF_PATH"
|
|
|
|
curl -L $HNF_URL --output /tmp/hermit.zip || rm -rf /tmp/hermit.zip && false
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
unzip /tmp/hermit.zip -d /tmp/hermit
|
|
|
|
rm /tmp/hermit/*Windows*
|
|
|
|
sudo cp /tmp/hermit/* /usr/share/fonts
|
|
|
|
fi
|
|
|
|
|
2020-09-17 16:02:24 +00:00
|
|
|
# start network
|
|
|
|
sudo systemctl enable NetworkManager
|
|
|
|
sudo systemctl start NetworkManager
|
|
|
|
|
2020-09-17 10:24:35 +00:00
|
|
|
# configuration
|
|
|
|
sudo ln -sf /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d
|
|
|
|
sudo ln -sf /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d
|
|
|
|
sudo ln -sf /etc/fonts/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d
|
|
|
|
sudo cp $DIR/freetype2.sh /etc/profile.d/freetype2.sh
|
|
|
|
sudo cp $DIR/local.conf /etc/fonts/local.conf
|