Compare commits
1 Commits
master
...
7b695d7b7f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b695d7b7f |
10
BUILDING.md
10
BUILDING.md
@@ -7,6 +7,16 @@ $ pip install -r requirements.txt
|
||||
$ pip install pyinstaller
|
||||
```
|
||||
|
||||
**Alternative: System packages (Debian/Ubuntu)**
|
||||
|
||||
If you prefer to use system packages instead of pip, install the required PyQt6 packages:
|
||||
|
||||
```shell
|
||||
$ apt install python3-pyqt6 python3-pyqt6.qtwebsockets python3-pyqt6.qtmultimedia
|
||||
```
|
||||
|
||||
Note: This may require specific Python versions and may not include the latest features.
|
||||
|
||||
Currently it's only possible to create installer packages from the pyinstaller output. For any target platform, first create the executable with pyinstaller:
|
||||
|
||||
```shell
|
||||
|
||||
@@ -8,7 +8,7 @@ logo = "gotify_tray/gui/images/logo.ico" if platform.system() != "Darwin" else "
|
||||
|
||||
a = Analysis(['gotify_tray/__main__.py'],
|
||||
pathex=[os.getcwd()],
|
||||
binaries=[('/lib/x86_64-linux-gnu/libpython3.10.so', '.'), ('/lib/x86_64-linux-gnu/libpython3.10.so.1', '.')],
|
||||
binaries=[('/lib/x86_64-linux-gnu/libpython3.12.so', '.'), ('/lib/x86_64-linux-gnu/libpython3.12.so.1', '.')],
|
||||
datas=[('gotify_tray/gui/images', 'gotify_tray/gui/images'), ('gotify_tray/gui/themes', 'gotify_tray/gui/themes')],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
def main():
|
||||
import os
|
||||
import sys
|
||||
|
||||
if "--version" in sys.argv:
|
||||
from gotify_tray.__version__ import __version__
|
||||
|
||||
print(__version__)
|
||||
else:
|
||||
# Check for display before importing GUI modules
|
||||
if not os.environ.get("DISPLAY"):
|
||||
print(
|
||||
"Error: No display environment detected. This application requires a graphical desktop environment to run.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
from gotify_tray.gui import start_gui
|
||||
|
||||
start_gui()
|
||||
|
||||
|
||||
|
||||
@@ -459,9 +459,10 @@ class MainApplication(QtWidgets.QApplication):
|
||||
self.main_window.hidden.connect(self.main_window_hidden_callback)
|
||||
self.main_window.activated.connect(self.tray.revert_icon)
|
||||
|
||||
self.styleHints().colorSchemeChanged.connect(
|
||||
self.theme_change_requested_callback
|
||||
)
|
||||
if hasattr(self.styleHints(), "colorSchemeChanged"):
|
||||
self.styleHints().colorSchemeChanged.connect(
|
||||
self.theme_change_requested_callback
|
||||
)
|
||||
|
||||
self.messages_model.rowsInserted.connect(
|
||||
self.main_window.display_message_widgets
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs/widget_main.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.9.1
|
||||
# Created by: PyQt6 UI code generator 6.10.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs/widget_message.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.9.1
|
||||
# Created by: PyQt6 UI code generator 6.10.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs/widget_server.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.9.1
|
||||
# Created by: PyQt6 UI code generator 6.10.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'gotify_tray/gui/designs/widget_settings.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.9.1
|
||||
# Created by: PyQt6 UI code generator 6.10.0
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
@@ -65,7 +65,7 @@ class MessagesProxyModel(QtCore.QSortFilterProxyModel):
|
||||
return False
|
||||
if self.text_filter:
|
||||
title = (message.title or "").lower()
|
||||
msg = message.message.lower()
|
||||
msg = (message.message or "").lower()
|
||||
if self.text_filter not in title and self.text_filter not in msg:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -3,14 +3,21 @@ from gotify_tray.utils import get_abs_path
|
||||
|
||||
|
||||
themes = {
|
||||
QtCore.Qt.ColorScheme.Dark: "dark",
|
||||
QtCore.Qt.ColorScheme.Light: "light",
|
||||
QtCore.Qt.ColorScheme.Unknown: "light",
|
||||
2: "dark", # Dark
|
||||
1: "light", # Light
|
||||
0: "light", # Unknown
|
||||
}
|
||||
|
||||
|
||||
def set_theme(app: QtWidgets.QApplication):
|
||||
theme = themes.get(app.styleHints().colorScheme(), "light")
|
||||
if hasattr(app.styleHints(), "colorScheme"):
|
||||
color_scheme = app.styleHints().colorScheme()
|
||||
theme = themes.get(
|
||||
color_scheme.value if hasattr(color_scheme, "value") else color_scheme,
|
||||
"light",
|
||||
)
|
||||
else:
|
||||
theme = "light" # Default to light theme if colorScheme not available
|
||||
|
||||
stylesheet = ""
|
||||
with open(get_abs_path(f"gotify_tray/gui/themes/base.qss"), "r") as f:
|
||||
@@ -23,5 +30,12 @@ def set_theme(app: QtWidgets.QApplication):
|
||||
|
||||
def get_theme_file(file: str) -> str:
|
||||
app = QtCore.QCoreApplication.instance()
|
||||
theme = themes.get(app.styleHints().colorScheme(), "light")
|
||||
if hasattr(app.styleHints(), "colorScheme"):
|
||||
color_scheme = app.styleHints().colorScheme()
|
||||
theme = themes.get(
|
||||
color_scheme.value if hasattr(color_scheme, "value") else color_scheme,
|
||||
"light",
|
||||
)
|
||||
else:
|
||||
theme = "light" # Default to light theme if colorScheme not available
|
||||
return get_abs_path(f"gotify_tray/gui/themes/{theme}/{file}")
|
||||
|
||||
15
run.sh
Executable file
15
run.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if virtual environment exists
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
echo "Installing dependencies..."
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
else
|
||||
source venv/bin/activate
|
||||
fi
|
||||
|
||||
# Run the application
|
||||
python -m gotify_tray
|
||||
Reference in New Issue
Block a user