#!/bin/env bash source ./src/scripts/utils/source.sh source ./src/scripts/utils/progressbar.sh while getopts 'v' OPTION; do case "$OPTION" in v) _V=1 ;; ?) echo "usage: ./setup.sh [-v]" >&2 exit 1 ;; esac done enable_trapping draw_progress_bar 0 log '.: Setting up sono-os v0.1.0 :.' check_superuser sleep 1 draw_progress_bar 5 log 'Installing dependancies ...' sudo apt -qq update draw_progress_bar 10 sudo apt -qq install -y python3-pip build-essential draw_progress_bar 15 log 'Installing pyxlib and pyudev ...' pip3 install pyxlib pyudev -q draw_progress_bar 20 log 'Installing X scripts ...' sudo cp -r src/scripts/xscript/* /usr/local/bin draw_progress_bar 23 sudo cp src/scripts/setupmonitor.sh /usr/local/bin draw_progress_bar 27 sudo chmod +x /usr/local/bin/setupmonitor.sh draw_progress_bar 30 sudo chmod +x /usr/local/bin/changemouse.py log 'Installing Sleep scripts ...' sudo cp src/scripts/utils/socknix.py /usr/local/bin draw_progress_bar 33 sudo chmod +x /usr/local/bin/socknix.py draw_progress_bar 35 sudo cp src/scripts/sleeputil.sh /lib/systemd/system-sleep/ draw_progress_bar 36 sudo chmod +x /lib/systemd/system-sleep/sleeputil.sh draw_progress_bar 45 log 'Installing config files ...' # TODO draw_progress_bar 65 log 'Configuring Logger ...' # TODO draw_progress_bar 85 log 'Copying rules to udev ...' sudo cp -r src/rules/* /usr/lib/udev/rules.d sudo cp src/rules/90-usb-storage.rules /etc/udev/rules.d sudo cp src/rules/90-dvd-storage.rules /etc/udev/rules.d sudo udevadm control --reload-rules sudo udevadm trigger draw_progress_bar 90 sudo cp src/scripts/utils/usb/usb-storage-action /usr/local/bin/ sudo chmod +x /usr/local/bin/usb-storage-action sudo cp src/scripts/utils/usb/addUsbScript.sh /usr/local/bin/ sudo chmod +x /usr/local/bin/addUsbScript.sh sudo cp src/scripts/utils/usb/usb-socket-sono.socket /etc/systemd/system sudo cp src/scripts/utils/usb/usb-socket-sono.service /etc/systemd/system sudo systemctl enable usb-socket-sono.socket sudo systemctl enable usb-socket-sono.service sudo systemctl start usb-socket-sono.socket sudo systemctl start usb-socket-sono.service sudo cp src/scripts/utils/dvd/dvd-storage-action /usr/local/bin/ sudo chmod +x /usr/local/bin/dvd-storage-action sudo cp src/scripts/utils/dvd/addDvdScript.sh /usr/local/bin/ sudo chmod +x /usr/local/bin/addDvdScript.sh sudo cp src/scripts/utils/dvd/dvd-socket-sono.socket /etc/systemd/system sudo cp src/scripts/utils/dvd/dvd-socket-sono.service /etc/systemd/system sudo systemctl enable dvd-socket-sono.socket sudo systemctl enable dvd-socket-sono.service sudo systemctl start dvd-socket-sono.socket sudo systemctl start dvd-socket-sono.service draw_progress_bar 95 log 'Install PCIE Driver' # TODO draw_progress_bar 100 destroy_scroll_area