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
Expand Up @@ -2,6 +2,7 @@

import subprocess
import os
import sys

# Remove any obsolete configuration file
obsolete_path = os.path.expanduser("~/.config/autostart/mintinstall-update-flatpak.desktop")
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:])
27 changes: 27 additions & 0 deletions usr/lib/linuxmint/mintinstall/mintinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ def __init__(self):
self.recursion_buster = False

self.install_on_startup_file = None
self.show_on_startup_pkg = None

self.review_cache = None
self.current_pkginfo = None
Expand Down Expand Up @@ -701,6 +702,22 @@ def do_command_line(self, command_line, data=None):
sys.exit(self.export_listing(flatpak_only=False))
elif num > 1 and args[1] == "list-flatpak":
sys.exit(self.export_listing(flatpak_only=True))
elif num == 3 and args[1] == "show":
target_pkg = args[2]
if self.gui_ready:
pkginfo = self.installer.find_pkginfo(target_pkg, installer.PKG_TYPE_APT)
if not pkginfo:
pkginfo = self.installer.find_pkginfo(target_pkg, installer.PKG_TYPE_FLATPAK)
if pkginfo:
self.show_package(pkginfo, self.PAGE_LANDING)
self.main_window.present()
else:
print(f"MintInstall: Package {target_pkg} not found.")
else:
self.show_on_startup_pkg = target_pkg

self.activate()
return 0
elif num == 3 and args[1] == "install":
for try_method in (Gio.File.new_for_path, Gio.File.new_for_uri):
file = try_method(args[2])
Expand Down Expand Up @@ -2176,6 +2193,16 @@ def finished_loading_packages(self):
self.gui_ready = True
self.update_conditional_widgets()

if self.show_on_startup_pkg is not None:
pkginfo = self.installer.find_pkginfo(self.show_on_startup_pkg, installer.PKG_TYPE_APT)
if not pkginfo:
pkginfo = self.installer.find_pkginfo(self.show_on_startup_pkg, installer.PKG_TYPE_FLATPAK)
if pkginfo:
self.show_package(pkginfo, self.PAGE_LANDING)
else:
print(f"MintInstall: Package {self.show_on_startup_pkg} not found.")
self.show_on_startup_pkg = None

if self.install_on_startup_file is not None:
self.handle_command_line_install(self.install_on_startup_file)

Expand Down