Skip to content

Commit 72ca6db

Browse files
committed
update source to 4.0
1 parent ef39266 commit 72ca6db

20 files changed

+822
-847
lines changed

src/linuxtoys.sh

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
# functions
33

44
# updater
5-
current_ltver="3.2"
5+
current_ltver="4.0"
66
ver_upd () {
77
local ver
88
ver=$(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/ver)
99
if [[ "$ver" != "$current_ltver" ]]; then
10-
if whiptail --title "$msg001" --yesno "$msg002" 8 78; then
11-
local title="$msg001"
12-
local msg="$msg157"
13-
_msgbox_
10+
if zenity --question --title "$msg001" --text "$msg002" --width 300 --height 300; then
11+
zeninf "$msg157"
1412
xdg-open https://github.com/psygreg/linuxtoys/releases/latest
1513
fi
1614
fi
@@ -22,51 +20,54 @@ ver_upd () {
2220
. /etc/os-release
2321
wget -q -O - "https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/README.md" > /dev/null || { whiptail --title "Disconnected" --msgbox "LinuxToys requires an internet connection to proceed." 8 78; exit 1; }
2422
# call linuxtoys turbobash lib
23+
sleep 1
2524
source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/linuxtoys.lib)
2625
# logger
2726
logfile="$HOME/.local/linuxtoys-log.txt"
2827
_log_
2928
# language and upd checks
3029
_lang_
3130
source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/lang/${langfile})
31+
sleep 1
3232
ver_upd
3333

3434
# main menu
35-
while :; do
35+
while true; do
3636

37-
CHOICE=$(whiptail --title "LinuxToys" --menu "LinuxToys ${current_ltver}" 25 78 16 \
38-
"0" "$msg120" \
39-
"1" "$msg121" \
40-
"2" "$msg122" \
41-
"3" "${msg123}*" \
42-
"4" "${msg143}*" \
43-
"5" "$msg227" \
44-
"6" "$msg199" \
45-
"" "" \
46-
"" "" \
47-
"8" "$msg124" \
48-
"9" "GitHub" \
49-
"10" "$msg059" 3>&1 1>&2 2>&3)
37+
CHOICE=$(zenity --list --title "LinuxToys" \
38+
--column="$msg274" \
39+
"$msg120" \
40+
"$msg121" \
41+
"$msg122" \
42+
"${msg123}" \
43+
"${msg143}" \
44+
"$msg227" \
45+
"$msg199" \
46+
"" \
47+
"$msg124" \
48+
"GitHub" \
49+
"${msg275}" \
50+
"$msg059" \
51+
--height=500 --width=360)
5052
#"7" "UniWine" \ -- disabled option
5153

52-
exitstatus=$?
53-
if [ $exitstatus != 0 ]; then
54-
# Exit the script if the user presses Esc
55-
find "$HOME" -maxdepth 1 -type f -name '*supermenu.sh' -exec rm -f {} + && break
56-
fi
54+
if [ $? -ne 0 ]; then
55+
find "$HOME" -maxdepth 1 -type f -name '*.sh' -exec rm -f {} + && break
56+
fi
5757

5858
case $CHOICE in
59-
0) supmenu="usupermenu" && _invoke_ ;;
60-
1) supmenu="osupermenu" && _invoke_ ;;
61-
2) supmenu="gsupermenu" && _invoke_ ;;
62-
3) supmenu="esupermenu" && _invoke_ ;;
63-
4) supmenu="dsupermenu" && _invoke_ ;;
64-
5) subscript="pdefaults" && _invoke_ ;;
65-
6) supmenu="csupermenu" && _invoke_ ;;
59+
"$msg120") supmenu="usupermenu" && _invoke_ ;;
60+
"$msg121") supmenu="osupermenu" && _invoke_ ;;
61+
"$msg122") supmenu="gsupermenu" && _invoke_ ;;
62+
"${msg123}") supmenu="esupermenu" && _invoke_ ;;
63+
"${msg143}") supmenu="dsupermenu" && _invoke_ ;;
64+
"$msg227") subscript="pdefaults" && _invoke_ ;;
65+
"$msg199") supmenu="csupermenu" && _invoke_ ;;
6666
# 7) subscript="uniwine" && _invoke_ ;; -- disabled option
67-
8) whiptail --title "LinuxToys v${current_ltver}" --msgbox "$msg125" 8 78 ;;
68-
9) xdg-open https://github.com/psygreg/linuxtoys ;;
69-
10 | q) break ;;
67+
"$msg124") zeninf "$msg125";;
68+
"GitHub") xdg-open https://github.com/psygreg/linuxtoys ;;
69+
"${msg275}") xdg-open https://ko-fi.com/psygreg ;;
70+
"$msg059") break ;;
7071
*) echo "Invalid Option" ;;
7172
esac
7273
done

