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

Reload configuration by command line #1849

Closed
webdev23 opened this issue Apr 30, 2018 · 8 comments
Closed

Reload configuration by command line #1849

webdev23 opened this issue Apr 30, 2018 · 8 comments

Comments

@webdev23
Copy link

Is there a way to reload the config by command line.

Same as Tools -> Reload Configuration?

Found no capability by the command geany --help, nor any keyboard shortcut (to automate with xdotool.

Hint: I am building a dynamic color scheme editor, by modifying my config files. it works fine, but I am currently forced to reload the config at any action. I am looking to keep the same instance running, with the new config?

@elextr
Copy link
Member

elextr commented Apr 30, 2018

can your tool do mnemonic keystrokes? <alt>T R

@webdev23
Copy link
Author

webdev23 commented Apr 30, 2018

Thank you shown me the right direction with alt+t.

Problem was first the F2 (focus on editor) is remaped with Super+space in my distribution, but was looking at the online docs (!).

So from the geany terminal, to reload the configuration using xdotool.

xdotool key Super+space alt+t KP_Enter

It is a bit hacky, looking forward for a better solution, it is tricky to focus on geany by his window ID from another shell (Many different id are opened by geany).

@elextr
Copy link
Member

elextr commented Apr 30, 2018

Its very unlikely that reloading configuration remotely is going to happen unless somebody contributes the code, and maybe not even then.

Alternatively you could make a plugin that listened on some IPC mechanism of your choice and did a reload, or the plugin could even spawn the editor and just listen to the stdout of the child process for reload commands. That would make a nice integrated facility.

@webdev23
Copy link
Author

webdev23 commented May 1, 2018

Thank you very much for the replies.
When I mean from another shell, i mean on the same machine.

I think a little gif is worth the explanation!

gif1525132592_optimized

As you can see a simple way to reload the configuration from the command line would be better. (I am using php/js on a local server, that is live modifying my config files)

@elextr
Copy link
Member

elextr commented May 1, 2018

Why do you want the user to have to execute a command to update Geany? As I said in the previous post a plugin that spawned the editor can listen to its output for commands to reload and execute the reload command via the plugin and it will all happen automatically without user action.

@webdev23
Copy link
Author

webdev23 commented May 1, 2018

I am looking to reload the config by script, not by an user action. It can be a command line, ideally geany --reload-conf or something.

@webdev23
Copy link
Author

webdev23 commented May 1, 2018

Okay answering back for anyone.

From another subshell, to focus Geany and reload the config automagically, using wmctrl and xdotool.

wmctrl -xa Geany && xdotool key Super+space alt+t KP_Enter

Now my little workaround works perfect!

I have no idea how to create a Geany plugin otherwise, while not knowing anything about C/C++, i always find my way quickly with php and took me no more than 2-3 hours to create it. ;)

gif1525134983_optimized

I would be glad to share.

Edit: Here the repo https://github.com/webdev23/Geany-editor-dynamic-color-schemes

@codebrainz
Copy link
Member

@webdev23 nice work! @b4n had written something similar at one point as native GTK+ plugin/window, IIRC.

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