dotfiles/gui/sysutils.sh

97 lines
3.2 KiB
Bash
Raw Normal View History

2020-11-21 18:07:26 +00:00
#!/bin/sh
set -e
DIR=$(dirname "$(readlink -f "$0")")
. "$DIR/../env.sh"
log 'Setting up system utilities X11 ibus keyring dunst clipboard screenshot thunar network bluetooth'
case "$PM" in
apt)
sudo apt install -y \
xorg libx11-dev libxft-dev libxinerama-dev libxcursor-dev \
libxrandr-dev arandr autorandr \
pavucontrol \
ibus ibus-table ibus-table-wubi \
gnome-keyring \
xss-lock \
nitrogen \
network-manager network-manager-gnome \
exfat-utils \
dunst \
xclip xsel xdotool \
libnotify-bin \
flameshot scrot \
thunar gvfs-bin gvfs-backends thunar-archive-plugin file-roller tumbler
# bluetooth
if has_bluetooth; then
sudo apt install \
bluez bluez-tools blueman pulseaudio-module-bluetooth
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
fi
# laptop utitlies
if is_laptop; then
sudo apt install \
acpilght tlp
fi
2020-11-21 18:07:26 +00:00
;;
pacman)
# for setting up default programs: exo-preferred-applications
sudo pacman -S --noconfirm --needed \
xorg-server xorg-xinit xorg-xrandr xorg-xev xorg-xprop \
arandr autorandr \
alsa-firmware alsa-utils alsa-plugins pulseaudio-alsa pipewire-pulse pavucontrol \
2020-11-21 18:07:26 +00:00
ibus ibus-table ibus-table-chinese \
gnome-keyring \
xss-lock \
nitrogen \
networkmanager network-manager-applet \
exfat-utils \
exo \
dunst \
xclip xsel xdotool \
gnome-keyring libsecret \
flameshot scrot \
thunar gvfs-smb gvfs-mtp thunar-archive-plugin file-roller tumbler
# bluetooth
if has_bluetooth; then
sudo pacman -S --noconfirm --needed \
bluez bluez-utils blueman
2020-11-21 18:07:26 +00:00
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
# bluetoothctl devices
# bluetoothctl pair <ADDR>
# bluetoothctl trust <ADDR>
# bluetoothctl connect <ADDR>
2020-11-21 18:07:26 +00:00
fi
if is_laptop; then
sudo pacman -S --noconfirm --needed \
acpilght tlp
fi
2020-11-21 18:07:26 +00:00
;;
esac
# start network
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
2021-08-26 13:13:36 +00:00
sudo systemctl enable autorandr
sudo systemctl start autorandr
2020-11-21 18:07:26 +00:00
lnsf "$DIR/dunst/dunstrc" "$XDG_CONFIG_HOME/dunst/dunstrc"
lnsf "$DIR/thunar/uca.xml" "$XDG_CONFIG_HOME/Thunar/uca.xml"
echo for non-root user to change backlight, add following rule to /etc/udev/rules.d/backlight.rules
echo ```
echo ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", GROUP="video", MODE="0664"
echo ```
echo for intel_backlight:
echo ```
echo RUN+="/bin/chgrp video /sys/class/backlight/intel_backlight/brightness"
echo RUN+="/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness"
echo ```
2021-09-15 15:08:44 +00:00
echo for amd ryzen laptop add "acpi_backlight=vendor" to /etc/default/grub and then run
echo sudo grub-mkconfig -o /boot/grub/grub.cfg