Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Sounds Upon Selection #228

Closed
WMan22 opened this issue Jun 9, 2022 · 4 comments
Closed

Custom Sounds Upon Selection #228

WMan22 opened this issue Jun 9, 2022 · 4 comments

Comments

@WMan22
Copy link

WMan22 commented Jun 9, 2022

The Motivation

Further customization and auditory memorization of swipe locations which is practical, also it would just simply be cool for certain ricing endeavors, which is fun.

The Solution

Essentially, I want to assign 2 sounds to each fly-pie addition, one for hover over, and one for selection, via a .wav or whatever audio type is compatible from a folder to that addition to my custom menu underneath the name, Icon, and Fixed Angle options. Hopefully I can also assign audio to end points on a Favorites option. I would like to be able to assign a different audio file to each end point and to each nested end point.

The Alternatives

I would like to be able to stash these audio files the same way you can stash other items next to that function near the trash for easy re-use and access. I'd like a mute and unmute toggle too for the whole tree so I can enable and disable this feature on a whim without having to edit a brand new fly pie menu that has these functions without the audio enabled.

@Schneegans
Copy link
Owner

Hi there! Thanks for this idea, it sounds quite funny indeed. I think it's nothing I'll be working on in the foreseeable future, but if anyone wants to implement this, I'll happily accept a pull request!

@Schneegans Schneegans changed the title [Feature Request] Custom Sounds Upon Selection Custom Sounds Upon Selection Jun 14, 2022
@blipk
Copy link

blipk commented Mar 31, 2023

The possibility to run scripts before or after the menu action is activated would be able to solve this and add a lot of other custom functionality

@Schneegans
Copy link
Owner

@blipk That would be a neat solution for this (pretty niche) feature request. And indeed, this is already possible! Here is an example of a small python script which lets you execute code whenever an item in Fly-Pie is hovered or selected:

#!/usr/bin/python3

import dbus
import dbus.mainloop.glib
from gi.repository import GLib

def on_hover(menu, item):
    print(f"hovering {item} in menu {menu}")

def on_select(menu, item):
    print(f"selected {item} in menu {menu}")

if __name__ == '__main__':
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

    bus = dbus.SessionBus()
    proxy = bus.get_object('org.gnome.Shell',
                           '/org/gnome/shell/extensions/flypie')

    proxy.connect_to_signal("OnHover", on_hover)
    proxy.connect_to_signal("OnSelect", on_select)

    print("Waiting for events... Press Ctrl+C to abort.")

    loop = GLib.MainLoop()
    loop.run()

This could easily be extended to play sound effects!

@Schneegans
Copy link
Owner

I'll close this as I have neither the time nor the intention to implement new features for Fly-Pie at this point. I focus all development effort on Kando instead.

Kando already supports sound effects!

@Schneegans Schneegans closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants