From 818594fa7846a19b919498c606cea52be1cd885978e2a326c4a731b52d7231fd Mon Sep 17 00:00:00 2001 From: nyx Date: Tue, 18 Mar 2025 23:43:23 -0500 Subject: [PATCH] start work --- music/__init__.py | 0 music/application.py | 38 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 1 + shell.nix | 9 +++++++++ 4 files changed, 48 insertions(+) create mode 100644 music/__init__.py create mode 100644 music/application.py create mode 100644 requirements.txt create mode 100644 shell.nix diff --git a/music/__init__.py b/music/__init__.py new file mode 100644 index 0000000..473a0f4 diff --git a/music/application.py b/music/application.py new file mode 100644 index 0000000..7225c92 --- /dev/null +++ b/music/application.py @@ -0,0 +1,38 @@ +import sys +import gi +gi.require_version('Gtk', '4.0') +gi.require_version('Adw', '1') +from gi.repository import Gtk, Adw + + +class MainWindow(Gtk.ApplicationWindow): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + # Things will go here + self.box1 = Gtk.Box() + self.set_child(self.box1) + + self.button = Gtk.Button(label="Hello") + self.box1.append(self.button) + self.button.connect('clicked', self.hello) + + self.header = Gtk.HeaderBar() + self.set_titlebar(self.header) + self.open_button = Gtk.Button(label="Open") + self.header.pack_start(self.open_button) + self.open_button.set_icon_name("document-open-symbolic") + + def hello(self, button): + print("Hello world") + +class MyApp(Adw.Application): + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.connect('activate', self.on_activate) + + def on_activate(self, app): + self.win = MainWindow(application=app) + self.win.present() + +app = MyApp(application_id="com.example.GtkApplication") +app.run(sys.argv) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..865ff16 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +PyGObject \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..d56b2ab --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +let + pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/b62d2a95c72fb068aecd374a7262b37ed92df82b.tar.gz") {}; +in pkgs.mkShell { + packages = [ + (pkgs.python313.withPackages (python-pkgs: with python-pkgs; [ + pygobject3 + ])) + ]; +} \ No newline at end of file