Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to switch Fluxbox (and other) WM windows with a remote
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Nightweaver
n00b
n00b


Joined: 24 Jul 2002
Posts: 40

PostPosted: Fri Feb 06, 2004 4:55 pm    Post subject: How to switch Fluxbox (and other) WM windows with a remote Reply with quote

How to switch Fluxbox (and other) WM windows with a remote

Now that I've got it working, I think it's pretty neat and worth sharing - if only to see if anyone has a simpler way of doing it. I like watching TV from bed on my monitor, but sometimes I like to check up on the other things I have running, and don't want to have to go get my keyboard.

You will need:

  • A remote (!)
  • lirc configured and working (outside the scope of this document)
  • An EWMH/NetWM compatible X Window Manager (eg, fluxbox)
  • wmctrl
    Code:
    ACCEPT_KEYWORDS="~x86" emerge x11-misc/wmctrl



Once you've got all these things, it's pretty easy to set up, thanks to a little one-line script (I call it chwin) with the following:
Code:
wmctrl -s $[($(wmctrl -d | awk '/*/ { print $1; }')+$1)%4]

Save it somewhere in your PATH and make it executable, then add the following to your .lircrc file:

Code:

begin
        prog = irexec
        button = BUTTON_X
        config = chwin +3
end

begin
        prog = irexec
        button = BUTTON_Y
        config = chwin +1
end

(Don't forget to replace BUTTON_X and BUTTON_Y with the actual names of the buttons you want to use.)

Then you just need to start irexec:
Code:
irexec -d


Now try it - it works for me!

Comments/suggestions/questions/etc welcome.

Edit 1: Changed -1 to +3 in .lircrc entry for switching to previous desktop, to make going from 1-4 possible.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum