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

Define a dbus handler that can execute any command (including those that are not registered with girara_inputbar_command_add) #418

Open
sebastinas opened this issue Sep 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sebastinas
Copy link
Member

On GitLab by @rMorales on Sep 20, 2023, 10:41


In config.c (link to specific lines), I've noticed that there are some commands that are defined to be evaluted in the input bar.

This makes it possible to call those commands using the ExecuteCommand handler. For example, I can show the document info in a Zathura instance by executing the following command in a terminal.

dbus-send --type="method_call" --dest=org.pwmt.zathura.PID-25400 /org/pwmt/zathura org.pwmt.zathura.ExecuteCommand string:"info"

There are some commands which can't be executed through ExecuteCommand since an attempt to do that results in Zathura showing Not a valid command: <<command>>.

I propose that all commands are available to be called through Dbus. I believe this would be beneficial for users since users would have more options to control Zathura through Dbus. Personally, I would like to execute the commands for navigation (e.g. navigate next, navigate previous, scroll up, scroll left), so that I can move through Zathura from Emacs without leaving the buffer where I'm editing text.

Currently, Zathura commands that can be called through the DBus handler ExecuteCommand are those that are defined using girara_inputbar_command_add, so if we plan to add all commands, we would need to add as much girara_inputbar_command_add lines as the number of commands. I believe a more convenient way to do this is to define a handler in dbus-interface.c that can evaluate absolutely any Zathura shortcut function. It would behave as ExecuteCommand, but the difference is that commmands needn't to be registered through girara_inputbar_command_add.

@sebastinas
Copy link
Member Author

On GitLab by @rMorales on Sep 21, 2023, 20:41


I believe a more convenient way to do this is to define a handler in dbus-interface.c that can evaluate absolutely any Zathura shortcut function.

In merge request !84 , I've introduced such handler.

@sebastinas sebastinas changed the title [feature request] Define a dbus handler that can execute any command (including those that are not registered with girara_inputbar_command_add) Define a dbus handler that can execute any command (including those that are not registered with girara_inputbar_command_add) May 15, 2024
@sebastinas sebastinas added enhancement New feature or request and removed feature-request labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant