https://github.com/anko/uzbl-smoothscroll
uzbl-browser smooth scrolling script
https://github.com/anko/uzbl-smoothscroll
Last synced: 5 months ago
JSON representation
uzbl-browser smooth scrolling script
- Host: GitHub
- URL: https://github.com/anko/uzbl-smoothscroll
- Owner: anko
- Created: 2014-07-15T12:34:20.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-16T19:40:01.000Z (almost 12 years ago)
- Last Synced: 2025-02-04T19:14:42.572Z (over 1 year ago)
- Language: LiveScript
- Homepage:
- Size: 148 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# uzbl-smoothscroll
Smooth scrolling script for [`uzbl-browser`][uzbl].
## Install
### Plain JS file
cd "${XDG_CONFIG_HOME:-$HOME/.config}/uzbl/scripts"
wget "https://github.com/c39/uzbl-smoothscroll/releases/download/v1.0.0/smoothscroll.js"
Or just download it from the [release page][release].
Edit your `config` to load on each page:
@on_event LOAD_COMMIT script @scripts_dir/smoothscroll.js
### Compile from source
You'll need [`npm`][npm], because I'm way too serious about dependency
management. Basically just `git clone` and run `npm install` in the root dir:
cd "${XDG_CONFIG_HOME:-$HOME/.config}/uzbl/scripts"
git clone https://github.com/c39/uzbl-smoothscroll smoothscroll
npm install
Edit your `config` to load it on each page:
@on_event LOAD_COMMIT script @scripts_dir/smoothscroll/bundle.js
## Use
Edit your `config` to bind whatever keys you like:
# Smooth scroll by absolute amounts
@cbind j = js uzbl.scrollPixels("vertical", 50)
@cbind k = js uzbl.scrollPixels("vertical", -50)
@cbind h = js.uzbl.scrollPixels("horizontal", -50)
@cbind l = js.uzbl.scrollPixels("horizontal", 50)
# Smooth scroll by a percentage of the view
@cbind d = js uzbl.scrollPercent("vertical", 50)
@cbind u = js uzbl.scrollPercent("vertical", -50)
@cbind f = js uzbl.scrollPercent("vertical", 100)
@cbind b = js uzbl.scrollPercent("vertical", -100)
# Smooth scroll by a percentage of the entire page
@cbind gg = js uzbl.scrollPercent("vertical", 0)
@cbind G = js uzbl.scrollPercent("vertical", 100)
## Known bugs
- Only works for the keyboard. `uzbl` doesn't let scripts bind to scrollwheel
events.
- Occasionally drifts horizontally a little when scrolling vertically (or vice
versa). WebKit might be rounding floating point `pageXOffset`/`pageYOffset`
values?
- Bigger than it needs to be. I got lazy and included all of D3, because it's
coming from a local disk anyway and still pretty small compared to any image
file.
[npm]: https://www.npmjs.org/ "Node Package Manager"
[uzbl]: http://www.uzbl.org/
[release]: https://github.com/c39/uzbl-smoothscroll/releases