mirror of
https://github.com/nixietab/picodulce.git
synced 2025-10-29 20:45:10 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ca02b378c | ||
|
|
3c9634bd24 | ||
|
|
13a167f7fa |
@ -44,6 +44,13 @@
|
||||
## Windows
|
||||
For Windows systems using the [installer](https://github.com/nixietab/picodulce/releases/latest) is recommended
|
||||
|
||||
# Linux (Generic)
|
||||
We have a install script, to use it run:
|
||||
|
||||
~~~
|
||||
curl -sSL https://raw.githubusercontent.com/nixietab/picodulce/refs/heads/main/install-universal.sh | bash
|
||||
~~~
|
||||
|
||||
## Arch Linux
|
||||
The package is available in the [AUR](https://aur.archlinux.org/packages/picodulce) as ```picodulce```
|
||||
|
||||
|
||||
110
install-universal.sh
Normal file
110
install-universal.sh
Normal file
@ -0,0 +1,110 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PICODULCE_DIR="$HOME/.picodulce"
|
||||
GIT_URL="https://github.com/nixietab/picodulce.git"
|
||||
DESKTOP_FILE="$HOME/.local/share/applications/picodulce.desktop"
|
||||
BIN_FILE="/usr/bin/picodulce"
|
||||
|
||||
# --- Helper functions ---
|
||||
msg() {
|
||||
echo -e "\033[1;32m$1\033[0m"
|
||||
}
|
||||
|
||||
err() {
|
||||
echo -e "\033[1;31m$1\033[0m" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
pause() {
|
||||
read -rp "Press Enter to continue..."
|
||||
}
|
||||
|
||||
# --- Check dependencies ---
|
||||
msg "Checking Python3..."
|
||||
if ! command -v python3 >/dev/null; then
|
||||
err "Python3 is not installed. Please install it first."
|
||||
fi
|
||||
|
||||
msg "Checking venv module..."
|
||||
if ! python3 -m venv --help >/dev/null 2>&1; then
|
||||
err "python3-venv is not available. Please install it."
|
||||
fi
|
||||
|
||||
# --- Clone repo ---
|
||||
msg "Cloning Picodulce repo..."
|
||||
rm -rf "$PICODULCE_DIR"
|
||||
git clone "$GIT_URL" "$PICODULCE_DIR"
|
||||
|
||||
# --- Create virtual environment ---
|
||||
cd "$PICODULCE_DIR"
|
||||
msg "Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
|
||||
# --- Create run.sh ---
|
||||
msg "Creating run.sh..."
|
||||
cat > "$PICODULCE_DIR/run.sh" <<'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "venv folder does not exist. Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
echo "Installing required packages..."
|
||||
pip install -r requirements.txt
|
||||
else
|
||||
source venv/bin/activate
|
||||
fi
|
||||
|
||||
exec python picodulce.py
|
||||
EOF
|
||||
|
||||
chmod +x "$PICODULCE_DIR/run.sh"
|
||||
|
||||
# --- Create .desktop entry ---
|
||||
msg "Creating .desktop entry..."
|
||||
mkdir -p "$(dirname "$DESKTOP_FILE")"
|
||||
|
||||
cat > "$DESKTOP_FILE" <<EOF
|
||||
[Desktop Entry]
|
||||
Name=Picodulce
|
||||
Exec=$PICODULCE_DIR/run.sh
|
||||
Icon=$PICODULCE_DIR/launcher_icon.ico
|
||||
Terminal=true
|
||||
Type=Application
|
||||
Comment=Picodulce Launcher
|
||||
Categories=Game;
|
||||
EOF
|
||||
|
||||
# --- Ask if install in /usr/bin ---
|
||||
echo
|
||||
read -rp "Do you want to install the "picodulce" command? it requires sudo. (y/n) " choice
|
||||
if [[ "$choice" =~ ^[Yy]$ ]]; then
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Root permissions required to install into /usr/bin"
|
||||
sudo bash -c "cat > $BIN_FILE" <<EOF
|
||||
#!/bin/bash
|
||||
cd $PICODULCE_DIR
|
||||
exec ./run.sh
|
||||
EOF
|
||||
sudo chmod +x "$BIN_FILE"
|
||||
else
|
||||
cat > "$BIN_FILE" <<EOF
|
||||
#!/bin/bash
|
||||
cd $PICODULCE_DIR
|
||||
exec ./run.sh
|
||||
EOF
|
||||
chmod +x "$BIN_FILE"
|
||||
fi
|
||||
msg "Installed 'picodulce' command in /usr/bin"
|
||||
fi
|
||||
|
||||
msg "Installation complete!"
|
||||
echo "You can run Picodulce with:"
|
||||
echo " $PICODULCE_DIR/run.sh"
|
||||
echo "Or from your applications menu."
|
||||
22
picodulce.py
22
picodulce.py
@ -22,7 +22,7 @@ from datetime import datetime
|
||||
|
||||
logging.basicConfig(level=logging.ERROR, format='%(levelname)s - %(message)s')
|
||||
|
||||
class PicomcVersionSelector(QWidget):
|
||||
class zucaroVersionSelector(QWidget):
|
||||
def __init__(self):
|
||||
self.current_state = "menu"
|
||||
self.open_dialogs = []
|
||||
@ -127,7 +127,7 @@ class PicomcVersionSelector(QWidget):
|
||||
def FirstLaunch(self):
|
||||
try:
|
||||
self.config_path = "config.json"
|
||||
print("Running picomc instance create default command...")
|
||||
print("Running zucaro instance create default command...")
|
||||
|
||||
# Run the command using modulecli
|
||||
command = "instance create default"
|
||||
@ -771,7 +771,7 @@ class PicomcVersionSelector(QWidget):
|
||||
# Open the directory in the system's file explorer
|
||||
QDesktopServices.openUrl(QUrl.fromLocalFile(game_directory))
|
||||
except Exception as e:
|
||||
print(f"Error running picomc command: {e}")
|
||||
print(f"Error running zucaro command: {e}")
|
||||
|
||||
def populate_installed_versions(self):
|
||||
config_path = "config.json"
|
||||
@ -799,7 +799,7 @@ class PicomcVersionSelector(QWidget):
|
||||
if not output:
|
||||
raise Exception("Failed to get output from modulecli")
|
||||
except Exception as e:
|
||||
logging.error("Error running 'picomc': %s", e)
|
||||
logging.error("Error running 'zucaro': %s", e)
|
||||
return
|
||||
|
||||
# Parse the output and replace '[local]' with a space
|
||||
@ -818,7 +818,7 @@ class PicomcVersionSelector(QWidget):
|
||||
self.installed_version_combo.addItems(versions)
|
||||
|
||||
def populate_installed_versions_normal_order(self):
|
||||
# Run the 'picomc instance create default' command at the start
|
||||
# Run the 'zucaro instance create default' command at the start
|
||||
try:
|
||||
command = "instance create default"
|
||||
output = modulecli.run_command(command)
|
||||
@ -828,7 +828,7 @@ class PicomcVersionSelector(QWidget):
|
||||
logging.error("Error creating default instance: %s", str(e))
|
||||
return
|
||||
|
||||
# Run the 'picomc version list' command and get the output
|
||||
# Run the 'zucaro version list' command and get the output
|
||||
try:
|
||||
command = "version list"
|
||||
output = modulecli.run_command(command)
|
||||
@ -1491,7 +1491,7 @@ class ModLoaderAndVersionMenu(QDialog):
|
||||
|
||||
if instance_name:
|
||||
try:
|
||||
# Run the "picomc instance create" command
|
||||
# Run the "zucaro instance create" command
|
||||
command = f"instance create {instance_name}"
|
||||
modulecli.run_command(command)
|
||||
|
||||
@ -1516,7 +1516,7 @@ class ModLoaderAndVersionMenu(QDialog):
|
||||
return
|
||||
|
||||
try:
|
||||
# Run the "picomc instance rename" command
|
||||
# Run the "zucaro instance rename" command
|
||||
command = f"instance rename {old_instance_name} {new_instance_name}"
|
||||
modulecli.run_command(command)
|
||||
|
||||
@ -1546,7 +1546,7 @@ class ModLoaderAndVersionMenu(QDialog):
|
||||
|
||||
if confirm_delete == QMessageBox.Yes:
|
||||
try:
|
||||
# Run the "picomc instance delete" command
|
||||
# Run the "zucaro instance delete" command
|
||||
command = f"instance delete {instance_name}"
|
||||
modulecli.run_command(command)
|
||||
|
||||
@ -1562,7 +1562,7 @@ class ModLoaderAndVersionMenu(QDialog):
|
||||
|
||||
def load_instances(self):
|
||||
try:
|
||||
# Run the "picomc instance list" command
|
||||
# Run the "zucaro instance list" command
|
||||
command = "instance list"
|
||||
output = modulecli.run_command(command)
|
||||
|
||||
@ -1858,6 +1858,6 @@ if __name__ == '__main__':
|
||||
app.setWindowIcon(QIcon('holiday.ico')) # Set holiday icon
|
||||
else:
|
||||
app.setWindowIcon(QIcon('launcher_icon.ico')) # Set regular icon
|
||||
window = PicomcVersionSelector()
|
||||
window = zucaroVersionSelector()
|
||||
window.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user