diff options
author | kotontrion <[email protected]> | 2024-10-29 13:50:41 +0100 |
---|---|---|
committer | kotontrion <[email protected]> | 2024-10-29 13:50:41 +0100 |
commit | 57f20666e716fde56579b8aa638eed1264f793de (patch) | |
tree | 59b2ebbd770c80049cea4df82109d28f617675fe /examples/py/simple-bar/app.py | |
parent | 4d9ae88b0bab75779876d465f986791d052414ca (diff) | |
parent | 7e484188e7492ac7945c854bcc3f26cec1863c91 (diff) |
Merge branch 'main' into feat/cava
Diffstat (limited to 'examples/py/simple-bar/app.py')
-rwxr-xr-x | examples/py/simple-bar/app.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/examples/py/simple-bar/app.py b/examples/py/simple-bar/app.py index f5a8a80..17b6782 100755 --- a/examples/py/simple-bar/app.py +++ b/examples/py/simple-bar/app.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import sys import versions -from gi.repository import Astal, Gio +from gi.repository import AstalIO, Astal, Gio from widget.Bar import Bar from pathlib import Path @@ -10,23 +10,27 @@ css = "/tmp/style.css" class App(Astal.Application): - def do_request(self, msg: str, conn: Gio.SocketConnection) -> None: + def do_astal_application_request( + self, msg: str, conn: Gio.SocketConnection + ) -> None: print(msg) - Astal.write_sock(conn, "hello") + AstalIO.write_sock(conn, "hello") def do_activate(self) -> None: self.hold() - Astal.Process.execv(["sass", scss, css]) + AstalIO.Process.execv(["sass", scss, css]) self.apply_css(css, True) + print("hello") for mon in self.get_monitors(): self.add_window(Bar(mon)) -instance_name = "simple-bar" +instance_name = "python" app = App(instance_name=instance_name) if __name__ == "__main__": - if app.acquire_socket(): + try: + print(app.acquire_socket()) app.run(None) - else: - print(Astal.Application.send_message(instance_name, "".join(sys.argv[1:]))) + except Exception as e: + print(AstalIO.send_message(instance_name, "".join(sys.argv[1:]))) |