mirror of
https://github.com/zoriya/astal.git
synced 2026-06-09 20:59:03 +00:00
example: add python starter bar
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
import versions
|
||||
from gi.repository import Astal, Gio
|
||||
from widget.Bar import Bar
|
||||
from pathlib import Path
|
||||
|
||||
css = str(Path(__file__).parent.resolve() / "style.css")
|
||||
|
||||
|
||||
class App(Astal.Application):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.acquire_socket()
|
||||
self.run(None)
|
||||
|
||||
def do_request(self, msg: str, conn: Gio.SocketConnection) -> None:
|
||||
print(msg)
|
||||
Astal.write_sock(conn, "hello")
|
||||
|
||||
def do_activate(self) -> None:
|
||||
self.hold()
|
||||
self.apply_css(css, True)
|
||||
for mon in self.get_monitors():
|
||||
self.add_window(Bar(mon))
|
||||
|
||||
|
||||
App()
|
||||
Reference in New Issue
Block a user