MRTestRepo/PepProTools/pge.py

83 lines
2.2 KiB
Python
Executable File

#!/usr/bin/env python3
import os
import subprocess as sp
import tkinter as tk
import ttkbootstrap as ttk
from tendo import singleton
#setting up window
pex = ttk.Window(themename="darkly")
window_height = 230
window_width = 355
pex.title('Get Extras')
pex.tk.call('wm', 'iconphoto', pex._w, tk.PhotoImage(file='/usr/share/pixmaps/peppermint-old.png'))
#keep only instance at a time
me = singleton.SingleInstance()
#main title style
spmt = ttk.Style()
spmt.configure("#F62817.TLabel", foreground ="#b12026", background ="#222222", font = ("Helvetica", '12', 'bold') )
###Verbiage and titel Placements###
lblpmwelttl = ttk.Label(pex, style="Whiteb.TLabel", text="Download and Install Wallpaper, Themes and Icons ")
lblpmwelttl.place(x=10, y=10)
#Functions to open the other pythons files. or close this screen ###
#open the sure scripts
def pi ():
pex.destroy()
os.popen ('python3 /opt/pypep/icosure.py')
def thm ():
pex.destroy()
os.popen ('python3 /opt/pypep/thmsure.py')
def wls ():
pex.destroy()
os.popen ('python3 /opt/pypep/wallsure.py')
#close Button
def qte ():
pex.destroy()
os.popen ('python3 /opt/pypep/welcome_man.py')
def center_screen():
""" gets the coordinates of the center of the screen """
global screen_height, screen_width, x_cordinate, y_cordinate
screen_width = pex.winfo_screenwidth()
screen_height = pex.winfo_screenheight()
# Coordinates of the upper left corner of the window to make the window appear in the center
x_cordinate = int((screen_width/2) - (window_width/2))
y_cordinate = int((screen_height/2) - (window_height/2))
pex.geometry("{}x{}+{}+{}".format(window_width, window_height, x_cordinate, y_cordinate))
###All the buttons and placements##
btncore = ttk.Button(text="Peppermint Themes", bootstyle="danger-outline", command=thm, width=20)
btncore.place(x=90, y=50)
bttut = ttk.Button(text='Peppermint Icons', command=pi, bootstyle="danger-outline", width=20 )
bttut.place(x=90, y=90)
bttut = ttk.Button(text='Peppermint WallPaper', command=wls, bootstyle="danger-outline", width=20 )
bttut.place(x=90, y=130)
btnrn = ttk.Button(text="Close", bootstyle="light-outline", command=qte, width=10)
btnrn.place(x=225, y=190)
#call Center screen
center_screen()
pex.mainloop()