Skip to content

Add DBus method to execute shortcut functions

Rodrigo Morales requested to merge rmorales/zathura:develop into develop

The introduced changes make it possible to execute any shortcut function through the DBus interface. Here are some examples:

Navigate 1 page below.

$ pid="$(pgrep zathura)" && dbus-send --type="method_call" --dest="org.pwmt.zathura.PID-$pid" /org/pwmt/zathura org.pwmt.zathura.ExecuteShortcutFunction string:"navigate" string:"next" uint32:0

Navigate to the 10nth page below.

$ pid="$(pgrep zathura)" && dbus-send --type="method_call" --dest="org.pwmt.zathura.PID-$pid" /org/pwmt/zathura org.pwmt.zathura.ExecuteShortcutFunction string:"navigate" string:"next" uint32:10

Scroll down with a magnitude 1

$ pid="$(pgrep zathura)" && dbus-send --type="method_call" --dest="org.pwmt.zathura.PID-$pid" /org/pwmt/zathura org.pwmt.zathura.ExecuteShortcutFunction string:"scroll" string:"down" uint32:0

Scroll down with a magnitude 10

$ pid="$(pgrep zathura)" && dbus-send --type="method_call" --dest="org.pwmt.zathura.PID-$pid" /org/pwmt/zathura org.pwmt.zathura.ExecuteShortcutFunction string:"scroll" string:"down" uint32:10

Toggle the index

$ pid="$(pgrep zathura)" && dbus-send --type="method_call" --dest="org.pwmt.zathura.PID-$pid" /org/pwmt/zathura org.pwmt.zathura.ExecuteShortcutFunction string:"toggle_index" string:"" uint32:0

Navigate index (assuming that the current view has enabled the index)

$ pid="$(pgrep zathura)" && dbus-send --type="method_call" --dest="org.pwmt.zathura.PID-$pid" /org/pwmt/zathura org.pwmt.zathura.ExecuteShortcutFunction string:"navigate_index" string:"down" uint32:0

Merge request reports