Sunday, June 03, 2007 parmanent link to this post
My .xbindkeysrc.scm configruation file I use with the MX1000 lasermouse (for now)

The the Guru repository xbindkey suse rpm are compiled without guile support.To use xbindkeys it has to be compiled with guile support. The Guru repository does provide a xbindkeys-1.8.2-1-src.rpm that can be compiled with :
# rpmbuild --with guile --rebuild sourcepackage
to provide guile support. where sourcepackgage has to be replaced by the name of the sourcpackage, in this matter by xbindkeys-1.8.2-1-src.rpm. You will need to install the guile-devel package in order to compile xbindkeys in this way however. The compild RPM will show up in /usr/src/packages/RPMS/`architecture` where architecture has to corrospond your hardware architechture, in my case x86_64-
;; This configuration is guile based.
;; http://www.gnu.org/software/guile/guile.html
;; This config script us supposed to live in the homedirectory.
;; This was a not so quick but probably yet dirty hack by Vee Lee.(I know nothing about coding but at least it works)
;; You'll need xmacroplay and xbindkeys with -guile support compiled for this to work..
;; This is heavily based on the domoscripts (http://hocwp.free.fr/xbindkeys/xbindkeysrc-combo.scm.html)
;; of the author of xbindkeys (hocwp at free dot fr) Many thanks and keep up the good work.
;; It assigns keybindings to the scroll wheel on the fly after the appwindow button is pressed on the mx1000 lasermous!
define (display-n str)
"Display a string then newline"
(display str)
(newline))
(define (first-binding)
"First binding"
(xbindkey-function '("b:10") second-binding)
(xbindkey-function '("m:0" "b:9") (lambda () (run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress Right\nKeyStrRelease Right\nKeyStrRelease Alt_L\n' | xmacroplay :0 &")))
(xbindkey-function '("m:0" "b:8") (lambda () (run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress Left\nKeyStrRelease Left\nKeyStrRelease Alt_L\n' | xmacroplay :0 &")))
)
(define (reset-first-binding)
"reset first binding"
(display-n "resetting first binding")
(ungrab-all-keys)
(remove-all-keys)
(first-binding)
(grab-all-keys))
;;This allows to scroll through tabs in firefox
(define (second-binding)
"Second binding"
(display-n "setting second binding")
(ungrab-all-keys)
(remove-all-keys)
(xbindkey-function '("b:4")
(lambda ()
(display-n "Scroll up")
(run-command "echo -e 'KeyStrPress Control_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Control_L' | xmacroplay :0 &")
))
(xbindkey-function '("b:5")
(lambda ()
(display-n "Scroll down")
(run-command "echo -e 'KeyStrPress Control_L\nKeyStrPress Shift_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Shift_L\nKeyStrRelease Control_L' | xmacroplay :0 &")
))
(xbindkey-function '(release "b:10") (lambda ()
(run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Alt_L' | xmacroplay :0 &")
(reset-first-binding)))
(grab-all-keys))
(define (scroll-apps-binding)
"scroll-apps-binding"
(display-n "scroll apps binding success")
(ungrab-all-keys)
(remove-all-keys)
(xbindkey-function '("b:4")(run-command "echo -e 'KeyStrPress Tab\nKeyStrRelease Tab' | xmacroplay :0 &"))
(xbindkey-function '("b:5")(run-command "echo -e 'KeyStrPress Shift_L\nKeyStrPress Tab\nKeyStrRelease Tab\nKeyStrRelease Shift_L' | xmacroplay :0 &"))
(xbindkey-function '("b:1") reset-first-binding)
(grab-all-keys))
(debug)
(grab-all-keys)
(first-binding)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; End of xbindkeys configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Related Posts:
Mouse setup in linux links