-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
5b3a44b
commit 7b908dd
Showing
9 changed files
with
119 additions
and
51 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: On `push` actions | ||
on: [push] | ||
jobs: | ||
PyTest: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.8.3" | ||
- uses: actions/checkout@v4 | ||
- name: Set up poetry environment | ||
run: poetry install --without extras | ||
- name: Run pytest | ||
run: poetry run pytest | ||
|
||
BuildExe: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.8.3" | ||
- uses: actions/checkout@v4 | ||
- name: Set up poetry environment | ||
run: poetry install | ||
- name: Change in-app version | ||
run: bash.exe -c "./scripts/bump_version.sh \"0.99.git.$(git rev-parse HEAD)\"" | ||
- name: Run build script | ||
run: .\scripts/build_win32\make.cmd | ||
- name: Upload bundle | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Win32 installer | ||
path: .\scripts\build_win32\dist\openfreebuds_install.exe | ||
if-no-files-found: error | ||
|
||
BuildDeb: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.8.3" | ||
- uses: actions/checkout@v4 | ||
- name: Install dev-dependencies | ||
run: | | ||
sudo apt install -y build-essential | ||
sudo ./scripts/install_dpkg_dependencies.sh | ||
- name: Set up poetry environment | ||
run: poetry install | ||
- name: Change in-app version | ||
run: bash ./scripts/bump_version.sh "0.99.git.$(git rev-parse HEAD)" | ||
- name: Run build script | ||
run: bash ./scripts/build_debian/build.sh | ||
- name: Upload bundle | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Debian package | ||
path: ./scripts/build_debian/openfreebuds_*.deb | ||
if-no-files-found: error |
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 |
---|---|---|
@@ -1,45 +1,19 @@ | ||
import logging | ||
|
||
import gi | ||
|
||
gi.require_version("Gtk", "3.0") | ||
|
||
log = logging.getLogger("OfbLinuxBackend") | ||
|
||
|
||
# noinspection PyPackageRequirements | ||
def ask_string(message, callback): | ||
from gi.repository import GLib, Gtk | ||
|
||
# noinspection PyArgumentList,PyUnresolvedReferences | ||
def show_async(): | ||
# noinspection PyTypeChecker | ||
dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.OK_CANCEL, "OpenFreebuds") | ||
dialog.format_secondary_text(message) | ||
|
||
area = dialog.get_content_area() | ||
entry = Gtk.Entry() | ||
entry.set_margin_start(16) | ||
entry.set_margin_end(16) | ||
area.pack_end(entry, False, False, 0) | ||
dialog.show_all() | ||
|
||
response = dialog.run() | ||
text = entry.get_text() | ||
dialog.destroy() | ||
|
||
if response != Gtk.ResponseType.OK: | ||
text = None | ||
|
||
callback(text) | ||
|
||
GLib.idle_add(show_async) | ||
|
||
|
||
def is_dark_taskbar(): | ||
from gi.repository import Gtk | ||
settings = Gtk.Settings() | ||
defaults = settings.get_default() | ||
theme_name = defaults.get_property("gtk-theme-name") | ||
log.info(f"System theme name is {theme_name}") | ||
return "Dark" in theme_name | ||
try: | ||
import gi | ||
gi.require_version("Gtk", "3.0") | ||
|
||
from gi.repository import Gtk | ||
settings = Gtk.Settings() | ||
defaults = settings.get_default() | ||
theme_name = defaults.get_property("gtk-theme-name") | ||
log.info(f"System theme name is {theme_name}") | ||
return "Dark" in theme_name | ||
except ImportError: | ||
return False |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "$(dirname "$0")" | ||
|
||
dpkg-buildpackage -S | ||
dpkg-buildpackage -b | ||
|
||
|
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 |
---|---|---|
|
@@ -4,16 +4,16 @@ Priority: optional | |
Maintainer: MelianMiko <[email protected]> | ||
Build-Depends: debhelper-compat (= 12), | ||
python3 (>= 3.11), python3-pip, pyqt6-dev-tools, | ||
make | ||
libcairo2-dev, gobject-introspection, libgirepository1.0-dev, | ||
qt6-l10n-tools, make | ||
Standards-Version: 4.4.1 | ||
Homepage: https://github.com/melianmiko/OpenFreebuds | ||
|
||
Package: openfreebuds | ||
Architecture: all | ||
Depends: | ||
${misc:Depends}, python3 (>= 3.11), | ||
python3-gi, python3-sdbus, python3-pyqt6, python3-pil, python3-qasync, python3-aiohttp, | ||
libgtk-3-0 | ||
python3-sdbus, python3-pyqt6, python3-pil, python3-qasync, python3-aiohttp | ||
Description: | ||
Open-source client application for HUAWEI FreeBuds bluetooth headset series. | ||
. | ||
|
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,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
apt install -y $(awk ' | ||
/^(Build-)?Depends:/ || /^ / && deps { | ||
sub(/^[^ ]+: /, "") | ||
deps = 1 | ||
dep_str = dep_str ", " $0 | ||
next | ||
} | ||
{ deps=0 } | ||
END { | ||
split(dep_str, dep_array, /[,|] */) | ||
for (d in dep_array) { | ||
dep = dep_array[d] | ||
gsub(/[^a-z0-9_.+-].*$/, "", dep) | ||
if (dep && !seen[dep]++) print dep | ||
} | ||
}' scripts/build_debian/debian/control) |