add queue functionality to upload many items and update readme to include basic installation guide

This commit is contained in:
2026-08-12 17:14:59 +02:00
parent 35ff9bae5e
commit 43e95c9d3e
6 changed files with 277 additions and 169 deletions

View File

@@ -6,6 +6,38 @@ APP_DIR="$HOME/.local/share/applications"
SERVICE_MENU_DIR="$HOME/.local/share/kio/servicemenus"
LEGACY_SERVICE_MENU_DIR="$HOME/.local/share/kservices5/ServiceMenus"
# Check Python 3 and PySide6 dependency
echo "Checking dependencies..."
if ! command -v python3 &>/dev/null; then
echo "Error: Python 3 is required but not found on your system."
exit 1
fi
if ! python3 -c "import PySide6" &>/dev/null; then
echo "PySide6 is not installed. Attempting automatic installation..."
if command -v pip3 &>/dev/null; then
pip3 install PySide6 || pip3 install --break-system-packages PySide6 || true
elif command -v pip &>/dev/null; then
pip install PySide6 || pip install --break-system-packages PySide6 || true
elif command -v dnf &>/dev/null; then
echo "Installing python3-pyside6 via dnf..."
sudo dnf install -y python3-pyside6 || true
elif command -v apt-get &>/dev/null; then
echo "Installing python3-pyside6 via apt..."
sudo apt-get update && sudo apt-get install -y python3-pyside6 || true
elif command -v pacman &>/dev/null; then
echo "Installing python-pyside6 via pacman..."
sudo pacman -S --noconfirm python-pyside6 || true
elif command -v zypper &>/dev/null; then
echo "Installing python3-pyside6 via zypper..."
sudo zypper install -y python3-pyside6 || true
fi
fi
if ! python3 -c "import PySide6" &>/dev/null; then
echo "Warning: Could not automatically install PySide6. Please install 'PySide6' via pip or your distro package manager (e.g. python3-pyside6)."
fi
# Create necessary directories
mkdir -p "$INSTALL_DIR" "$APP_DIR" "$SERVICE_MENU_DIR" "$LEGACY_SERVICE_MENU_DIR"
@@ -154,9 +186,26 @@ except Exception as e:
print(f"Warning: could not sync autostart entry: {e}")
'
echo "Installation complete!"
echo "The script has been installed to $INSTALL_DIR/f0ckm-uploader"
echo "The GUI has been installed to $INSTALL_DIR/f0ckm-uploader-gui"
echo "You can launch the GUI uploader from your applications menu (f0ckm Uploader GUI)."
echo "You can now right click files in Dolphin and find 'Upload to f0ckm' in the Actions menu."
echo "In Spectacle, you should find 'Upload to f0ckm' in the Export or Share menu."
echo ""
echo "========================================================"
echo " f0ckm Uploader Installation Complete!"
echo "========================================================"
echo " -> Executable installed: $INSTALL_DIR/f0ckm-uploader-gui"
echo " -> Dolphin context menu registered (Right-click file -> Actions -> Upload to f0ckm)"
echo " -> Spectacle screenshot export integration enabled"
echo " -> Browser extension helper API ready on http://127.0.0.1:18739"
echo "========================================================"
echo ""
# Launch GUI to prompt for API settings if API key or URL is not configured yet
python3 -c '
import json, os
cfg_path = os.path.expanduser("~/.config/f0ckm-uploader/config.json")
if os.path.exists(cfg_path):
with open(cfg_path) as f:
cfg = json.load(f)
if not cfg.get("api_url") or not cfg.get("api_key"):
print("[!] API Key or URL not configured yet.")
print(" Launching f0ckm Uploader GUI Settings for initial setup...")
os.system("'$INSTALL_DIR'/f0ckm-uploader-gui &")
' || true