-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
158 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_() |