added a variable for the target scroll speed

Murat 2023-10-27 02:32:31 +02:00
parent bec1de8439
commit f705c4f5c7

@ -285,9 +285,9 @@ This script set 6x scroll speed only if app like chromium is focused, require ht
```python ```python
#!/usr/bin/env python #!/usr/bin/env python
import i3ipc import i3ipc
scroll_apps = ['discord'] scroll_apps = ['discord', 'kitty']
default_speed = 1 # Reading current value would be nice default_speed = 1 # Reading current value would be nice
increased_speed = 6
def on_window_focus(i3, e): def on_window_focus(i3, e):
v = default_speed v = default_speed
@ -301,7 +301,7 @@ def on_window_focus(i3, e):
return return
if c in scroll_apps: if c in scroll_apps:
v = 8 v = increased_speed
i3.command(f'input type:pointer scroll_factor {v}') i3.command(f'input type:pointer scroll_factor {v}')