Updated: New Xdaily GUI

This is the GUI for the xDaily

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2024-05-13 17:40:02 +09:00
parent cf1da3add5
commit a5c271aa3a
7 changed files with 1516 additions and 1 deletions

View File

@ -0,0 +1,329 @@
"""
* Author: "PepDebian(peppermintosteam@proton.me)
*
* License: SPDX-License-Identifier: GPL-3.0-or-later
*
* This is the Xdaily Gui layout application, its is used to manage the
* overy health of the system
"""
import tkinter as tk
import ttkbootstrap as ttk
import xdailyconf
import xdaily_functions
##### Set up the window and window icon ####
pexd = xdailyconf.bbstyle
pexd.resizable(False, False)
WINDOW_HEIGHT = 400
WINDOW_WIDTH = 650
pexd.tk.call('wm', 'iconphoto', pexd, tk.PhotoImage(
file='/usr/share/pixmaps/peppermint-old.png'))
#############################################
##### Set the main notebook ####
main_notebook = ttk.Notebook(pexd, bootstyle="danger")
main_notebook.pack(expand=True, fill='both')
### Set the tabs in the notebook ###
xd_intro = ttk.Frame(main_notebook)
manage_updates = ttk.Frame(main_notebook)
system_maintenance = ttk.Frame(main_notebook)
### Tab label text ###
main_notebook.add(xd_intro, text='xDaily Introduction')
main_notebook.add(manage_updates, text='Manage Updates')
main_notebook.add(system_maintenance, text='System Maintenance')
### Binds for the tabs when they are clicked ###
# This one is for the system maint
system_maintenance.bind("<Button-1>",
lambda event: xdaily_functions.system_maintenance_tab(main_notebook,
output_text_maint,run_task_maintenance)
)
###############################################
#### The in and out texts for the terminal piping ####
#### on the Manage updates tab ####
text_font = ("Helvetica", 10)
output_text = tk.Text(manage_updates, height=10, font=text_font,
wrap="word"
)
output_text.place(x=200, y=135,width=430, height=200)
# on the system maint tab
output_text_maint = tk.Text(system_maintenance, height=10, font=text_font,
wrap="word"
)
output_text_maint.place(x=200, y=135,width=430, height=200)
##################################################
##### These are the summary descriptions for the tabs and features####
xdaily_introduction_summary = ttk.Label(xd_intro,
text=(xdailyconf.INTRODUCTION_TEXT),
wraplength=600,
justify='left'
)
xdaily_introduction_summary.place(x=10, y=10)
manage_updates_description = ttk.Label(manage_updates,
text=(xdailyconf.CHECK_UPDATES_TEXT),
wraplength=430,
justify='left'
)
manage_updates_description.place(x=200, y=10)
system_maintenance_description = ttk.Label(system_maintenance,
text=(xdailyconf.BROWSER_THUMBNAIL_CACHE_TEXT),
wraplength=430, justify='left'
)
system_maintenance_description.place(x=200, y=10)
#######################################################
#### The run buttons for each tab ####
#### Manage updates tave run button ####
run_task_updates = ttk.Button(manage_updates, text="Run",
bootstyle="danger", cursor="hand2", width=5,
command=lambda: xdaily_functions.run_apt_update(output_text,
manage_updates
)
)
run_task_updates.place(x=562, y=100)
## System Maint run button ##
run_task_maintenance = ttk.Button(system_maintenance, text="Run",
bootstyle="danger", cursor="hand2", width=5
)
run_task_maintenance.place(x=562, y=100)
########################################################
#########################################################
### xd_intro tab buttons ####
menu_xd_intro = ttk.Labelframe(xd_intro, bootstyle="dark",
text="What would you like to do?"
)
menu_xd_intro.place(x=5, y=150)
### Label frames for each tab ###
menu_manage_updates = ttk.Labelframe(manage_updates, bootstyle="dark",
text="Tasks to run"
)
menu_manage_updates.place(x=5, y=10)
menu_system_maintenance = ttk.Labelframe(system_maintenance,
bootstyle="dark", text="Tasks to run"
)
menu_system_maintenance.place(x=5, y=10)
###########################################################
#### Buttons on the xDaily Tab ####
get_started = ttk.Button(menu_xd_intro, text="Get started",
bootstyle="danger", cursor="hand2",
command=lambda:xdaily_functions.manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro,manage_updates),
width=8
)
get_started.grid(row=1, column=0, ipadx=6.5, ipady=6.5, padx=6.5,
pady=6.5,
sticky='ew'
)
pep_docs = ttk.Button(menu_xd_intro, text="Pep Docs",
bootstyle="danger", cursor="hand2",
command = xdaily_functions.pep_docs,
width=8
)
pep_docs.grid(row=1, column=1, ipadx=6.5, ipady=6.5, padx=6.5,
pady=6.5, sticky='ew'
)
community = ttk.Button(menu_xd_intro, text="Forums",
bootstyle="danger", cursor="hand2",
command = xdaily_functions.source_forge, width=8
)
community.grid(row=2, column=0, ipadx=6.5, ipady=6.5, padx=6.5,
pady=6.5, sticky='ew'
)
runall = ttk.Button(menu_xd_intro, text="Run all tasks",
bootstyle="danger", cursor="hand2",
command = xdaily_functions.run_terminal_xdaily, width=8
)
runall.grid(row=2, column=1, ipadx=6.5, ipady=6.5, padx=6.5, pady=6.5,
sticky='ew'
)
#####################################################
#### Buttons for the Manage Updates tab ####
check_for_updates = ttk.Button(menu_manage_updates,
text="Check for Updates", bootstyle="danger", cursor="hand2",
width=15,
command= lambda: xdaily_functions.set_command_to_check_update(
run_task_updates, output_text, manage_updates, xd_intro
)
)
check_for_updates.bind("<Button-1>", lambda event,
label=manage_updates_description,
text=xdailyconf.CHECK_UPDATES_TEXT: \
xdaily_functions.update_label_text(label, text)
)
check_for_updates.grid(row=1, column=0, ipadx=5, ipady=5, padx=5,
pady=5, sticky='ew'
)
#### Manage updates Tab buttons ####
view_updates_available = ttk.Button(menu_manage_updates,
text="View Updates", bootstyle="danger", cursor="hand2", width=15,
command= lambda: xdaily_functions.set_command_to_view_update(
run_task_updates, output_text, manage_updates, xd_intro
)
)
view_updates_available.grid(row=2, column=0, ipadx=5, ipady=5, padx=5,
pady=5,sticky='ew'
)
view_updates_available.bind("<Button-1>", lambda event,
label=manage_updates_description,
text=xdailyconf.VIEW_UPDATES_TEXT: \
xdaily_functions.update_label_text(label, text,))
install_updates = ttk.Button(menu_manage_updates,
text="Install Updates", bootstyle="danger", cursor="hand2",
width=15,
command= lambda: xdaily_functions.set_command_to_install_update(
run_task_updates, output_text, manage_updates, xd_intro
)
)
install_updates.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
install_updates.bind("<Button-1>", lambda event,
label=manage_updates_description,
text=xdailyconf.NSTALL_UPDATES_TEXT: \
xdaily_functions.update_label_text(label, text)
)
apt_clean = ttk.Button(menu_manage_updates, text="Run apt clean",
bootstyle="danger", cursor="hand2", width=15,
command= lambda: xdaily_functions.set_command_to_apt_clean(
run_task_updates, output_text, manage_updates
)
)
apt_clean.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
apt_clean.bind("<Button-1>", lambda event,
label=manage_updates_description,
text=xdailyconf.RUN_APT_CLEAN_TEXT: \
xdaily_functions.update_label_text(label, text)
)
apt_auto_clean = ttk.Button(menu_manage_updates,
text="Run apt autoclean", bootstyle="danger", cursor="hand2",
width=15,
command= lambda: xdaily_functions.set_command_to_autoclean(
run_task_updates, output_text, manage_updates
)
)
apt_auto_clean.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
apt_auto_clean.bind("<Button-1>", lambda event,
label=manage_updates_description,
text=xdailyconf.RUN_APT_AUTOCLEAN_TEXT: \
xdaily_functions.update_label_text(label, text)
)
apt_auto_remove = ttk.Button(menu_manage_updates,
text="Run apt autoremove", bootstyle="danger",
cursor="hand2", width=15,
command= lambda: xdaily_functions.set_command_to_autoremove(
run_task_updates, output_text, manage_updates
)
)
apt_auto_remove.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
apt_auto_remove.bind("<Button-1>",
lambda event, label=manage_updates_description,
text=xdailyconf.RUN_APT_AUTOREMOVE_TEXT: \
xdaily_functions.update_label_text(label, text)
)
################################################
#### Button for the System Maint Tab ####
browser_thumbnail_cache = ttk.Button(menu_system_maintenance,
text="Thumbnail Cache", bootstyle="danger", cursor="hand2",
width=15,
command= lambda: xdaily_functions.set_command_to_thumnail_cache(
run_task_maintenance, output_text_maint, system_maintenance
)
)
browser_thumbnail_cache.bind("<Button-1>", lambda event,
label=system_maintenance_description,
text=xdailyconf.BROWSER_THUMBNAIL_CACHE_TEXT: \
xdaily_functions.update_label_text(label, text)
)
browser_thumbnail_cache.grid(row=1, column=0, ipadx=5, ipady=5, padx=5,
pady=5, sticky='ew'
)
clear_recently_used_list_firefox = ttk.Button(menu_system_maintenance,
text="Recently Used", bootstyle="danger", cursor="hand2", width=15,
command= lambda: xdaily_functions.set_command_recently_used(
run_task_maintenance, output_text_maint, system_maintenance
)
)
clear_recently_used_list_firefox.bind("<Button-1>", lambda event,
label=system_maintenance_description,
text=xdailyconf.CLEAR_RECENTLYUSED_FIREFOX_TEXT: \
xdaily_functions.update_label_text(label, text)
)
clear_recently_used_list_firefox.grid(row=2, column=0, ipadx=5,
ipady=5, padx=5, pady=5, sticky='ew'
)
peppermint_branding = ttk.Button(menu_system_maintenance,
text="Peppermint Branding", bootstyle="danger", cursor="hand2",
width=15,
command= lambda: xdaily_functions.set_command_peppermint_branding(
run_task_maintenance, output_text_maint, system_maintenance
)
)
peppermint_branding.bind("<Button-1>", lambda event,
label=system_maintenance_description,
text=xdailyconf.PEPPERMINT_BRANDING_TEXT: \
xdaily_functions.update_label_text(label, text)
)
peppermint_branding.grid(row=3, column=0, ipadx=5, ipady=5, padx=5,
pady=5, sticky='ew'
)
ssd_trimming = ttk.Button(menu_system_maintenance, text="SSD TRIM",
bootstyle="danger", cursor="hand2", width=15,
command= lambda: xdaily_functions.set_command_ssd_trim(
run_task_maintenance, output_text_maint, system_maintenance
)
)
ssd_trimming.bind("<Button-1>", lambda event,
label=system_maintenance_description,
text=xdailyconf.SSD_TRIMMING_TEXT: \
xdaily_functions.update_label_text(label, text)
)
ssd_trimming.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
caching_icons = ttk.Button(menu_system_maintenance,
text="Cache Icons", bootstyle="danger", cursor="hand2", width=15,
command= lambda: xdaily_functions.set_caching_icons(
run_task_maintenance, output_text_maint, system_maintenance
)
)
caching_icons.bind("<Button-1>",
lambda event,
label=system_maintenance_description,
text=xdailyconf.CACHING_ICONS_TEXT:\
xdaily_functions.update_label_text(label, text)
)
caching_icons.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
main_notebook.bind("<<NotebookTabChanged>>", lambda event,
run_task_updates=run_task_updates, output_text=output_text,
manage_updates=manage_updates,
xd_intro=xd_intro: xdaily_functions.on_manage_updates_clicked(
event, run_task_updates, run_task_maintenance,
output_text, output_text_maint, manage_updates,
system_maintenance, xd_intro)
)
##################################################
### Start the functions ####
xdaily_functions.center_screen(pexd,WINDOW_HEIGHT,WINDOW_WIDTH)
xdaily_functions.wbase(pexd)
xdaily_functions.currently_pending_updates(xd_intro)
pexd.mainloop()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,137 @@
import ttkbootstrap as ttk
import os
# This will set the style to used for bootstrap
# just change the name to what is needed for the
# the system
bbstyle = ttk.Window(themename="peppermint")
# set the title of the window
DEBIAN_TITLE = "xDaily - Automated System Maintenance (Debian)"
DEVUAN_TITLE = "xDaily - Automated System Maintenance (Devuan)"
INTRODUCTION_TEXT =("xDaily offers a seamless and user-friendly system "
"updating experience. It seamlessly integrates "
"semi-automatic command-line and GUI "
"functionalities, ensuring a hassle-free upgrate "
"process. With just a simple command, it "
"efficiently upgrates your system, encompassing "
"essential tasks such as cache cleanup, SSD "
"optimization, icon cache updates, and automatic "
"removal of outdated repositories. It's a "
"comprehensive solution designed to streamline "
"and enhance the system maintenance routine"
)
CHECK_UPDATES_TEXT =("The 'Check for Updates' feature allows users to "
"verify the availability of system updates. By "
"simply pressing the 'run' button, xDaily "
"promptly checks for any available updates for "
"the system, ensuring users stay informed and "
"up-to-date with the latest packages"
)
VIEW_UPDATES_TEXT =("The 'View Updates' feature offers users a "
"convenient way to explore available updates ready "
"for installation on the system. By pressing the "
"'run' button, xDaily promptly presents a list of "
"updates ready for deployment, enabling users to "
"stay informed about what updates will be installed"
)
NSTALL_UPDATES_TEXT = ("The 'Install Updates' feature empowers users to "
"seamlessly install available updates for their "
"system. With a simple click of the 'run' "
"button, xDaily installs any pending updates, "
"ensuring that the system remains up-to-date "
"with the latest packages and security patches."
)
RUN_APT_CLEAN_TEXT =("The 'Run apt clean' feature provides users with "
"a convenient way to optimize disk space usage by "
"removing all cached package files. By pressing "
"the 'run' button, xDaily clears the cache, "
"freeing up valuable disk space. It's important "
"to note that this action may require packages to "
"be redownloaded later when needed."
)
RUN_APT_AUTOCLEAN_TEXT =("The 'Run apt autoclean' feature enables "
"users to optimize disk space usage by "
"removing only outdated package files from "
"the cache, while preserving the cache for "
"currently installed packages. By pressing "
"the 'run' button, xDaily cleans up "
"unnecessary files, freeing up disk space "
"without compromising needed package files. "
)
RUN_APT_AUTOREMOVE_TEXT = ("The 'Run apt autoremove' feature by "
"pressing the 'run' button is generally safe "
"and can help free up disk space by "
"removing packages that are no longer "
"needed. It's a good practice to run apt "
"autoremove periodically, especially after "
"removing or upgrading packages, to keep "
"the system clean and efficient."
)
BROWSER_THUMBNAIL_CACHE_TEXT = ("The 'Thumbnail Cache' feature is for "
"clearing the browser thumbnail cache "
"it can free up disk space, especially "
"if the browser cache has grown large "
"over time. It can also help resolve "
"certain browsing issues, such as "
"thumbnails not updating or displaying "
"incorrectly."
)
CLEAR_RECENTLYUSED_FIREFOX_TEXT = ("The 'Recently Used' option is used "
"to clear the list of recently used "
"files or downloads that Firefox "
"maintains. Downloading files with "
"Firefox, keeps a record of these "
"downloads this list allows for "
"quickly accessing files recently "
"downloaded without having to search "
"for them in the file system."
)
PEPPERMINT_BRANDING_TEXT = ("Sometimes, when updates are applied, the "
"upstream branding setting may override "
"our custom branding. This feature ensures "
"that if any updates remove or alter any "
"Perppermint-specific branding, it will be "
"set correctly."
)
SSD_TRIMMING_TEXT = ("SSD trimming ensures that the operating system "
"sends TRIM commands to the SSD, informing it of "
"the blocks that are no longer in use. This "
"allows the SSD to proactively erase these blocks "
"in the background, ensuring that when new data is "
"written, it can be stored efficiently without "
"the need to first erase old data"
)
CACHING_ICONS_TEXT = ("Displaying icons in your desktop environment "
"involves reading image files stored on the disk."
"This process can slow down system "
"responsiveness, particularly with many icons or "
"slow disk access speeds."
"The caching mechanism helps improve the overall "
"responsiveness of the desktop environment. "
)

