From 4790a68e92d92ea20c10442885360058306565cf Mon Sep 17 00:00:00 2001 From: egon984 Date: Thu, 4 Sep 2025 19:07:54 +0200 Subject: [PATCH 1/3] New feature: play/pause with spacebar --- usr/lib/hypnotix/hypnotix.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index 859924f..d7e8c35 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -1548,6 +1548,11 @@ def on_key_press_event(self, widget, event): self.on_prev_channel() elif event.keyval == Gdk.KEY_Right: self.on_next_channel() + return True + elif event.keyval == Gdk.KEY_space: + if channel_focused: + self.on_pause_button(widget) + return True # elif event.keyval == Gdk.KEY_Up: # # Up of in the list # pass From 2ace6a2bec2520ac66e3739903a247b257edf620 Mon Sep 17 00:00:00 2001 From: egon984 Date: Thu, 4 Sep 2025 19:26:13 +0200 Subject: [PATCH 2/3] oops --- usr/lib/hypnotix/hypnotix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index d7e8c35..b89ca5d 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -1516,6 +1516,7 @@ def on_menu_quit(self, widget): self.application.quit() def on_key_press_event(self, widget, event): + channel_focused = self.fullscreen or "ChannelWidget" in widget.get_focus().get_name() # Get any active, but not pressed modifiers, like CapsLock and NumLock persistant_modifiers = Gtk.accelerator_get_default_mod_mask() From a2a898dbf33de60ea91a5b33805af5da45d4a6ac Mon Sep 17 00:00:00 2001 From: Frederic Bontemps <35567681+egon984@users.noreply.github.com> Date: Thu, 11 Sep 2025 07:56:33 +0200 Subject: [PATCH 3/3] un-pause mpv before loading --- usr/lib/hypnotix/hypnotix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index b7d36ef..fbcdd84 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -876,6 +876,7 @@ def on_next_channel(self): def play_async(self, channel): if self.mpv is not None: self.mpv.stop() + self.mpv.pause = False print("CHANNEL: '%s' (%s)" % (channel.name, channel.url)) if channel is not None and channel.url is not None: # os.system("mpv --wid=%s %s &" % (self.wid, channel.url))