From 02038d381c38a983454ad06b4ef0f9c947c1ec40 Mon Sep 17 00:00:00 2001 From: Ali Hatami Tajik Date: Sat, 8 Apr 2023 00:11:37 +0330 Subject: [PATCH] Update setup script --- setup.sh | 32 ++++++++++++++++++++++--------- src/scripts/python/changemouse.py | 2 +- src/scripts/setupmonitor.sh | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index 1904692..ce0f2fd 100755 --- a/setup.sh +++ b/setup.sh @@ -18,32 +18,46 @@ 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 ...' -# TODO -sleep 1 - +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 scripts ...' -# TODO -sleep 1 +sudo cp -r src/scripts/python/* /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 draw_progress_bar 45 log 'Installing config files ...' # TODO -sleep 1 draw_progress_bar 65 log 'Configuring Logger ...' # TODO -sleep 1 draw_progress_bar 85 log 'Copying rules to udev ...' +sudo cp -r src/rules/* /usr/lib/udev/rules.d +sudo udevadm control --reload-rules +sudo udevadm trigger + + +draw_progress_bar 95 +log 'Install PCIE Driver' # TODO -sleep 1 draw_progress_bar 100 destroy_scroll_area \ No newline at end of file diff --git a/src/scripts/python/changemouse.py b/src/scripts/python/changemouse.py index 37ab920..7ffb3c7 100644 --- a/src/scripts/python/changemouse.py +++ b/src/scripts/python/changemouse.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Change mouse script diff --git a/src/scripts/setupmonitor.sh b/src/scripts/setupmonitor.sh index 40552d7..b3aa609 100755 --- a/src/scripts/setupmonitor.sh +++ b/src/scripts/setupmonitor.sh @@ -7,6 +7,6 @@ flock -n 100 || exit 1 sleep 1 # wait until all changes take place xrandr --auto - python3 /usr/bin/local/python/setupmonitor.py + python3 /usr/bin/local/setupmonitor.py echo $(data) - INFO - Setup Monitor Done >> $SONOLOG ) 100> $MONITOR_LOCK \ No newline at end of file