Skip to content

Commit 659a8bc

Browse files
Merge pull request #36 from prschopf/main
Muitas atualizações
2 parents c952d13 + 54c4a4b commit 659a8bc

51 files changed

Lines changed: 261 additions & 300 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

usr/share/biglinux/biglinux-settings/ai/chatai.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
# check current status
4+
# action=$1
45
if [ "$1" == "check" ]; then
56
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
67
if grep -q "plugin=ChatAI-Plasmoid" "$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc"; then
@@ -30,10 +31,11 @@ if [ "$1" == "check" ]; then
3031

3132

3233
# change the state
34+
# action=$1
35+
# state=$2
3336
elif [ "$1" == "toggle" ]; then
34-
state="$2"
3537
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"Plasma"* ]];then
36-
if [ "$state" == "true" ]; then
38+
if [ "$2" == "true" ]; then
3739
# check and download chatai
3840
if ! kpackagetool6 -t Plasma/Applet -l 2>/dev/null | grep -q "ChatAI-Plasmoid"; then
3941
curl -sL https://api.github.com/repos/DenysMb/ChatAI-Plasmoid/releases/latest | grep "tarball_url" | cut -d'"' -f4 | xargs curl -L -o /tmp/ChatAI-Plasmoid-latest.tar.gz
@@ -70,23 +72,23 @@ elif [ "$1" == "toggle" ]; then
7072
exitCode=$?
7173
fi
7274
# elif [[ "$XDG_CURRENT_DESKTOP" == *"GNOME"* ]];then
73-
# if [ "$state" == "true" ]; then
75+
# if [ "$2" == "true" ]; then
7476
# some command
7577
# exitCode=$?
7678
# else
7779
# some command
7880
# exitCode=$?
7981
# fi
8082
# elif [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]];then
81-
# if [ "$state" == "true" ]; then
83+
# if [ "$2" == "true" ]; then
8284
# some command
8385
# exitCode=$?
8486
# else
8587
# some command
8688
# exitCode=$?
8789
# fi
8890
# elif [[ "$XDG_CURRENT_DESKTOP" == *"Cinnamon"* ]] || [[ "$XDG_CURRENT_DESKTOP" == *"X-Cinnamon"* ]];then
89-
# if [ "$state" == "true" ]; then
91+
# if [ "$2" == "true" ]; then
9092
# some command
9193
# exitCode=$?
9294
# else

usr/share/biglinux/biglinux-settings/ai/chatbox.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
55
export TEXTDOMAIN=biglinux-settings
66

77
# check current status
8+
# action=$1
89
if [ "$1" == "check" ]; then
910
if pacman -Q chatbox-bin &>/dev/null; then
1011
echo "true"
@@ -13,14 +14,13 @@ if [ "$1" == "check" ]; then
1314
fi
1415

1516
# change the state
17+
# action=$1
18+
# state=$2
1619
elif [ "$1" == "toggle" ]; then
17-
state="$2"
18-
if [ "$state" == "true" ]; then
20+
if [ "$2" == "true" ]; then
1921
pkexec $PWD/ai/chatboxRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
20-
exitCode=$?
2122
else
2223
pkexec $PWD/ai/chatboxRun.sh "uninstall" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
23-
exitCode=$?
2424
fi
25-
exit $exitCode
25+
exit $?
2626
fi

usr/share/biglinux/biglinux-settings/ai/comfyUI.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
55
export TEXTDOMAIN=biglinux-settings
66

77
# check current status
8+
# action=$1
89
if [ "$1" == "check" ]; then
910
if [ -d "$HOME/ComfyUI" ]; then
1011
echo "true"
@@ -13,9 +14,10 @@ if [ "$1" == "check" ]; then
1314
fi
1415

1516
# change the state
17+
# action=$1
18+
# state=$2
1619
elif [ "$1" == "toggle" ]; then
17-
state="$2"
18-
if [ "$state" == "true" ]; then
20+
if [ "$2" == "true" ]; then
1921
vgaList=$(lspci | grep -iE "VGA|3D|Display")
2022
if [[ -z "$(echo $vgaList | grep -Ei '(nvidia|radeon|amd|\bati)')" ]]; then
2123
zenityText=$"AMD/Nvidia GPU not found!"
@@ -29,10 +31,8 @@ elif [ "$1" == "toggle" ]; then
2931
fi
3032
# install comfyUI as user
3133
$PWD/ai/comfyUIInstall.sh "install"
32-
exitCode=$?
3334
else
3435
$PWD/ai/comfyUIInstall.sh "uninstall"
35-
exitCode=$?
3636
fi
37-
exit $exitCode
37+
exit $?
3838
fi
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#!/bin/bash
2+
23
# check current status
4+
# action=$1
35
if [ "$1" == "check" ]; then
46
if [ -n "$(ps aux | grep -i "$HOME/ComfyUI/bin/python $HOME/ComfyUI/main.py" | grep -v grep)" ]; then
57
echo "true"
68
else
79
echo "false"
810
fi
911

12+
# change the state
13+
# action=$1
14+
# state=$2
1015
elif [ "$1" == "toggle" ]; then
11-
state="$2"
12-
if [ "$state" == "true" ]; then
16+
if [ "$2" == "true" ]; then
1317
$HOME/ComfyUI/bin/python $HOME/ComfyUI/main.py --listen 0.0.0.0 > $HOME/ComfyUI/start.log 2>&1 &
1418
sleep 5
15-
exitCode=$?
1619
else
1720
kill $(ps aux | grep -i "$HOME/ComfyUI/bin/python $HOME/ComfyUI/main.py" | grep -v grep | awk '{print $2}')
18-
exitCode=$?
1921
fi
20-
exit $exitCode
22+
exit $?
2123
fi

usr/share/biglinux/biglinux-settings/ai/krita.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
55
export TEXTDOMAIN=biglinux-settings
66

77
# check current status
8+
# action=$1
89
if [ "$1" == "check" ]; then
910
if [[ -d "$HOME/.local/share/krita/pykrita/ai_diffusion" ]] && pacman -Q krita &>/dev/null; then
1011
echo "true"
@@ -13,9 +14,10 @@ if [ "$1" == "check" ]; then
1314
fi
1415

1516
# change the state
17+
# action=$1
18+
# state=$2
1619
elif [ "$1" == "toggle" ]; then
17-
state="$2"
18-
if [ "$state" == "true" ]; then
20+
if [ "$2" == "true" ]; then
1921
if ! pacman -Q krita &>/dev/null; then
2022
pkexec $PWD/ai/kritaRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
2123
fi
@@ -27,11 +29,13 @@ elif [ "$1" == "toggle" ]; then
2729
mkdir -p $HOME/.local/share/krita/actions/
2830
cp $HOME/.local/share/krita/pykrita/ai_diffusion/ai_diffusion.action $HOME/.local/share/krita/actions/
2931
kwriteconfig6 --file kritarc --group "python" --key "enable_ai_diffusion" "true"
30-
31-
zenityText=$"Generative AI for Krita has been successfully installed.\n\nOpen Krita, open an existing drawing or create a new one.\nIn the top panel go to Settings > Panels > check the AI Image Generation box.\n\nIn the window that opens on the bottom right.\nClick Configure > Local Managed Server, choose your GPU or CPU, choose the model in Workloads and click Install."
32-
zenity --info --text="$zenityText" --width=400 --height=300
33-
3432
exitCode=$?
33+
if [ "$exitCode" = "0" ]; then
34+
zenityText=$"Generative AI for Krita has been successfully installed.\n\nOpen Krita, open an existing drawing or create a new one.\nIn the top panel go to Settings > Panels > check the AI Image Generation box.\n\nIn the window that opens on the bottom right.\nClick Configure > Local Managed Server, choose your GPU or CPU, choose the model in Workloads and click Install."
35+
else
36+
zenityText=$"Generative AI for Krita has not been successfully installed."
37+
fi
38+
zenity --info --text="$zenityText" --width=400 --height=300
3539
else
3640
killall krita
3741
rm -rf "$HOME/.local/share/krita/pykrita"

usr/share/biglinux/biglinux-settings/ai/lmStudio.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
55
export TEXTDOMAIN=biglinux-settings
66

77
# check current status
8+
# action=$1
89
if [ "$1" == "check" ]; then
910
if pacman -Q lmstudio-bin &>/dev/null; then
1011
echo "true"
@@ -13,14 +14,13 @@ if [ "$1" == "check" ]; then
1314
fi
1415

