-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.xbindkeysrc.scm
executable file
·35 lines (26 loc) · 973 Bytes
/
.xbindkeysrc.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
; needs xdotool to work
(define actionperformed #f)
(define (first-binding)
;; G502 DPI Up button
(xbindkey-function '("b:12") second-binding))
(define (reset-first-binding)
(ungrab-all-keys)
(remove-all-keys)
(set! actionperformed #f)
(first-binding)
(grab-all-keys))
(define (second-binding)
(ungrab-all-keys)
(remove-all-keys)
;; DPI Up button + Right Click
(xbindkey-function '("b:3")
(lambda ()
(run-command "qdbus org.kde.kglobalaccel /component/kwin invokeShortcut 'Switch One Desktop to the Right'")
(set! actionperformed #t)))
(xbindkey-function '(release "b:12")
(lambda ()
;; Perform Action if Button is pressed and released by itself
;(if (not actionperformed) (run-command "xdotool click --clearmodifiers 9"))
(reset-first-binding)))
(grab-all-keys))
(first-binding)