Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.15.1 #53

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# v0.15.1
This release introduces compatibility with FeeeBuds 6i and Studio models.
Also, since this version OpenFreebuds can be used in desktop environments
without system tray.

- [Fix] Rework Flatpak autostart management mechanism
- This version would be only released as Flatpak package

# v0.15.0
This release introduces compatibility with FeeeBuds 6i and Studio models.
Also, since this version OpenFreebuds can be used in desktop environments
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
openfreebuds (0.15.1-1) bookworm noble; urgency=medium

This release introduces compatibility with FeeeBuds 6i and Studio models.
Also, since this version OpenFreebuds can be used in desktop environments
without system tray.

- [Fix] Rework Flatpak autostart management mechanism
- This version would be only released as Flatpak package


-- MelianMiko <[email protected]> Mon, 18 Nov 2024 20:28:07 +0700

openfreebuds (0.15.0-1) bookworm noble; urgency=medium

This release introduces compatibility with FeeeBuds 6i and Studio models.
Expand Down
92 changes: 0 additions & 92 deletions openfreebuds_backend/linux/dbus/background.py

This file was deleted.

6 changes: 6 additions & 0 deletions openfreebuds_backend/linux/dbus/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pathlib import Path

SCRIPT_DIR = Path(__file__).parent.resolve()

with open(SCRIPT_DIR / "xdg_desktop_portal.xml", "r") as f:
XDG_DESKTOP_PORTAL_INTROSPECTION = f.read()
50 changes: 50 additions & 0 deletions openfreebuds_backend/linux/dbus/xdg_background.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import asyncio

from dbus_next import BusType, Variant
from dbus_next.aio import MessageBus, ProxyObject

from openfreebuds_backend.linux.dbus.constants import XDG_DESKTOP_PORTAL_INTROSPECTION
from openfreebuds_backend.linux.dbus.xdg_request import XdgDesktopPortalRequest


class XdgDesktopBackgroundPortal(XdgDesktopPortalRequest):
@staticmethod
async def get():
bus = await MessageBus(bus_type=BusType.SESSION).connect()
dbus_obj = bus.get_proxy_object("org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop",
XDG_DESKTOP_PORTAL_INTROSPECTION)
return XdgDesktopBackgroundPortal(dbus_obj)

def __init__(self, dbus_obj: ProxyObject):
self._obj = dbus_obj
self._interface = dbus_obj.get_interface("org.freedesktop.portal.Background")

async def request_background(self, parent_window: str = "", reason: str = "", autostart: bool = False):
async with (XdgDesktopPortalRequest().handle_request(self._obj)
as (handler_id, expected_path, get_response)):

# noinspection PyUnresolvedReferences
actual_path = await self._interface.call_request_background(
parent_window,
{
"autostart": Variant('b', autostart),
"handle_token": Variant('s', handler_id),
"reason": Variant('s', reason),
}
)

assert actual_path == expected_path
code, data = await get_response()

return code == 0, data["background"].value, data["autostart"].value


async def test():
bg = await XdgDesktopBackgroundPortal.get()
ret = await bg.request_background("", "Test", True)
print(ret)


if __name__ == "__main__":
asyncio.run(test())
Loading