mirror of
https://github.com/nixietab/picodulce.git
synced 2025-04-10 10:28:56 +01:00
Compare commits
11 Commits
8167462838
...
7608b647fe
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7608b647fe | ||
![]() |
60d16326b0 | ||
![]() |
0d300f0435 | ||
![]() |
3123ed30cf | ||
![]() |
db41858aae | ||
![]() |
8c0a794202 | ||
![]() |
514f6427ab | ||
![]() |
9920636b9c | ||
![]() |
5182e42f81 | ||
![]() |
d2f3aa6a49 | ||
![]() |
a19b8a1545 |
76
PKGBUILD
Normal file
76
PKGBUILD
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
pkgname=picodulce
|
||||||
|
pkgver=0.11.7
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="Launcher for Minecraft based on the picomc library"
|
||||||
|
arch=('x86_64')
|
||||||
|
OPTIONS=(!strip !docs libtool emptydirs)
|
||||||
|
url="https://github.com/nixietab/picodulce"
|
||||||
|
license=('MIT') # Replace with your project's license
|
||||||
|
depends=('python' 'python-virtualenv' 'xdg-utils')
|
||||||
|
makedepends=('git')
|
||||||
|
source=("git+https://github.com/nixietab/picodulce.git")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd "$srcdir/$pkgname"
|
||||||
|
|
||||||
|
# Create a directory for the application in the user's home directory
|
||||||
|
install -dm755 "$pkgdir/usr/share/$pkgname"
|
||||||
|
|
||||||
|
# Copy all project files to the created directory
|
||||||
|
cp -r . "$pkgdir/usr/share/$pkgname"
|
||||||
|
|
||||||
|
# Create a virtual environment
|
||||||
|
python -m venv "$pkgdir/usr/share/$pkgname/venv"
|
||||||
|
|
||||||
|
# Activate the virtual environment and install dependencies
|
||||||
|
source "$pkgdir/usr/share/$pkgname/venv/bin/activate"
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Create a run.sh script
|
||||||
|
install -Dm755 /dev/stdin "$pkgdir/usr/share/$pkgname/run.sh" <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
python picodulce.py
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# Make the run.sh script executable
|
||||||
|
chmod +x "$pkgdir/usr/share/$pkgname/run.sh"
|
||||||
|
|
||||||
|
# Create a desktop entry for the application
|
||||||
|
install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/$pkgname.desktop" <<EOF
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=Picodulce
|
||||||
|
Exec=/usr/share/picodulce/run.sh
|
||||||
|
Icon=/usr/share/picodulce/launcher_icon.ico
|
||||||
|
Terminal=true
|
||||||
|
Type=Application
|
||||||
|
Comment=Picodulce Launcher
|
||||||
|
Categories=Game;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Ensure the normal user has permission to write to the picodulce folder
|
||||||
|
chown -R "$USER:$USER" "$pkgdir/usr/share/$pkgname"
|
||||||
|
chmod -R u+w "$pkgdir/usr/share/$pkgname"
|
||||||
|
|
||||||
|
#Install into bin
|
||||||
|
install -Dm755 /dev/stdin "$pkgdir/usr/bin/picodulce" <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
cd /usr/share/picodulce/
|
||||||
|
exec ./run.sh
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
# vim:set ts=2 sw=2 et:
|
16
README.md
16
README.md
@ -40,7 +40,21 @@
|
|||||||
- **Custom Theme Support**: Create and apply personalized themes with ease. A dedicated repository and guide are [available to help you get started.](https://github.com/nixietab/picodulce-themes)
|
- **Custom Theme Support**: Create and apply personalized themes with ease. A dedicated repository and guide are [available to help you get started.](https://github.com/nixietab/picodulce-themes)
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
If you are on windows you may be more interested in a [installer](https://github.com/nixietab/picodulce/releases/latest)
|
|
||||||
|
## Windows
|
||||||
|
For Windows systems using the [installer](https://github.com/nixietab/picodulce/releases/latest) is recommended
|
||||||
|
|
||||||
|
## Arch Linux
|
||||||
|
The package is available in the [AUR](https://aur.archlinux.org/packages/picodulce) as ```picodulce```
|
||||||
|
|
||||||
|
For installing on Arch without using an AUR helper a PKGBUILD is provided
|
||||||
|
```
|
||||||
|
git clone https://aur.archlinux.org/picodulce.git
|
||||||
|
cd picodulce
|
||||||
|
makepkg -si
|
||||||
|
```
|
||||||
|
|
||||||
|
## Other OS
|
||||||
|
|
||||||
### 1. Clone the repository
|
### 1. Clone the repository
|
||||||
|
|
||||||
|
29
picodulce.py
29
picodulce.py
@ -48,6 +48,9 @@ class PicomcVersionSelector(QWidget):
|
|||||||
discord_rcp_thread.daemon = True # Make the thread a daemon so it terminates when the main program exits
|
discord_rcp_thread.daemon = True # Make the thread a daemon so it terminates when the main program exits
|
||||||
discord_rcp_thread.start()
|
discord_rcp_thread.start()
|
||||||
|
|
||||||
|
if self.config.get("IsFirstLaunch", False):
|
||||||
|
self.FirstLaunch()
|
||||||
|
|
||||||
def load_theme_from_file(self, file_path, app):
|
def load_theme_from_file(self, file_path, app):
|
||||||
self.theme = {}
|
self.theme = {}
|
||||||
# Check if the file exists, else load 'Dark.json'
|
# Check if the file exists, else load 'Dark.json'
|
||||||
@ -174,9 +177,32 @@ class PicomcVersionSelector(QWidget):
|
|||||||
print("Theme Integrity OK")
|
print("Theme Integrity OK")
|
||||||
|
|
||||||
|
|
||||||
|
def FirstLaunch(self):
|
||||||
|
try:
|
||||||
|
self.config_path = "config.json"
|
||||||
|
print("Running picomc instance create default command...")
|
||||||
|
# Run the command using subprocess
|
||||||
|
result = subprocess.run(["picomc", "instance", "create", "default"], check=True, capture_output=True, text=True)
|
||||||
|
|
||||||
|
# Print the output of the command
|
||||||
|
print("Command output:", result.stdout)
|
||||||
|
|
||||||
|
# Change the value of IsFirstLaunch to False
|
||||||
|
self.config["IsFirstLaunch"] = False
|
||||||
|
print("IsFirstLaunch set to False")
|
||||||
|
|
||||||
|
# Save the updated config to the config.json file
|
||||||
|
with open(self.config_path, 'w') as f:
|
||||||
|
json.dump(self.config, f, indent=4)
|
||||||
|
print("Configuration saved to", self.config_path)
|
||||||
|
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print("An error occurred while creating the instance.")
|
||||||
|
print("Error output:", e.stderr)
|
||||||
|
|
||||||
def resize_event(self, event):
|
def resize_event(self, event):
|
||||||
if hasattr(self, 'movie_label'):
|
if hasattr(self, 'movie_label'):
|
||||||
self.movie_label.setGeometry(0, 0, self.width(), self.height())
|
self.movie_label.setGeometry(0, 0, 400, 320)
|
||||||
event.accept() # Accept the resize event
|
event.accept() # Accept the resize event
|
||||||
|
|
||||||
|
|
||||||
@ -318,6 +344,7 @@ class PicomcVersionSelector(QWidget):
|
|||||||
"IsRCPenabled": False,
|
"IsRCPenabled": False,
|
||||||
"CheckUpdate": False,
|
"CheckUpdate": False,
|
||||||
"LastPlayed": "",
|
"LastPlayed": "",
|
||||||
|
"IsFirstLaunch": True,
|
||||||
"Instance": "default",
|
"Instance": "default",
|
||||||
"Theme": "Dark.json",
|
"Theme": "Dark.json",
|
||||||
"ThemeBackground": True,
|
"ThemeBackground": True,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.11.6",
|
"version": "0.11.8",
|
||||||
"links": [
|
"links": [
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
|
||||||
|
Loading…
Reference in New Issue
Block a user