feat: auto install laptop utilities for arch

This commit is contained in:
Klesh Wong 2021-08-31 09:34:23 +08:00
parent 4da070528c
commit b4fbe47f23
2 changed files with 14 additions and 1 deletions

4
env.sh
View File

@ -74,6 +74,10 @@ has_fish() {
has_cmd "$1" has_cmd "$1"
} }
is_laptop() {
[ -f /sys/class/power_supply/BAT0/capacity ]
}
enhance_vim() { enhance_vim() {
[ "$VIM_MODE" = "enhanced" ] && has_cmd nvim [ "$VIM_MODE" = "enhanced" ] && has_cmd nvim
} }

View File

@ -30,6 +30,11 @@ case "$PM" in
sudo systemctl enable bluetooth sudo systemctl enable bluetooth
sudo systemctl start bluetooth sudo systemctl start bluetooth
fi fi
# laptop utitlies
if is_laptop; then
sudo apt install \
acpilght tlp
fi
;; ;;
pacman) pacman)
# for setting up default programs: exo-preferred-applications # for setting up default programs: exo-preferred-applications
@ -52,10 +57,14 @@ case "$PM" in
# bluetooth # bluetooth
if has_bluetooth; then if has_bluetooth; then
sudo pacman -S --noconfirm --needed \ sudo pacman -S --noconfirm --needed \
bluez bluez-utils blueman acpilight bluez bluez-utils blueman
sudo systemctl enable bluetooth sudo systemctl enable bluetooth
sudo systemctl start bluetooth sudo systemctl start bluetooth
fi fi
if is_laptop; then
sudo pacman -S --noconfirm --needed \
acpilght tlp
fi
;; ;;
esac esac