update installer logos
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 14 KiB |
|
@ -1,3 +1,10 @@
|
|||
"""
|
||||
* Author: "PepDebian(peppermintosteam@proton.me)
|
||||
*
|
||||
* License: SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* This is for the suggested packages GUI
|
||||
"""
|
||||
import os
|
||||
import subprocess
|
||||
import tkinter as tk
|
||||
|
@ -20,7 +27,7 @@ def center_screen():
|
|||
pwin.geometry("{}x{}+{}+{}".format(WINDOW_WIDTH,
|
||||
WINDOW_HEIGHT, x_cordinate, y_cordinate))
|
||||
|
||||
def check_packages(pdf_viewer, snap, media_player, fire_wall, flatpak, backup_tool, store):
|
||||
def check_packages():
|
||||
""" Check if software is installed"""
|
||||
if os.path.exists('/usr/bin/atril'):
|
||||
pdf_viewer['state'] = tk.DISABLED
|
||||
|
@ -37,7 +44,8 @@ def check_packages(pdf_viewer, snap, media_player, fire_wall, flatpak, backup_to
|
|||
if os.path.exists('/usr/bin/gnome-software'):
|
||||
store['state'] = tk.DISABLED
|
||||
|
||||
def check_web_browsers(fire_fox, kde_web, qute_web, falkon_web, chromium_web, gnome_web, store):
|
||||
|
||||
def check_web_browsers():
|
||||
""" Check what browsers are installed"""
|
||||
if os.path.exists('/usr/bin/firefox'):
|
||||
fire_fox['state'] = tk.DISABLED
|
||||
|
@ -54,133 +62,281 @@ def check_web_browsers(fire_fox, kde_web, qute_web, falkon_web, chromium_web, gn
|
|||
if os.path.exists('/usr/bin/gnome-software'):
|
||||
store['state'] = tk.DISABLED
|
||||
|
||||
# ***GUI widgets for suggested packages***
|
||||
software_frame = ttk.Labelframe(pwin, bootstyle="warning", text="Suggested Software")
|
||||
software_frame.grid(row=0, column=0, padx=10, pady=10, sticky='ew')
|
||||
|
||||
pdf_viewer = ttk.Button(software_frame, text="PDF Viewer")
|
||||
snap = ttk.Button(software_frame, text="Snap")
|
||||
media_player = ttk.Button(software_frame, text="Media Player")
|
||||
fire_wall = ttk.Button(software_frame, text="Firewall")
|
||||
flatpak = ttk.Button(software_frame, text="Flatpak")
|
||||
backup_tool = ttk.Button(software_frame, text="Backup Tool")
|
||||
store = ttk.Button(software_frame, text="Store")
|
||||
|
||||
# ***GUI widgets for web browsers***
|
||||
browser_frame = ttk.Labelframe(pwin, bootstyle="warning", text="Suggested Web Browsers")
|
||||
browser_frame.grid(row=1, column=0, padx=10, pady=10, sticky='ew')
|
||||
|
||||
fire_fox = ttk.Button(browser_frame, text="Firefox")
|
||||
kde_web = ttk.Button(browser_frame, text="Konqueror")
|
||||
qute_web = ttk.Button(browser_frame, text="Qutebrowser")
|
||||
falkon_web = ttk.Button(browser_frame, text="Falkon")
|
||||
chromium_web = ttk.Button(browser_frame, text="Chromium")
|
||||
gnome_web = ttk.Button(browser_frame, text="Gnome Web")
|
||||
|
||||
# Call the functions with the GUI widgets as arguments
|
||||
check_packages(pdf_viewer, snap, media_player, fire_wall, flatpak, backup_tool, store)
|
||||
check_web_browsers(fire_fox, kde_web, qute_web, falkon_web, chromium_web, gnome_web, store)
|
||||
|
||||
|
||||
# ***Install Packages***
|
||||
def install_atril():
|
||||
""" Install atril """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"atril"])
|
||||
"atril"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_keepass():
|
||||
""" Install KeePass """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"keepassxc"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_parole():
|
||||
""" Install parole """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"parole"])
|
||||
"parole"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_gufw():
|
||||
""" Install gufw """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"gufw"])
|
||||
"gufw"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_snap():
|
||||
""" Install install snap"""
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"snapd"])
|
||||
"snapd"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_flatpak():
|
||||
""" Install flatpak """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"flatpak"])
|
||||
"flatpak"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_store():
|
||||
""" Install gnome store"""
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"gnome-software"])
|
||||
"gnome-software"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
def install_timeshift():
|
||||
""" Install timeshift"""
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"timeshift"])
|
||||
"timeshift"]
|
||||
)
|
||||
check_packages()
|
||||
|
||||
|
||||
# ***Web browser defs***
|
||||
def install_firefox():
|
||||
""" Install firefox-esr """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"firefox-esr"])
|
||||
"firefox-esr"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def install_konqueror():
|
||||
""" Install konqueror """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"konqueror"])
|
||||
"konqueror"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def install_epiphany():
|
||||
""" Install epiphany-browser """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"epiphany-browser"])
|
||||
"epiphany-browser"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def install_tor():
|
||||
""" Install torbrowser-launcher """
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"torbrowser-launcher"])
|
||||
"torbrowser-launcher"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def install_qute():
|
||||
""" Install install qutebrowser"""
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"qutebrowser"])
|
||||
"qutebrowser"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def install_chromium():
|
||||
""" Install chromium"""
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"chromium"])
|
||||
"chromium"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def install_falkon():
|
||||
""" Install falkon"""
|
||||
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
|
||||
"falkon"])
|
||||
"falkon"]
|
||||
)
|
||||
check_web_browsers()
|
||||
|
||||
|
||||
def check_base_snaps():
|
||||
""" If Devuan is loaded do not show snaps """
|
||||
if os.path.exists("/etc/devuan_version"):
|
||||
flatpak = ttk.Button(software_frame,
|
||||
text="Flatpak Package Platform",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_flatpak
|
||||
)
|
||||
flatpak.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
store = ttk.Button(software_frame,
|
||||
text="Gnome Software Store",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_store
|
||||
)
|
||||
store.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
backup_tool = ttk.Button(software_frame,
|
||||
text="TimeShift: Backup Tool",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_keepass
|
||||
)
|
||||
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
pwd_tool = ttk.Button(software_frame,
|
||||
text="KeePassXC: Password Tool",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_timeshift
|
||||
)
|
||||
pwd_tool.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
|
||||
elif os.path.exists("/etc/debian_version"):
|
||||
snap = ttk.Button(software_frame,
|
||||
text="Snap Package Platform",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_snap
|
||||
)
|
||||
snap.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
flatpak = ttk.Button(software_frame,
|
||||
text="Flatpak Package Platform",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_flatpak
|
||||
)
|
||||
flatpak.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
store = ttk.Button(software_frame,
|
||||
text="Gnome Software Store",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_store
|
||||
)
|
||||
store.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
backup_tool = ttk.Button(software_frame,
|
||||
text="TimeShift: Backup Tool",
|
||||
cursor="hand2", style="dark",
|
||||
command=install_timeshift
|
||||
)
|
||||
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
|
||||
|
||||
|
||||
# *** Below here is the layout of the forms***
|
||||
# Frame that managed the Welcome To Peppermint Section
|
||||
fsw = ttk.Frame(pwin, width=200)
|
||||
fsw.grid(row=2, column=0, columnspan=4)
|
||||
software_frame = ttk.Labelframe(fsw, bootstyle="warning",
|
||||
text="Suggested Software"
|
||||
)
|
||||
software_frame.grid(row=5, column=0, columnspan=2, ipadx=0, ipady=0,
|
||||
padx=10, pady=10
|
||||
)
|
||||
# Buttons for the suggested software
|
||||
pdf_viewer = ttk.Button(software_frame, text="Atril: a document viewer",
|
||||
cursor="hand2", style="dark", command=install_atril
|
||||
)
|
||||
pdf_viewer.grid(row=0, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
media_player = ttk.Button(software_frame, text="Parole: Media Player",
|
||||
cursor="hand2", style="dark", command=install_parole
|
||||
)
|
||||
media_player.grid(row=2, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
fire_wall = ttk.Button(software_frame, text="gufw: GNU Firewall",
|
||||
cursor="hand2", style="dark", command=install_gufw
|
||||
)
|
||||
fire_wall.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
# Frame that manages the Browser buttons
|
||||
fs = ttk.Frame(pwin)
|
||||
fs.grid(row=2, column=5, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10)
|
||||
|
||||
# Frame Title
|
||||
soc = ttk.Labelframe(fs, bootstyle="warning", text="Suggested Web Browsers")
|
||||
soc.grid(row=5, column=0, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10)
|
||||
|
||||
# Web Browser Buttons
|
||||
fire_fox = ttk.Button(soc, text="Firefox ESR Browser", cursor="hand2",
|
||||
style="dark", command=install_firefox
|
||||
)
|
||||
fire_fox.grid(row=0, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
|
||||
|
||||
kde_web = ttk.Button(soc, text="Konqueror KDE Browser", cursor="hand2",
|
||||
style="dark", command=install_konqueror
|
||||
)
|
||||
kde_web.grid(row=1, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
|
||||
|
||||
gnome_web = ttk.Button(soc, text="Gnome Web(Epiphany)", cursor="hand2",
|
||||
style="dark", command=install_epiphany
|
||||
)
|
||||
gnome_web.grid(row=2, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
|
||||
|
||||
tor_web = ttk.Button(soc, text="Tor Browser: Privacy", cursor="hand2",
|
||||
style="dark", command=install_tor
|
||||
)
|
||||
tor_web.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
|
||||
|
||||
qute_web = ttk.Button(soc, text="Qutebrowser: Vim-like ", cursor="hand2",
|
||||
style="dark", command=install_qute
|
||||
)
|
||||
qute_web.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
|
||||
|
||||
chromium_web = ttk.Button(soc, text="Chromium Browser", cursor="hand2",
|
||||
style="dark-", command=install_chromium
|
||||
)
|
||||
chromium_web.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
|
||||
sticky='ew'
|
||||
)
|
||||
falkon_web = ttk.Button(soc, text="Falkon Qt Browser", cursor="hand2",
|
||||
style="dark", command=install_falkon
|
||||
)
|
||||
falkon_web.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
|
||||
|
||||
lblpmtitle = ttk.Label(pwin, style="F62817.TLabel",
|
||||
text='These suggestions are listed in the official'
|
||||
' repositories'
|
||||
).place(x=5, y=440)
|
||||
check_base_snaps()
|
||||
check_packages()
|
||||
check_web_browsers()
|
||||
center_screen()
|
||||
pwin.mainloop()
|
||||
|
||||
|
|