forked from Jerec4stro/Pywrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpywrapGUI.py
More file actions
137 lines (99 loc) · 3.92 KB
/
pywrapGUI.py
File metadata and controls
137 lines (99 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#! librerias
import git
from git import Repo
import os
import time
import math
from colorama import Back, init, Fore
import tkinter as tk
from tkinter import filedialog
repo = "https://github.com/ujjwal96/xwinwrap.git"
#! funcion para clonar y compilar el repositorio
def repo_clone():
if (os.path.exists("pywrap") == False):
os.mkdir("pywrap")
os.chdir("pywrap")
path = os.getcwd()
Repo.clone_from(f"{repo}", f"{path}") and os.system(
"make 1> /dev/null && sudo make install 1> /dev/null && make clean 1> /dev/null && clear")
elif (os.path.exists("pywrap") == True):
print("Ya tiene instaladas todas las dependencias")
#! funcion para setear el wallpaper
def SetVW(videoPath):
CMND = "xwinwrap -fs -fdt -ni -b -nf -un -o 1.0 -debug -- mpv -wid WID --loop --no-audio " + videoPath
os.system(f"{CMND} > /dev/null 2>&1 &")
exit()
#! Instancia de la clase Tk
root = tk.Tk()
root.geometry("500x300+100+100")
#! funcion que ejecuta ambas funciones
def seleccionar_archivo_y_setear_wallpaper():
videoPath = filedialog.askopenfilename()
SetVW(videoPath=videoPath)
#! _Botón que llamará a la nueva funcion cuando se haga click en el
button = tk.Button(root, text="Seleccione el video",
command=seleccionar_archivo_y_setear_wallpaper)
#! Barra de progreso
def barra_progreso(progreso, total):
porcentaje = 100 * (progreso / float(total)) # ! calcula el porcentaje
bar = (Back.GREEN+' '+Back.RESET) * int(porcentaje) + \
'-' * (100 - int(porcentaje)) # ! define la barra
# ! muestra barra + porcentaje
print(f"\r | {bar} {porcentaje:.2f}%|", end="\r")
#! genera lista de valores
numeros = [x * 5 for x in range(1000, 3000)]
#! resultados
resultados = []
#! realiza calculos
for i, x in enumerate(numeros):
resultados.append(math.factorial(x))
# ! llamada a la funcion 'barra_progreso'
barra_progreso(i + 1, len(numeros))
print("\n")
print("\n")
print("\n")
print("\n")
print(Fore.GREEN +""" -----------------------------------
!! Bienvenidx a PyWrap !!
----------------------------------- """)
# ! banner
print("\n")
print("\n")
print(Fore.GREEN +""" .,,uod8B8bou,,.
..,uod8BBBBBBBBBBBBBBBBRPFT?l!i:.
,=m8BBBBBBBBBBBBBBBRPFT?!||||||||||||||
!...:!TVBBBRPFT||||||||||!!^^""' ||||
!.......:!?|||||!!^^""' ||||
!.........|||| ||||
!.........|||| ## ||||
!.........|||| ||||
!.........|||| ||||
!.........|||| ||||
!.........|||| ||||
`.........|||| ,||||
.;.......|||| _.-!!|||||
.,uodWBBBBb.....|||| _.-!!|||||||||!:'
!YBBBBBBBBBBBBBBb..!|||:..-!!|||||||!iof68BBBBBb....
!..YBBBBBBBBBBBBBBb!!||||||||!iof68BBBBBBRPFT?!:: `.
!....YBBBBBBBBBBBBBBbaaitf68BBBBBBRPFT?!::::::::: `.
!......YBBBBBBBBBBBBBBBBBBBRPFT?!::::::;:!^"`;::: `.
!........YBBBBBBBBBBRPFT?!::::::::::^''...::::::; iBBbo.
`..........YBRPFT?!::::::::::::::::::::::::;iof68bo. WBBBBbo.
`..........:::::::::::::::::::::::;iof688888888888b. `YBBBP^'
`........::::::::::::::::;iof688888888888888888888b. `
`......:::::::::;iof688888888888888888888888888888b.
`....:::;iof688888888888888888888888888888888899fT!
`..::!8888888888888888888888888888888899fT|!^"'
`' !!988888888888888888888888899fT|!^"'
`!!8888888888888888899fT|!^"'
`!988888888899fT|!^"'
`!9899fT|!^"'
`!^"'""")
print(""" by ninj4""")
print("\n")
print("\n")
print("\n")
print("\n")
repo_clone()
button.pack()
root.mainloop()