src/resources/other/kupid/kupid-upd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/
44
_lang_
55
source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/lang/${langfile})
66
# updater
7-
if whiptail --title "$msg126" --yesno "$msg127" 8 78; then
7+
if zenity --question --title "$msg126" --text "$msg127" --width 360 --height 300; then
88
if [ -f "$HOME/.local/kernelsetting-lts" ]; then
99
bash <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/resources/other/psycachy/psycachy-install.sh) --lts
1010
elif [ -f "$HOME/.local/kernelsetting" ]; then

src/resources/other/psycachy/psycachy-install.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ if [ -n "$1" ]; then
7272
fi
7373

7474
# menu
75-
while :; do
75+
while true; do
7676

77-
CHOICE=$(whiptail --title "Kernel Version" --menu "Select:" 25 78 16 \
78-
"Standard" "$kver_psycachy" \
79-
"LTS" "$kver_lts" \
80-
"Latest" "$_kv_latest" \
81-
"Cancel" "" 3>&1 1>&2 2>&3)
77+
CHOICE=$(zenity --list --title "Psycachy Kernel Installer" --text "Select the kernel version to install:" \
78+
--column "Versions" \
79+
"Standard" \
80+
"LTS" \
81+
"Latest (CachyOS, may not work)" \
82+
"Cancel" \
83+
--width 360 --height 360 )
8284

83-
exitstatus=$?
84-
if [ $exitstatus != 0 ]; then
85-
# Exit the script if the user presses Esc
86-
exit 2
85+
if [ $? -ne 0 ]; then
86+
exit 0
8787
fi
8888

8989
case $CHOICE in

src/resources/subscripts/android-studio-in.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ depcheck () {
88
elif [[ "$ID_LIKE" =~ (rhel|fedora) ]] || [[ "$ID" =~ (fedora) ]]; then
99
local _packages=(zlib.i686 ncurses-libs.i686 bzip2-libs.i686)
1010
else
11-
local title="Android Studio"
12-
local msg="$msg077"
11+
nonfatal "$msg077"
1312
exit 1
1413
fi
1514
_install_

src/resources/subscripts/docker-installer.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ docker_in () {
4848
. /etc/os-release
4949
source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/linuxtoys.lib)
5050
dep_check
51-
if whiptail --title "Docker + Portainer CE Setup" --yesno "This will install Docker Engine and Portainer CE to manage it through a web UI. Proceed?" 8 78; then
51+
if zenity --question --text "This will install Docker Engine and Portainer CE to manage it through a web UI. Proceed?" --width 360 --height 300; then
5252
docker_in
53-
title="Docker + Portainer CE Setup"
54-
msg="Setup complete. Your Portainer dashboard will open in your web browser now."
55-
_msgbox_
53+
zeninf "Setup complete. Your Portainer dashboard will open in your web browser now."
5654
xdg-open https://localhost:9443
5755
exit 0
5856
fi

src/resources/subscripts/grub-btrfs-installer.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
dep_check () {
66

77
if ! dpkg -l | grep -q grub-efi; then
8-
local title="Cancelled"
9-
local msg="No GRUB found."
10-
_msgbox_
8+
nonfatal "No GRUB found."
119
exit 1
1210
else
1311
local _packages=()
@@ -82,12 +80,8 @@ grubtrfs_in () {
8280
. /etc/os-release
8381
source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/linuxtoys.lib)
8482
dep_check
85-
if whiptail --title "Grub-Btrfs Installer" --yesno "This will list snapshots in your GRUB. It will only work if your root filesystem is btrfs. Proceed?" 8 78; then
83+
if zenity --question --text "This will list snapshots in your GRUB. It will only work if your root filesystem is btrfs. Proceed?" --width 360 --height 300; then
8684
grubtrfs_in
87-
title="Grub-Btrfs Installer"
88-
msg="Installation successful."
89-
_msgbox_
90-
cd ..
91-
rm -rf grub-btrfs
85+
zeninf "Installation successful."
9286
exit 0
9387
fi

src/resources/subscripts/iwdwifi.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ iwd_in () {
2626
sudo systemctl restart NetworkManager
2727
return 0
2828
else
29-
local title="Cancelled"
30-
local msg="No WiFi device found."
31-
_msgbox_
29+
nonfatal "No WiFi device found."
3230
return 2
3331
fi
3432

@@ -44,32 +42,30 @@ iwd_rm () {
4442
sudo systemctl restart NetworkManager
4543
return 0
4644
else
47-
local title="Cancelled"
48-
local msg="iwd.conf file not found. IWD was not enabled in this system."
49-
_msgbox_
45+
nonfatal "iwd.conf file not found. IWD was not enabled in this system."
5046
return 1
5147
fi
5248

5349
}
5450

5551
# menu
56-
while :; do
52+
while true; do
5753

58-
CHOICE=$(whiptail --title "iNet Wireless Daemon" --menu "" 25 78 16 \
59-
"0" "Install" \
60-
"1" "Remove" \
61-
"2" "Cancel" 3>&1 1>&2 2>&3)
54+
CHOICE=$(zenity --list --title "iNet Wireless Daemon" \
55+
--column="Options" \
56+
"Install" \
57+
"Remove" \
58+
"Cancel" \
59+
--height=360 --width=300)
6260

63-
exitstatus=$?
64-
if [ $exitstatus != 0 ]; then
65-
# Exit the script if the user presses Esc
61+
if [ $? -ne 0 ]; then
6662
break
6763
fi
6864

6965
case $CHOICE in
70-
0) iwd_in && break;;
71-
1) iwd_rm && break;;
72-
2 | q) break ;;
66+
"Install") iwd_in && break;;
67+
"Remove") iwd_rm && break;;
68+
"Cancel") break ;;
7369
*) echo "Invalid Option" ;;
7470
esac
7571