0
iso_configs/pylibraries/ttkbootstrap/style.py Normal file → Executable file
View File

45
iso_configs/pylibraries/ttkbootstrap/themes/standard.py Normal file → Executable file
View File

@ -241,7 +241,7 @@ STANDARD_THEMES = {
"danger": "#e74c3c",
"light": "#ADB5BD",
"dark": "#303030",
"bg": "#222222",
"bg": "#c0c0c0",
"fg": "#ffffff",
"selectbg": "#555555",
"selectfg": "#ffffff",
@ -251,6 +251,49 @@ STANDARD_THEMES = {
"active": "#1F1F1F",
},
},
"peppermint": {
"type": "light",
"colors": {
"primary": "#375a7f",
"secondary": "#444444",
"success": "#00bc8c",
"info": "#3498db",
"warning": "#f39c12",
"danger": "#ff0000",
"light": "#ffffff",
"dark": "#303030",
"bg": "#c0c0c0",
"fg": "#000000",
"selectbg": "#555555",
"selectfg": "#ffffff",
"border": "#000000",
"inputfg": "#463939",
"inputbg": "#ffffff",
"active": "#1F1F1F",
},
},
"peppermint_notebook": {
"type": "light",
"colors": {
"primary": "#375a7f",
"secondary": "#444444",
"success": "#00bc8c",
"info": "#3498db",
"warning": "#f39c12",
"danger": "#ff0000",
"light": "#ffffff",
"dark": "#303030",
"bg": "#c0c0c0",
"fg": "#000000",
"selectbg": "#555555",
"selectfg": "#ffffff",
"border": "#000000",
"inputfg": "#ffffff",
"inputbg": "#ff0000",
"active": "#1F1F1F",
},
},
"superhero": {
"type": "dark",
"colors": {

View File

@ -246,6 +246,7 @@ class BuildServer(BuildBase):
exec(execute)
return cmd_list
class BuildMini(BuildBase):
""" This class will ensure the Mini builds are built """
def __init__(self, sbase, sarch):