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

Feature: Custom command menu items #2764

Open
TheDcoder opened this issue Mar 15, 2021 · 8 comments
Open

Feature: Custom command menu items #2764

TheDcoder opened this issue Mar 15, 2021 · 8 comments

Comments

@TheDcoder
Copy link
Contributor

Hi, I just thought about this feature though I am sure many others might have come up with the same idea, I could not find a related ticket here so I am posting it for the first time (forgive me if I missed the duplicate).

The basic concept is that there will be a new section in the menu for custom labelled commands, which will execute user-defined commands, with the option of having some wildcard options to replace with the current file's path or parent directory, work directory etc.

I could already think of a few uses for this feature:

  1. Show in file manager - xdg-open %s
  2. Open terminal - myterminal %w (working directory or file's parent directory)
  3. Open file in external program

Hopefully it is not too hard to implement, it may even be implemented as a plugin 😄

P.S I am aware that there is a "Send selection to custom command" but that really isn't the same feature.

@elextr
Copy link
Member

elextr commented Mar 15, 2021

You know you can extend the build commands menu? https://wiki.geany.org/howtos/configurebuildmenu

@TheDcoder
Copy link
Contributor Author

@elextr Nice, but not sure if "Build" is the right menu for this task, the GUI is also limited in the way how it only provides a fixed number of additions.

@elextr
Copy link
Member

elextr commented Mar 15, 2021

No its not, read the fine wiki article!

@elextr
Copy link
Member

elextr commented Mar 15, 2021

Actually the menu size settings are now in various I think, don't forget to restart Geany though.

@TheDcoder
Copy link
Contributor Author

@elextr I have glanced the wiki and I am aware that it is possible to add additional options by directly editing the configuration files, but the GUI itself doesn't allow more than 4 independent commands... but I see the complexity with integrating my proposed feature with the existing build commands feature.

@elextr
Copy link
Member

elextr commented Mar 15, 2021

As I said above, you can set the number of each type of command with Edit->Preferences->Various build.number_exec_menu_items, build.number_ft_menu_items, and build.number_non_ft_menu_items and restart Geany.

I just set non_ft to 12, restarted and then Build->Set build commands shows 12 slots for independent commands.

@TheDcoder
Copy link
Contributor Author

I think I found another reason why build commands are not suitable for custom user commands, whenever a command is ran, Geany monitors it and shows a "progress" bar at the bottom of the GUI:
image

This is a bit distracting when long running programs are started this way. I guess this issue can be solved by making the program fork into another process before exiting, but I am not aware of any common utilities which can do this.

@elextr
Copy link
Member

elextr commented May 30, 2021

Hmmm, how useful, anyway if build and custom are not suitable "somebody" can indeed make a plugin as you said, spawn_async is in the plugin API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants