Computers 'n Stuff: My .xbindkeysrc.scm configruation file I use with the MX1000 lasermouse (for now)

I here share the resolutions for my Linux problems so they might safe somebody some time.

Sunday, June 03, 2007 parmanent link to this post

My .xbindkeysrc.scm configruation file I use with the MX1000 lasermouse (for now)

This is my .xbindkeysrc I'm using with my mx1000 lasermouse. It's quite useful. with firefox. The thumbkeys can scroll in history and if you press the appbutton and use the scrollwheel at the same time you scroll through tabs.. If the mouse is setup properly it should be possible to do horizontal scrolling by the tilting th scroll wheel. However Firefox needs some adjustments for theis to function since he will scroll through history when the horizontal scroll buttons are pressed. The appbutton pushed and released alone will toggle the last active app.

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.
;; 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 (
;; 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)

(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")

;;This allows to scroll through tabs in firefox
(define (second-binding)
"Second binding"
(display-n "setting second binding")
(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 &")

(define (scroll-apps-binding)
(display-n "scroll apps binding success")
(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)

; End of xbindkeys configuration ;

I'm looking for a way to alt + tab through the application windows using the scroll wheel but I can't get this working. Suggestions are welcome

Related Posts:
Mouse setup in linux links

Labels: , , , ,


Blogger Tameemon said...


I'm trying to get Ratpoison keyboard shortcuts to work with XBindKeys, so I was inspired by your .xbindkeysrc.scm file.

I'm basically trying achieve that pressing Ctl-t : (control t, and colon after that) runs Alt-F2.

I'm using this:

(define (first-binding)
"First binding"
(xbindkey-function '(control t) second-binding))

(define (reset-first-binding)
"reset first binding"
(display-n "reset first binding")

(define (second-binding)
"Second binding"
(display "New binding")
(xbindkey-function '(shift semicolon)
(lambda ()
(display-n "C-t :") (run-command "echo -e 'KeyStrPress Alt_L\nKeyStrPress F2\nKeyStrRelease F2\nKeyStrRelease Alt_L' | xmacroplay :0 &")

But this doesn't run Alt-F2. Would you have an idea on what's wrong?

Thank you.

Best regards,


Monday, October 29, 2007 4:11:00 PM

Anonymous Vee Lee said...

Hi ShiroiKuma,

you didn't define the 'display-n' function in your script, so disply-n will have probalby no effect. You won't need it though, I just thought it might be handy for debugging purposes.

the xbindkey-function also probably doesen't understand the shift semicolon or control t arguments you use. As far as I rememembe it expects the xevents of the respective keystrokes as input.

you could try
# xev
to find out I guess. But I cant remember exactly any more.

Also check out the demoscirpts of the author of xbindkey
for more examples ...

I hope this helps a little


vee lee

Thursday, November 22, 2007 4:55:00 AM

Anonymous puertas metalicas exterior said...

Really effective information, much thanks for the article.

Sunday, March 04, 2012 9:38:00 AM

Blogger Zero Angel said...

Thanks to your article, I was able to get multi mousebutton keybinds to work. This article was VERY difficult to find, but also quite helpful.

I customized the script so that both of the shoulder buttons act as modifiers, although it's missing any setup for b10 since my mouse doesnt have a b10.

Saturday, September 22, 2012 4:54:00 PM

Blogger dior anthony said...

Thank you. In such a position in Islam is used as a benchmark date. They know this subdivision.nice post.Very inspiring.
Cheap NFL Jerseys
cheap nba jerseys
wholesale nba jerseys
wholesale jerseys

Tuesday, September 17, 2013 2:31:00 AM


Post a Comment

Links to this post:

Create a Link

<< Home