src/resources/subscripts/jetbrainsmenu.lib

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ toolbox_in () {
392392
wget https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-2.6.2.41321.tar.gz
393393
# first installation
394394
if [ ! -d "/opt/toolbox" ]; then
395-
if whiptail --title "Jetbrains Toolbox" --yesno "$msg174" 12 78; then
395+
if zenity --question --text "$msg174" --width 360 --height 300; then
396396
insta fuse
397397
tar -xvzf jetbrains-toolbox-2.6.2.41321.tar.gz
398398
sleep 1
@@ -415,9 +415,7 @@ toolbox_in () {
415415
source ~/.bashrc
416416
fi
417417
else
418-
local title="$msg030"
419-
local msg="$msg175"
420-
_msgbox_
418+
zeninf "$msg175"
421419
return
422420
fi
423421
else # update

src/resources/subscripts/pdefaults.sh

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ optimizer () {
3131
if [[ "$ID_LIKE" == *debian* ]] || [[ "$ID_LIKE" == *ubuntu* ]] || [ "$ID" == "debian" ] || [ "$ID" == "ubuntu" ]; then
3232
debfixer_lib
3333
# summon installer
34-
if whiptail --title "CachyOS Kernel" --yesno "$msg150" 12 78; then
34+
if zenity --question --text "$msg150" --width 360 --height 300; then
3535
psycachy_lib
3636
kupid_lib
3737
fi
@@ -40,43 +40,34 @@ optimizer () {
4040
dpkg --list | grep -v $(uname -r) | grep -E 'custom-kernel-[0-9]|custom-kernel-headers-[0-9]' | awk '{print $2" "$3}' | sort -k2,2 | head -n -2 | awk '{print $1}' | xargs sudo apt purge
4141
# run system-agnostic optimizations
4242
sysag_run
43-
local title="$msg006"
44-
local msg="$msg036"
45-
_msgbox_
43+
zeninf "$msg036"
4644
elif [[ "$ID_LIKE" =~ (rhel|fedora) ]] || [ "$ID" == "fedora" ]; then
47-
if whiptail --title "CachyOS Kernel" --yesno "$msg150" 12 78; then
45+
if zenity --question --text "$msg150" --width 360 --height 300; then
4846
fedora_cachyos_menu_lib
4947
fi
5048
# run system-agnostic optimizations
5149
sysag_run
5250
elif [[ "$ID" =~ ^(arch)$ ]] || [[ "$ID_LIKE" == *arch* ]] || [[ "$ID_LIKE" == *archlinux* ]]; then
53-
if whiptail --title "CachyOS Kernel" --yesno "$msg150" 12 78; then
51+
if zenity --question --text "$msg150" --width 360 --height 300; then
5452
cachyos_arch_lib
5553
fi
5654
# run system-agnostic optimizations
5755
sysag_run
58-
local title="$msg006"
59-
local msg="$msg036"
60-
_msgbox_
56+
zeninf "$msg036"
6157
elif [ "$ID" == "cachyos" ]; then
6258
sysag_run
63-
local title="$msg006"
64-
local msg="$msg036"
65-
_msgbox_
59+
zeninf "$msg036"
6660
else
67-
local title="$msg074"
68-
local msg="$msg077"
69-
_msgbox_
61+
nonfatal "$msg077"
62+
exit 1
7063
fi
7164
if echo "$XDG_CURRENT_DESKTOP" | grep -qi 'gnome'; then
7265
dconf write /org/gnome/mutter/check-alive-timeout "20000"
7366
fi
7467
wget https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/resources/other/autopatch.state
7568
sudo mv autopatch.state /.autopatch.state
7669
else
77-
local title="AutoPatcher"
78-
local msg="$msg234"
79-
_msgbox_
70+
nonfatal "$msg234"
8071
fi
8172

8273
}
@@ -88,23 +79,23 @@ source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/
8879
_lang_
8980
source <(curl -s https://raw.githubusercontent.com/psygreg/linuxtoys/refs/heads/main/src/lang/${langfile})
9081
# menu
91-
while :; do
82+
while true; do
9283

93-
CHOICE=$(whiptail --title "Power Optimizer" --menu "$msg229" 25 78 16 \
94-
"0" "Desktop" \
95-
"1" "Laptop" \
96-
"2" "Cancel" 3>&1 1>&2 2>&3)
84+
CHOICE=$(zenity --list --title "Power Optimizer" --text "$msg229" \
85+
--column "Options" \
86+
"Desktop" \
87+
"Laptop" \
88+
"Cancel" \
89+
--width 300 --height 330 )
9790

98-
exitstatus=$?
99-
if [ $exitstatus != 0 ]; then
100-
# Exit the script if the user presses Esc
101-
break
91+
if [ $? -ne 0 ]; then
92+
exit 0
10293
fi
10394

10495
case $CHOICE in
105-
0) optimizer && break ;;
106-
1) optimizer && psave_lib && break ;;
107-
2 | q) break ;;
96+
"Desktop") optimizer && break ;;
97+
"Laptop") optimizer && psave_lib && break ;;
98+
"Cancel") break ;;
10899
*) echo "Invalid Option" ;;
109100
esac
110101
done

0 commit comments

Comments
 (0)