mirror of
https://github.com/swaywm/sway.git
synced 2025-03-25 07:42:03 +00:00
Add a trick to increase scroll speed on some apps
parent
6b30460613
commit
2cb30e27cc
1 changed files with 24 additions and 1 deletions
25
Tricks.md
25
Tricks.md
|
@ -276,4 +276,27 @@ bindsym $mod+Shift+y exec clipman clear -a
|
|||
bindsym $mod+Mod1+y exec clipman clear --tool rofi
|
||||
# Empty the current clipping
|
||||
bindsym $mod+Ctrl+y exec : | wl-copy -p
|
||||
```
|
||||
```
|
||||
|
||||
# Increase scroll speed on some apps
|
||||
|
||||
This script set 6x scroll speed only if app like chromium is focused, require https://github.com/acrisci/i3ipc-python.
|
||||
|
||||
```python
|
||||
#!/usr/bin/env python
|
||||
import i3ipc, re
|
||||
r = re.compile(r'chrom|telegram|Master PDF Editor|typora',re.I)
|
||||
def on_window_focus(i3, e):
|
||||
c = e.container.app_id
|
||||
if not c:
|
||||
return
|
||||
v = 1
|
||||
if r.search(c):
|
||||
v = 6
|
||||
i3.command(f"input type:pointer scroll_factor {v}")
|
||||
|
||||
i3 = i3ipc.Connection()
|
||||
i3.on("window::focus", on_window_focus)
|
||||
i3.main()
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue