Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions PKGBUILD/PKGBUILD-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Maintainer: Samuobe [email protected]

pkgname=arch-store-dev-git
pkgver=2.0.1
pkgrel=1
pkgdesc="A graphical app for managing your programs with pacman, AUR, flatpak, and appimage"
arch=('any')
url="https://github.com/Samuobe/Arch-Store"
license=('GPL3')
depends=('python' 'python-pyqt6')
makedepends=('git' 'python-setuptools')
source=("git+$url.git#branch=dev")
md5sums=('SKIP')

pkgver() {
cd Arch-Store
git describe --tags --always | sed 's/^v//;s/-/./g'
}

package() {
# Copia tutto il progetto in /usr/share/arch-store
install -d "$pkgdir/usr/share/arch-store"
cp -r "$srcdir/Arch-Store/"* "$pkgdir/usr/share/arch-store/"

# Crea la cartella dati globale con permessi corretti
install -dm1777 "$pkgdir/var/lib/arch-store"


# Crea un wrapper in /usr/bin
install -Dm755 /dev/stdin "$pkgdir/usr/bin/arch-store" <<EOF
#!/bin/sh
exec python3 /usr/share/arch-store/main.py "\$@"
EOF

# Icona
install -Dm644 "$srcdir/Arch-Store/icon.png" "$pkgdir/usr/share/pixmaps/arch-store.png"

# File .desktop
install -Dm644 "$srcdir/Arch-Store/arch-store.desktop" "$pkgdir/usr/share/applications/arch-store.desktop"


#version type
install -Dm644 /dev/null "$pkgdir/usr/share/arch-store/beta"

rm -f "$pkgdir/usr/share/arch-store/script"


}

12 changes: 11 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Welcome to the Arch-Store installation program!"
echo "What do you want to do?"
echo "1) Install/Update Arch-Store"
echo "2) Uninstall Arch-Store"
read -p "Select an option [1/2]: " action
read -p "Select an option [1/2/5]: " action

if [[ "$action" == "1" ]]; then
mkdir arch-store-install
Expand Down Expand Up @@ -43,6 +43,16 @@ elif [[ "$action" == "2" ]]; then
sudo pacman -Rns arch-store
sudo pacman -Rns arch-store-git
echo "FINISHED!"
elif [[ "$actions" == "5" ]]; then
echo "Installing Arch-Store DEV branch..."
wget https://raw.githubusercontent.com/samuobe/Arch-Store/main/PKGBUILD/PKGBUILD-dev
mv PKGBUILD-dev PKGBUILD
makepkg -si
rm PKGBUILD
echo "FINISHED!"

cd ..
rm -rf arch-store-install
fi


Expand Down
9 changes: 9 additions & 0 deletions lpak/English.lpak
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,12 @@ last modified|Last modified
popularity|Popularity
votes|Votes
outdated|Outdated
Update ArchStore|Update ArchStore
Select a version|Select a version
Do you want to install the stable version?|Do you want to install the stable version?
Do you want to open GitHub?|Do you want to open GitHub?
It appears that you installed ArchStore from the script. Would you like to open GitHub to rerun the script?|It appears that you installed ArchStore from the script. Would you like to open GitHub to rerun the script?
Script|Script
Installated with|Installed whit
updated, please restart|Updated, please restart ArchStore
updated|Updated
11 changes: 10 additions & 1 deletion lpak/Italiano.lpak
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,13 @@ keywords|Parole chiave
last modified|Ultima modifica
popularity|Popolarità
votes|Voti
outdated|Obsoleto
outdated|Obsoleto
Update ArchStore|Aggiorna ArchStore
Select a version|Seleziona una versione
Do you want to install the stable version?|Vuoi installare la versione stabile?
Do you want to open GitHub?|Vuoi aprire GitHub?
It appears that you installed ArchStore from the script. Would you like to open GitHub to rerun the script?|Sembra che tu abbia installato ArchStore dallo script, vuoi aprire GitHub per riscaricarlo?
Script|Script
Installated with|Installato con
updated, please restart|Aggiornato, riavvia l'applicazione
updated|Aggiornato
18 changes: 15 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from PyQt6.QtGui import QIcon
from PyQt6.QtCore import QProcess
import sys
import glob

#PY files
import appimages as archstoreAppimages
Expand All @@ -20,8 +21,7 @@
from manage_installed_method import show_window as show_installed_method

#fast access variables
avaible_languages= ["Chinese Simplified", "Deutsch", "English", "Español", "Euskera", "Français", "Italiano", "Lietuvių", "Norsk", "Polski", "Română", "Türkçe"]

arch_store_version = "beta_SETTINGS-UPDATE_1.0.0"

#Base variables
install_pacman_packages=[]
Expand Down Expand Up @@ -52,6 +52,7 @@
working_dir="/var/lib/arch-store"
os.chdir(base_dir)
user_name = getpass.getuser()
avaible_languages_temp = glob.glob(f"{base_dir}/lpak/*.lpak")

#add anything global to global scope before using it global, also put defaults
setting_repo_pacman="enable"
Expand All @@ -61,6 +62,17 @@
language="English"
AppImagesDir=f"{working_dir}/AppImages"

#####################
###starting things###
#####################

#Adjust languages name
avaible_languages = []
for language in avaible_languages_temp:
avaible_languages.append(language.split("/")[-1].split(".")[0])
avaible_languages.sort(key=str.lower)


#Config data
def load_config_data():
def write_new_config_file():
Expand Down Expand Up @@ -100,7 +112,7 @@ def read_config_data():
#END ALLERT

def open_setting():
win = archstoreSettings.open_setting(language, working_dir, avaible_languages)
win = archstoreSettings.open_setting(language, working_dir, avaible_languages, arch_store_version)
win.exec()
load_config_data()

Expand Down
125 changes: 119 additions & 6 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
from show_allert import show_allert
import webbrowser
from PyQt6.QtCore import QProcess
def load_config_data(working_dir, avaible_languages, language):
def write_new_config_file():
with open(f"{working_dir}/settings.conf", "w") as f:
Expand Down Expand Up @@ -35,9 +36,14 @@ def read_config_data():
read_config_data()


def open_setting(language, working_dir, avaible_languages):
def open_setting(language, working_dir, avaible_languages, version):
global pacman_status, aur_status, flatpak_status, aur_method, new_language, app_image_dir
load_config_data(working_dir, avaible_languages, language)

if not os.path.isfile(working_dir+"/script"):
script_installation_status = False
else:
script_installation_status = True
#Edit repo
def confirm_changes():
global pacman_status, aur_status, flatpak_status, aur_method, new_language, app_image_dir, old_language
Expand Down Expand Up @@ -92,8 +98,7 @@ def change_aur_method(button, label):
else:
aur_method = "paru"
label.setText(lpak.get("aur method", language)+": "+aur_method)



def setting_change_appimagedir(button):
new_dir_temp = pq.QFileDialog.getExistingDirectory(settings_page, lpak.get("select a folder", language))
response = pq.QMessageBox.question(settings_page,
Expand All @@ -109,6 +114,102 @@ def setting_change_appimagedir(button):

else:
return

def update_arch_store():
if script_installation_status == False:
def after_operations():
button_update_archStore.setText(lpak.get("updated", language))

def start_thread_operations(label, button):


global proc

# Aggiorna subito la UI (thread principale)
button.setDisabled(True)
label.setText(lpak.get("install in progress", language))
progress_bar.setRange(0, 0)
operations_window.repaint()

proc = QProcess(operations_window)

def close_updates():
operations_window.close()


def on_finished(exitCode, exitStatus):
global install_status
install_status = False
progress_bar.setRange(0, 1)
button.setText(lpak.get("finished", language))
label.setText(lpak.get("updated, please restart", language))
try:
button.pressed.disconnect()
except TypeError:
pass
after_operations()
button.setDisabled(False)
button.clicked.connect(close_updates)
operations_window.update()

def on_error(err):
global install_status
install_status = False
progress_bar.setRange(0, 1)
label.setText(f"{lpak.get('error', language)}: {err}")
button.setDisabled(False)
operations_window.update()

proc.finished.connect(on_finished)
proc.errorOccurred.connect(on_error)

proc.start("pkexec", ["bash", "/tmp/arch_store_actions.sh"])

response = pq.QMessageBox.question(settings_page,
lpak.get("Select a version", language),
lpak.get("Do you want to install the stable version?", language),
pq.QMessageBox.StandardButton.Yes | pq.QMessageBox.StandardButton.No,
pq.QMessageBox.StandardButton.No
)

if response == pq.QMessageBox.StandardButton.Yes:
remove_other_version_command = "sudo pacman -Rns arch-store-git --noconfirm"
makepkg_command = f"{aur_method} -S arch-store --noconfirm"
else:
remove_other_version_command = "sudo pacman -Rns arch-store --noconfirm"
makepkg_command = f"{aur_method} -S arch-store-git --noconfirm"

with open(f"/tmp/arch_store_actions.sh", "w") as f:
f.write("#!/bin/bash\n")
f.write(remove_other_version_command+"\n")
f.write(makepkg_command+"\n")

operations_window = pq.QWidget()
operations_window.setWindowTitle(lpak.get("start update", language))
operations_window.setWindowIcon(QIcon("icon.png"))
layout = pq.QVBoxLayout(operations_window)
install_label = pq.QLabel(lpak.get("click to start update", language))
start_button = pq.QPushButton(lpak.get("start update", language))
start_button.pressed.connect(lambda: start_thread_operations(install_label, start_button))
progress_bar = pq.QProgressBar()

layout.addWidget(install_label)
layout.addWidget(progress_bar)
layout.addWidget(start_button)

operations_window.show()
else:
response = pq.QMessageBox.question(settings_page,
lpak.get("Do you want to open GitHub?", language),
lpak.get("It appears that you installed ArchStore from the script. Would you like to open GitHub to rerun the script?", language),
pq.QMessageBox.StandardButton.Yes | pq.QMessageBox.StandardButton.No,
pq.QMessageBox.StandardButton.No
)

if response == pq.QMessageBox.StandardButton.Yes:
webbrowser.open("https://github.com/Samuobe/Arch-Store?tab=readme-ov-file#automatic-script")


#Other
def settings_reset_settings(working_dir, avaible_languages, language):
os.remove(f"{working_dir}/settings.conf")
Expand Down Expand Up @@ -153,6 +254,9 @@ def settings_reset_settings(working_dir, avaible_languages, language):
#RESET
button_reset_settings= pq.QPushButton(lpak.get("reset settings", language))
button_reset_settings.pressed.connect(lambda: settings_reset_settings(working_dir, avaible_languages, language))
#update Arch Store
button_update_archStore = pq.QPushButton(lpak.get("Update ArchStore", language))
button_update_archStore.pressed.connect(update_arch_store)
#change AUR method
label_aur_method = pq.QLabel(lpak.get("aur method", language)+": "+aur_method)
button_change_aur_method = pq.QPushButton(lpak.get("change", language))
Expand All @@ -178,6 +282,13 @@ def github_button():
author_label = pq.QLabel(lpak.get("made whit heart by Samuobe", language))
project_link = pq.QPushButton(lpak.get("github project", language))
project_link.pressed.connect(github_button)
#Version
version_label = pq.QLabel(lpak.get("version", language))
if script_installation_status == False:
archstore_installation_method = "AUR"
else:
archstore_installation_method = "Script"
version_label_var = pq.QLabel(f"{version} ({lpak.get("Installated with", language)} {lpak.get(archstore_installation_method, language)})")
#LINE
line_separazione = pq.QFrame()
line_separazione.setFrameShape(pq.QFrame.Shape.HLine)
Expand All @@ -188,6 +299,7 @@ def github_button():
layout.addWidget(settings_label_title)
layout.addWidget(settings_label_title, 0, 0, 1, 2)
layout.addWidget(button_reset_settings, 0, 3)
layout.addWidget(button_update_archStore, 1, 3)
layout.addWidget(settings_label_repo, 1, 0)
layout.addWidget(label_repo_pacman, 2, 0)
layout.addWidget(button_repo_pacman, 2, 1)
Expand All @@ -199,11 +311,9 @@ def github_button():
layout.addWidget(button_change_aur_method, 5, 1)
layout.addWidget(empty_label, 6, 0)
layout.addWidget(label_other_settings, 7, 0)
#setLayout(layout)
#
layout.addWidget(label_language, 8, 0)
layout.addWidget(menu_select_language, 8, 1)

layout.addWidget(menu_select_language, 8, 1)

layout.addWidget(appimagesdir_label, 9, 0)
layout.addWidget(appimagesdir_button, 9, 1)
Expand All @@ -214,6 +324,9 @@ def github_button():
layout.addWidget(author_label, 13, 0)
layout.addWidget(project_link, 13, 1)

layout.addWidget(version_label, 15, 0)
layout.addWidget(version_label_var, 15, 1)

layout.setRowStretch(layout.rowCount(), 1)

settings_page.show()
Expand Down
Loading