Skip to content

Commit

Permalink
Master
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghalbeyou committed Jun 4, 2023
1 parent 03f46b9 commit edbc11e
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2023 Arash Amini (Known as ghalbeyou)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 9 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ThemeCord

All of the **information** is on the front page of themecord github.

## Develop
If you want to develop this app, or help it you can in this repo.

## Download
If you want to download, use the releases.
47 changes: 47 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import urllib.request
import subprocess
import os

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QMessageBox
from ui_mainwindow import Ui_MainWindow
from ui_remove import Ui_Remove


class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.pushButton.clicked.connect(self.inject_theme)
self.ui.pushButton_2.clicked.connect(self.remove_theme)

def remove_theme(self):
dialog = QtWidgets.QDialog(self)
ui = Ui_Remove()
ui.setupUi(dialog)
dialog.exec_()

def inject_theme(self):
css_url = self.ui.textEdit.toPlainText()
if css_url == "":
self.ui.label.setText("Please fill the input")
return
css_filename = css_url.split("/")[-1]
css_path = os.path.join(os.path.dirname(__file__), "themecord", css_filename)
urllib.request.urlretrieve(css_url, css_path)
subprocess.run([os.path.join(os.path.dirname(__file__), "themecord", "injector.exe"), "--css", css_path], check=True)
message_box = QMessageBox()
message_box.setWindowTitle("Complete")
message_box.setText("Installed theme on the current running discord.")
message_box.setIcon(QMessageBox.Information)
message_box.addButton(QMessageBox.Ok)
message_box.exec_()


if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())
Binary file added themecord/Injector.exe
Binary file not shown.
Binary file added themecord/VCRUNTIME140.dll
Binary file not shown.
Binary file added themecord/base_library.zip
Binary file not shown.
Binary file added themecord/libcrypto-1_1.dll
Binary file not shown.
Binary file added themecord/libffi-7.dll
Binary file not shown.
Binary file added themecord/libssl-1_1.dll
Binary file not shown.
Binary file added themecord/python310.dll
Binary file not shown.
61 changes: 61 additions & 0 deletions ui_mainwindow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(789, 466)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.verticalLayoutWidget.setGeometry(QtCore.QRect(100, 100, 571, 191))
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtWidgets.QLabel(self.verticalLayoutWidget)
font = QtGui.QFont()
font.setPointSize(15)
font.setBold(True)
font.setWeight(75)
font.setKerning(True)
self.label.setFont(font)
self.label.setMouseTracking(False)
self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
self.label.setAutoFillBackground(False)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.textEdit = QtWidgets.QTextEdit(self.verticalLayoutWidget)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
font.setKerning(True)
self.textEdit.setFont(font)
self.textEdit.setObjectName("textEdit")
self.verticalLayout.addWidget(self.textEdit)
self.pushButton = QtWidgets.QPushButton(self.verticalLayoutWidget)
self.pushButton.setObjectName("pushButton")
self.verticalLayout.addWidget(self.pushButton)
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_2.setGeometry(QtCore.QRect(660, 380, 93, 28))
self.pushButton_2.setObjectName("pushButton_2")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 789, 26))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)

self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label.setText(_translate("MainWindow", "Register theme"))
self.pushButton.setToolTip(_translate("MainWindow", "<html><head/><body><p><span style=\" font-weight:600;\">Add this theme to the discord</span></p></body></html>"))
self.pushButton.setText(_translate("MainWindow", "Register theme"))
self.pushButton_2.setToolTip(_translate("MainWindow", "<html><head/><body><p><span style=\" font-weight:600;\">Remove all of themes applied to the discord</span></p></body></html>"))
self.pushButton_2.setText(_translate("MainWindow", "Remove"))
40 changes: 40 additions & 0 deletions ui_remove.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox
import subprocess
import os


class Ui_Remove(object):
def setupUi(self, Remove):
Remove.setObjectName("Remove")
Remove.resize(393, 219)
self.buttonBox = QtWidgets.QDialogButtonBox(Remove)
self.buttonBox.setGeometry(QtCore.QRect(-20, 120, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.label = QtWidgets.QLabel(Remove)
self.label.setGeometry(QtCore.QRect(30, 90, 341, 21))
font = QtGui.QFont()
font.setPointSize(7)
self.label.setFont(font)
self.label.setObjectName("label")

self.retranslateUi(Remove)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(Remove.reject)
QtCore.QMetaObject.connectSlotsByName(Remove)

def retranslateUi(self, Remove):
_translate = QtCore.QCoreApplication.translate
Remove.setWindowTitle(_translate("Remove", "Remove"))
self.label.setText(_translate("Remove", "Are you sure you want to remove all of the themes applied?"))

def accept(self):
subprocess.run([os.path.join(os.path.dirname(__file__), "themecord", "injector.exe"), "--revert"], check=True)
message_box = QMessageBox()
message_box.setWindowTitle("Complete")
message_box.setText("Removed themes on the current running discord.")
message_box.setIcon(QMessageBox.Information)
message_box.addButton(QMessageBox.Ok)
message_box.exec_()

0 comments on commit edbc11e

Please sign in to comment.