Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (display-n str)
- "Display a string then newline"
- (display str)
- (newline))
- (define (supershiftpress key)
- "Press key with Super and Shift held"
- (run-command
- (string-append "xdotool key Super_L+Shift_L+" key)))
- (define (superpress key)
- "Press key with Super held"
- (run-command
- (string-append "xdotool key Super_L+" key)))
- (define (reset-to-primary-binding)
- "Reset primary binding"
- (ungrab-all-keys)
- (display-n "released!")
- (remove-all-keys)
- (primary-binding)
- (grab-all-keys))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (define (primary-10)
- "Iconify"
- (supershiftpress "F1"))
- (define (primary-11)
- "Close"
- (supershiftpress "F2"))
- (define (primary-12)
- "Maximize"
- (supershiftpress "F3"))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (define (secondary-1)
- "Expo"
- (supershiftpress "F11"))
- (define (secondary-2)
- "PlayPause"
- (superpress "F5"))
- (define (secondary-3)
- "Show Desktop"
- (supershiftpress "F10"))
- (define (secondary-4)
- "VolDown"
- (superpress "F3"))
- (define (secondary-5)
- "VolUp"
- (superpress "F2"))
- (define (secondary-9)
- "Raise"
- (supershiftpress "F8"))
- (define (secondary-10)
- (display-n "secondary-10: Code Me"))
- (define (secondary-11)
- "Next"
- (superpress "F7"))
- (define (secondary-12)
- "Prev"
- (superpress "F6"))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (define (tertiary-1)
- "Close Tab"
- (supershiftpress "w"))
- (define (tertiary-2)
- "xterm"
- (run-command "xterm"))
- (define (tertiary-3)
- "New Tab"
- (supershiftpress "t"))
- (define (tertiary-4)
- (display-n "tertiary-4: Code Me"))
- (define (tertiary-5)
- (display-n "tertiary-5: Code Me"))
- (define (tertiary-8)
- "Lower"
- (supershiftpress "F9"))
- (define (tertiary-10)
- (display-n "tertiary-10: Code Me"))
- (define (tertiary-11)
- (display-n "tertiary-11: Code Me"))
- (define (tertiary-12)
- (display-n "tertiary-12: Code Me"))
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (define (primary-binding)
- "Bind all primary bindings"
- ;; 1 - 5 use the default action
- (xbindkey-function '("b:8") second-binding)
- (xbindkey-function '("b:9") tertiary-binding)
- (xbindkey-function '("b:10") primary-10)
- (xbindkey-function '("b:11") primary-11)
- (xbindkey-function '("b:12") primary-12))
- (define (second-binding) ;;bindings for the 8th button
- "Bind all secondary binding"
- (let ((modkey-used #f))
- (ungrab-all-keys)
- (remove-all-keys)
- (xbindkey-function '("b:1")
- secondary-1)
- (xbindkey-function '("b:2")
- secondary-2)
- (xbindkey-function '("b:3")
- secondary-3)
- (xbindkey-function '("b:4")
- secondary-4)
- (xbindkey-function '("b:5")
- secondary-5)
- (xbindkey-function '("b:9")
- secondary-9)
- (xbindkey-function '("b:10")
- secondary-10)
- (xbindkey-function '("b:11")
- secondary-11)
- (xbindkey-function '("b:12")
- secondary-12)
- (xbindkey-function '(release "b:8")
- reset-to-primary-binding)
- (grab-all-keys)))
- (define (tertiary-binding) ;;bindings for the 9th button
- "Bind all tertiary binding"
- (let ((modkey-used #f))
- (ungrab-all-keys)
- (remove-all-keys)
- (xbindkey-function '("b:1")
- tertiary-1)
- (xbindkey-function '("b:2")
- tertiary-2)
- (xbindkey-function '("b:3")
- tertiary-3)
- (xbindkey-function '("b:4")
- tertiary-4)
- (xbindkey-function '("b:5")
- tertiary-5)
- (xbindkey-function '("b:8")
- tertiary-8)
- (xbindkey-function '("b:10")
- tertiary-10)
- (xbindkey-function '("b:11")
- tertiary-11)
- (xbindkey-function '("b:12")
- tertiary-12)
- (xbindkey-function '(release "b:9")
- reset-to-primary-binding)
- (grab-all-keys)))
- (grab-all-keys)
- (primary-binding)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement