pwmt / zathura

Document viewer
https://pwmt.org/projects/zathura
zlib License
1.88k stars 129 forks source link

How do I set the scroll amount for keybindings in zathurarc? #361

Open sebastinas opened 1 year ago

sebastinas commented 1 year ago

On GitLab by @NightMachinery on Dec 4, 2022, 04:19


How do I set the scroll amount for keybindings in zathurarc?

I want something like:

map <Left> scroll left 30
map <Right> scroll right 30
map <A-Left> scroll left 5
map <A-Right> scroll right 5
sebastinas commented 1 year ago

On GitLab by @valoq on Dec 9, 2022, 21:46


This would be something to look for in girara, though I don't think there is such an option. In any case, I would argue that the scroll speed/amount is something that would rather be configured inside your window manager/compositor.

sebastinas commented 1 year ago

On GitLab by @NightMachinery on Dec 13, 2022, 08:16


@valoq I am using macOS, so there isn't a good window manager. I can do this using Hammerspoon or BetterTouchTool, but Hammerspoon is buggy in setting app-specific hotkeys, and BetterTouchTool drains the battery. It would be much better if this was implemented in the app itself.

sebastinas commented 1 year ago

On GitLab by @valoq on Dec 14, 2022, 16:54


Maybe what you are looking for can be set by "scroll-step" in zathurarc

e.g. add this to your config: 'set scroll-step 100' (the default value is 40)

You can find the details in the zathurarc man page

sebastinas commented 1 year ago

On GitLab by @NightMachinery on Dec 14, 2022, 17:21


@valoq Thanks, I already use those options. The problem is that I want different hotkeys to scroll by different amounts. (The scroll-step also messes up trackpad scrolling.)

sebastinas commented 1 year ago

On GitLab by @valoq on Dec 14, 2022, 17:34


Ah, I think you could use a custom key mapping for that:

map <keyA-keyB> scroll-step 100
map <keyA-keyC> scroll-step 40

This would set the general scroll speed.

The zathura man page mentions custom functions as well, though I never tried those. They might help you build something that changes the speed only for a single key mapping.