Skip to content
Open
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
3 changes: 2 additions & 1 deletion usr/bin/mintinstall
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python3

import subprocess
import sys
import os

# Remove any obsolete configuration file
Expand All @@ -11,4 +12,4 @@ if os.path.exists(obsolete_path):
except:
pass

subprocess.call("/usr/lib/linuxmint/mintinstall/mintinstall.py")
subprocess.call(["/usr/lib/linuxmint/mintinstall/mintinstall.py"] + sys.argv[1:])
22 changes: 22 additions & 0 deletions usr/lib/linuxmint/mintinstall/mintinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# -*- coding: UTF-8 -*-

import sys
import requests
import tempfile
import os
import gettext
import threading
Expand Down Expand Up @@ -714,6 +716,26 @@ def do_command_line(self, command_line, data=None):

print("MintInstall: file not found", args[2])
sys.exit(1)
elif num > 1 and args[1].startswith("flatpak+https"):
# Download flatpakref file
url = args[1]
filename = "ref.flatpakref"
response = requests.get(url[8:])
file_path = f"{tempfile.gettempdir()}/{filename}"
# Check if the request was successful (status code 200)
if response.status_code == 200:
# Open the file in binary write mode and save the content
with open(file_path, 'wb') as file:
file.write(response.content)
print(f"File downloaded and saved to {file_path}")
else:
print(f"Failed to download file. HTTP Status code: {response.status_code}")

file = Gio.File.new_for_path(file_path)

self.activate()
self.installer.get_pkginfo_from_ref_file(file, self.on_pkginfo_from_uri_complete)

elif num > 1:
print("MintInstall: Unknown arguments", args[1:])
sys.exit(1)
Expand Down
3 changes: 2 additions & 1 deletion usr/share/applications/mintinstall.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,12 @@ Comment[zgh]=ⵙⵔⵙ ⵜⵉⵙⵏⵙⵉⵡⵉⵏ ⵜⵉⵎⴰⵢⵏⵓⵜⵉ
Comment[zh_CN]=安装新程序
Comment[zh_HK]=安裝新應用程式
Comment[zh_TW]=安裝新應用程式
Exec=mintinstall
Exec=mintinstall %u
Icon=mintinstall
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Application;System;Settings;XFCE;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;
NotShowIn=KDE;
StartupNotify=true
MimeType=x-scheme-handler/flatpak+https;