LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2010, 08:41 PM   #1
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
Fvwm - Programatically switch virtual desktops


I have fvwm running with two desks, each with 3x2 virtual desktops. I normally switch between these by either using the pager or by moving the mouse to the edge of the desktop. I would like to bind some mouse buttons on my new mouse to be able to do this automatically (ie, scroll wheel up in the root window changes the desktop).

I have seen reference to this online however the author didn't go as far as explaining how s/he did it! I am fine with binding events to the mouse, I just am not sure what module or command would be used to switch between the desktops. Switching desks is not as important really.

thanks
 
Old 01-21-2010, 03:00 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Both are explained in the main fvwm man page.

To bind a mouse button or a key combo to an action you do something like:

Code:
Key <key_name> <context> <modifier_key> <Action>
Key <button_number> <context> <modifier_key> <Action>
Where key_name is the name of the key, context can be things like A for any, R for the root window, T for the title bar, 1 for the first title bar button, etc. modifier_key would be either S for shift, M for meta (alt in PCs), C for control, and usually 4 for the win key on PCs, though I think that last one is not always true. Finally action is a valid fvwm command. It can be a sentence to load a module, the name of a function, a single fvwm command with or without arguments, or whatever fvwm can understand.

Additionally, and specifically for your purpose, you should look at the GotoPage command, also in the fvwm man page. I guess you'll want something like:

Code:
Mouse 5 R A GotoPage +0p -1p
Mouse 4 R A GotoPage +0p +1p
Which, assuming that 5 and 4 are the mouse buttons for wheel up and wheel down, will provide you with the ability to use your first wheel over your root window (R context) while pressing any or no modifier key (A modifier) to go one page up or one page down respectively in the Y axis. The mouse buttons could be inverted or numbered differently of course, so you might need to experiment a bit with this.

Look for a section titled 'Mouse, Key & Stroke Bindings' in the fvwm man page, and read it completely. It should clear out any doubt. Then ask back if you need further clarification.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fvwm - scroll desktops with mouse wheel devnull10 Linux - Desktop 2 01-21-2010 02:46 AM
Tell me how to switch virtual desktops with mouse scroll in GNOME! CrashProne Linux - Software 1 04-02-2006 04:05 AM
Switch Virtual Desktops RySk8er30 Mandriva 1 06-06-2005 02:10 AM
switch desktops tiredoflogins Linux - Newbie 9 11-12-2004 05:37 PM
KDE, Gnome, Fvwm, IceWm switch and list. collimate Linux - Newbie 1 12-17-2003 10:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration