-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
single instance for both flatpak and system, open exe from cli and fi…
…lemanager. Release 0.5
- Loading branch information
1 parent
6072895
commit 95944fc
Showing
6 changed files
with
4,028 additions
and
254 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 @@ | ||
disable = true |
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,52 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import gi | ||
import time | ||
import threading | ||
|
||
gi.require_version('Gtk', '4.0') | ||
gi.require_version('Adw', '1') | ||
from gi.repository import Gtk, Adw, GLib | ||
|
||
class SimpleAdwApp(Adw.Application): | ||
def __init__(self): | ||
super().__init__(application_id='com.example.SimpleAdwApp') | ||
self.window = None | ||
self.status_bar = None | ||
|
||
def do_activate(self): | ||
if not self.window: | ||
self.window = Adw.ApplicationWindow(application=self) | ||
self.window.set_title("Simple Adw App") | ||
self.window.set_default_size(400, 200) | ||
|
||
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6) | ||
self.window.set_content(vbox) | ||
|
||
button = Gtk.Button(label="Show Message") | ||
button.connect("clicked", self.on_button_clicked) | ||
vbox.append(button) | ||
|
||
self.status_bar = Adw.StatusPage() | ||
vbox.append(self.status_bar) | ||
|
||
self.window.present() | ||
|
||
def on_button_clicked(self, button): | ||
self.show_status_message("This is a status message!") | ||
|
||
def show_status_message(self, message): | ||
self.status_bar.set_description(message) | ||
self.status_bar.set_visible(True) | ||
GLib.timeout_add_seconds(10, self.hide_status_message) | ||
|
||
def hide_status_message(self): | ||
self.status_bar.set_visible(False) | ||
return False | ||
|
||
def main(): | ||
app = SimpleAdwApp() | ||
return app.run(None) | ||
|
||
if __name__ == "__main__": | ||
main() |
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,46 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import gi | ||
|
||
gi.require_version('Gtk', '4.0') | ||
gi.require_version('Adw', '1') | ||
from gi.repository import Gtk, Adw | ||
|
||
class SimpleAdwApp(Adw.Application): | ||
def __init__(self): | ||
super().__init__(application_id='com.example.SimpleAdwApp') | ||
self.connect("activate", self.on_activate) | ||
|
||
def on_activate(self, app): | ||
window = Adw.ApplicationWindow(application=self) | ||
window.set_title("Simple Adw App") | ||
window.set_default_size(400, 300) | ||
|
||
content = Adw.Bin() | ||
|
||
boxed_list = Gtk.ListBox() | ||
boxed_list.set_selection_mode(Gtk.SelectionMode.NONE) | ||
boxed_list.add_css_class("boxed-list") | ||
|
||
for i in range(10): | ||
row = Gtk.ListBoxRow() | ||
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=10) | ||
label = Gtk.Label(label=f"Item {i + 1}") | ||
box.append(label) | ||
row.set_child(box) | ||
boxed_list.append(row) | ||
|
||
scrolled_window = Gtk.ScrolledWindow() | ||
scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) | ||
scrolled_window.set_child(boxed_list) | ||
|
||
content.set_child(scrolled_window) | ||
window.set_content(content) | ||
window.present() | ||
|
||
def main(): | ||
app = SimpleAdwApp() | ||
return app.run() | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.