1516
# change the state
17+
# action=$1
18+
# state=$2
1619
elif [ "$1" == "toggle" ]; then
17-
state="$2"
18-
if [ "$state" == "true" ]; then
20+
if [ "$2" == "true" ]; then
1921
pkexec $PWD/ai/lmStudioRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
20-
exitCode=$?
2122
else
2223
pkexec $PWD/ai/lmStudioRun.sh "uninstall" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
23-
exitCode=$?
2424
fi
25-
exit $exitCode
25+
exit $?
2626
fi

usr/share/biglinux/biglinux-settings/ai/ollamaAmd.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@ info() {
1010
}
1111

1212
# check current status
13+
# action=$1
1314
if [ "$1" == "check" ]; then
1415
if pacman -Q ollama-rocm &>/dev/null; then
1516
echo "true"
1617
else
1718
echo "false"
1819
fi
1920

20-
2121
# change the state
22+
# action=$1
23+
# state=$2
2224
elif [ "$1" == "toggle" ]; then
23-
state="$2"
24-
if [ "$state" == "true" ]; then
25+
if [ "$2" == "true" ]; then
2526
pkexec $PWD/ai/ollamaAmdRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
26-
info
2727
exitCode=$?
28+
info
2829
else
2930
pkexec $PWD/ai/ollamaAmdRun.sh "uninstall" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
3031
exitCode=$?

usr/share/biglinux/biglinux-settings/ai/ollamaCpu.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ info() {
1010
}
1111

1212
# check current status
13+
# action=$1
1314
if [ "$1" == "check" ]; then
1415
if pacman -Q ollama &>/dev/null && ! pacman -Q ollama-vulkan &>/dev/null && ! pacman -Q ollama-rocm &>/dev/null && ! pacman -Q ollama-cuda &>/dev/null ; then
1516
echo "true"
@@ -18,12 +19,13 @@ if [ "$1" == "check" ]; then
1819
fi
1920

2021
# change the state
22+
# action=$1
23+
# state=$2
2124
elif [ "$1" == "toggle" ]; then
22-
state="$2"
23-
if [ "$state" == "true" ]; then
25+
if [ "$2" == "true" ]; then
2426
pkexec $PWD/ai/ollamaCpuRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
25-
info
2627
exitCode=$?
28+
info
2729
else
2830
pkexec $PWD/ai/ollamaCpuRun.sh "uninstall" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
2931
exitCode=$?

usr/share/biglinux/biglinux-settings/ai/ollamaLab.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
55
export TEXTDOMAIN=biglinux-settings
66

77
# check current status
8+
# action=$1
89
if [ "$1" == "check" ]; then
910
if pacman -Q ollama-lab-bin &>/dev/null; then
1011
echo "true"
@@ -13,14 +14,13 @@ if [ "$1" == "check" ]; then
1314
fi
1415

1516
# change the state
17+
# action=$1
18+
# state=$2
1619
elif [ "$1" == "toggle" ]; then
17-
state="$2"
18-
if [ "$state" == "true" ]; then
20+
if [ "$2" == "true" ]; then
1921
pkexec $PWD/ai/ollamaLabRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
20-
exitCode=$?
2122
else
2223
pkexec $PWD/ai/ollamaLabRun.sh "uninstall" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
23-
exitCode=$?
2424
fi
25-
exit $exitCode
25+
exit $?
2626
fi

usr/share/biglinux/biglinux-settings/ai/ollamaNvidia.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ info() {
1010
}
1111

1212
# check current status
13+
# action=$1
1314
if [ "$1" == "check" ]; then
1415
if pacman -Q ollama-cuda &>/dev/null; then
1516
echo "true"
@@ -18,12 +19,13 @@ if [ "$1" == "check" ]; then
1819
fi
1920

2021
# change the state
22+
# action=$1
23+
# state=$2
2124
elif [ "$1" == "toggle" ]; then
22-
state="$2"
23-
if [ "$state" == "true" ]; then
25+
if [ "$2" == "true" ]; then
2426
pkexec $PWD/ai/ollamaNvidiaRun.sh "install" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
25-
info
2627
exitCode=$?
28+
info
2729
else
2830
pkexec $PWD/ai/ollamaNvidiaRun.sh "uninstall" "$USER" "$DISPLAY" "$XAUTHORITY" "$DBUS_SESSION_BUS_ADDRESS" "$LANG" "$LANGUAGE"
2931
exitCode=$?

0 commit comments

Comments
 (0)