-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqxpack
96 lines (85 loc) · 3.78 KB
/
qxpack
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
centerk(){ ressc=$(xrandr | grep '*' | head -n 1 | awk '{print $1}');screenw=$(echo $ressc | cut -d 'x' -f 1);screenh=$(echo $ressc | cut -d 'x' -f 2)
center_x=$(( ($screenw - $1) / 2 ));center_y=$(( ($screenh - $2) / 2 ));kgeo="${1}x${2}+$center_x+$center_y";echo "$kgeo";}
#----------------------------------------
script_path="$0"
script_full_path=$(realpath "$script_path")
script_directory=$(dirname "$script_full_path")
cd "$script_directory"
kdicon="$script_directory/common/Q4OSsebicon.png"
osarch=$(dpkg --print-architecture)
#------------------
#QLAPTOP
runqlaptop() {
rm -f "$script_directory/logs/qlaptop.log"
touch "$script_directory/logs/qlaptop.log"
chmod 666 "$script_directory/logs/qlaptop.log"
chmod +x laptop/qlaptop.sh
laptop/qlaptop.sh > logs/qlaptop.log 2>&1
}
#QTHEME
runqtheme() {
rm -f "$script_directory/logs/qtheme.log"
touch "$script_directory/logs/qtheme.log"
chmod 666 "$script_directory/logs/qtheme.log"
chmod +x theme/qtheme.sh
theme/qtheme.sh > logs/qtheme.log 2>&1
}
#QAPPS
runqapps ()
{
rm -f "$script_directory/logs/qapps.log"
touch "$script_directory/logs/qapps.log"
chmod 666 "$script_directory/logs/qapps.log"
chmod +x apps/qapps.sh
apps/qapps.sh $1 > logs/qapps.log 2>&1
}
#QPERF
runqperf() {
rm -f "$script_directory/logs/qperf.log"
touch "$script_directory/logs/qperf.log"
chmod 666 "$script_directory/logs/qperf.log"
chmod +x perfs/qperf.sh
perfs/qperf.sh > logs/qperf.log 2>&1
}
###################################################" MAIN MENU ##############################################
ktext="<font style='color:#ac6009'><strong>⏺ q4osXpack ⏺</strong></font><br><br>"
kdtitle="q4osXpack "
kdcaption="main menu"
if [ "$EUID" -eq 0 ]
then
kdialog --icon "$kdicon" --title "$kdtitle" --caption "$kdcaption" --error "This script must not be run as root. Please run it as normal user, elevated rights will be asked when needed. "
exit
fi
while true; do
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ktext="<font style='color:#ac6009'><strong>⏺ q4osXpack ⏺</strong></font><br><br>"
kdtext="$ktext
<font style='color:#828282'>►</font> Choose a script to launch:<br>
<font style='color:#828282'><em>(or hit cancel to quit)</em></font><br>"
if [ ! "$osarch" = "armhf" ]; then
menuchoice=$(kdialog --icon "$kdicon" --title "$kdtitle" --caption "$kdcaption" --geometry $(centerk 350 480) --menu "$kdtext" "qtheme" " ▬ Theme" "qperf" " ▬ Perf optimizations" "qlaptop" " ▬ Laptop configuration" "qapps" " ▬ Essential apps" "qapps2" " ▬ Extra apps" "qthtools" " ═ Theme tools ☺" "qsystools" " ═ System tools §" "winapps" " ─ Windows apps ¤" "qshcut" " … Create shortcuts »" "qhelp" " … Help ๏")
else
menuchoice=$(kdialog --icon "$kdicon" --title "$kdtitle" --caption "$kdcaption" --geometry $(centerk 350 480) --menu "$kdtext" "qtheme" " ▬ Theme" "qperf" " ▬ Perf optimizations" "qlaptop" " ▬ Laptop configuration" "qapps" " ▬ Essential apps" "qapps2" " ▬ Extra apps" "qthtools" " ═ Theme tools ☺" "qsystools" " ═ System tools §" "qshcut" " … Create shortcuts »" "qhelp" " … Help ๏")
fi
if [ $? -eq 1 ];then
break
else
case "$menuchoice" in
qtheme) runqtheme;;
qperf) runqperf;;
qapps) runqapps 1 ;;
qapps2) runqapps 2 ;;
qlaptop) runqlaptop;;
qthtools) chmod +x tools/themetools.sh;tools/themetools.sh;;
qsystools) chmod +x tools/systools.sh;tools/systools.sh;;
winapps) chmod +x apps/qwinapps.sh;apps/qwinapps.sh;;
#qsystools) chmod +x tools/systools.sh;tools/systools.sh;;
#winapps) chmod +x apps/winapps.sh;apps/winapps.sh;;
#qshcut) chmod +x common/createshcut.sh;common/createshcut.sh;;
#qhelp) chmod +x common/help.sh;common/help.sh;;
*) ;;
esac
fi
done
#############################################################################################################