LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 10-22-2011, 02:21 PM   #1
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
wmii: problems with keybindings


I started to replace Xmonad with wmii and I really love wmii, fast and easy to configure. And no need for ghc.

I works very good, I have only two minor problems with the keybindings.

1. It was no problem to setup keybindings to start my favorite applications. But I have serious problems to control the backlight of my laptop and the volume. I use xbacklight for the former and amixer for the latter. Both programs work fine from the command line, but they won't work if I bind the to key-combinations. Here is the part for this in my ~/.wmii-hg/wmiirc
Code:
Key $MODKEY-, # Decrease backlight 5%
        eval wmiir setsid "xbacklight -5" &

Key $MODKEY-. # Increase backlight 5%
        eval wmiir setsid "xbacklight +5" &

Key $MODKEY- # Decrease volume 3%
        eval wmiir setsid "amixer sset Master 3%-" &

Key $MODKEY-+ # Increase volume 3%
        eval wmiir setsid "amixer sset Master 3%+" &
I don't get any error-messages on the virtual terminal I launched startx from and don't have any clue what is going on.


2. I want to resize the tiles with key-combinations and luckily the wmii-website offers a solution for that under the point "Resize windows with the keyboard".
Unluckily it doesn't work. I pasted that code-snippet in my configuration file into the part with the other keybindings. I restarted X, tried it and it didn't work. All I get is "cat: s/^ /: No such file or directory" on the virtual terminal where I launched startx. Sadly I don't know how to fix that.

I hope some one can help me here. Those are rather minor problems, but for me they are showstoppers.

Thanks in advance.
 
Old 10-23-2011, 06:17 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Update: I could solve the second issue with switching from the developing version (wmii-hg) to the stable version (3.9.2 from the Arch repositories) and use the Python configuration file instead of Dash.
But the first issue still is not solved, I just can't get it to work. The commands work from the command-line, but not from the configuration file. This is what is looking like now:
Code:
# MY Key-Bindings
223     ##################
224         ('%(mod)s-Control-f', "Launch Firefox",
225                 lambda k: call('firefox', background=True)),
226         ('%(mod)s-Control-m', "Launch Thunar",
227                 lambda k: call('thunar', background=True)),
228         ('%(mod)s-Control-C', "Launch Claws-Mail",
229                 lambda k: call('claws-mail', background=True)),
230         ('%(mod)s-Shift-,', "Backlight -5%",
231                 lambda k: call('xbacklight -d :0 -5', background=True)),
232         ('%(mod)s-Shift--', "Backlight +5%",
233                 lambda k: call('xbacklight -d :0 +5', background=True)),
234         ('%(mod)s-Shift-#', "Volume -3%",
235                 lambda k: call('amixer sset Master 3%-', background=True)),
236         ('%(mod)s-Shift-+', "Volume +3%",
237                 lambda k: call('amixer sset Master 3%+', background=True)),
Launching Firefox, Thunar and Claws-Mail works, the rest not.

Any suggestions?
 
Old 10-23-2011, 03:33 PM   #3
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
The reason the call does not work is because call works like execvp() in C. What you need to do is:
Code:
lambda k: call('amixer', 'sset', 'Master', '3%+', background=True)
As an example.

If you wanted to be lazy, you might do something like
Code:
lambda k: call('amixer sset Master 3%+'.split(), background=True)
 
1 members found this post helpful.
Old 10-23-2011, 04:21 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Thanks for your answer, I really need a refresh on my (rather poor) Python skills.

I tried your suggestions, but it still doesn't work. If I only would get any error-message, that would be very helpful, but si I don't even have a clue for what I have to search to fix that.
 
Old 10-23-2011, 04:26 PM   #5
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
If you want output somewhere, you might need to set background to False.
 
1 members found this post helpful.
Old 10-23-2011, 04:32 PM   #6
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
Quote:
Originally Posted by TobiSGD View Post
Update: I could solve the second issue with switching from the developing version (wmii-hg) to the stable version (3.9.2 from the Arch repositories) and use the Python configuration file instead of Dash.
But the first issue still is not solved, I just can't get it to work. The commands work from the command-line, but not from the configuration file. This is what is looking like now:
Code:
# MY Key-Bindings
223     ##################
224         ('%(mod)s-Control-f', "Launch Firefox",
225                 lambda k: call('firefox', background=True)),
226         ('%(mod)s-Control-m', "Launch Thunar",
227                 lambda k: call('thunar', background=True)),
228         ('%(mod)s-Control-C', "Launch Claws-Mail",
229                 lambda k: call('claws-mail', background=True)),
230         ('%(mod)s-Shift-,', "Backlight -5%",
231                 lambda k: call('xbacklight -d :0 -5', background=True)),
232         ('%(mod)s-Shift--', "Backlight +5%",
233                 lambda k: call('xbacklight -d :0 +5', background=True)),
234         ('%(mod)s-Shift-#', "Volume -3%",
235                 lambda k: call('amixer sset Master 3%-', background=True)),
236         ('%(mod)s-Shift-+', "Volume +3%",
237                 lambda k: call('amixer sset Master 3%+', background=True)),
Launching Firefox, Thunar and Claws-Mail works, the rest not.

Any suggestions?
I hadn't looked too closely before at what you were trying to map them to.
'%(mod)s-Shift-,' should work I guess but I can guess that trying to map
'%(mod)s-Shift--', '%(mod)s-Shift-#', and '%(mod)s-Shift-+' will not work. Most likely in the first case, the interpreter is reading it as the modkey and shift and some illegal combination.
It may accept %(mod)s-Shift-# but it's probably receiving it as modkey-shift-3, same for + except it's probably seeing it as =. I'm not 100% certain but that's my best guess.

Edit:
The best way to check the first one is to press %(modkey)-a and then run showkeys. It'll show yours as they appear to have been interpreted by wmii from your wmiirc.

Last edited by Ian John Locke II; 10-23-2011 at 04:34 PM.
 
1 members found this post helpful.
Old 10-23-2011, 04:42 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by Ian John Locke II View Post
The best way to check the first one is to press %(modkey)-a and then run showkeys. It'll show yours as they appear to have been interpreted by wmii from your wmiirc.
showkeys is showing the bindings exactly the way I have set them up. May be it is confusing that I am using a German keyboard, where those keys are not at the same place like on a US keyboard. Since using the keys , , and are giving me error-messages about encoding (really have to learn more about Python) I used some unused keys that don't gave error messages.

Will try the suggestion to set background to false.
 
Old 10-23-2011, 04:52 PM   #8
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
Quote:
Originally Posted by TobiSGD View Post
showkeys is showing the bindings exactly the way I have set them up. May be it is confusing that I am using a German keyboard, where those keys are not at the same place like on a US keyboard. Since using the keys , , and are giving me error-messages about encoding (really have to learn more about Python) I used some unused keys that don't gave error messages.

Will try the suggestion to set background to false.
Ah, I didn't realize you were from Germany (heh stupid American assuming everyone else on the internet is from America :P). For those keys in Python you might have to prefix the string with a 'u' like:
Code:
u'unicode string'
But I'm not sure if that'll fix that problem.
 
1 members found this post helpful.
Old 10-23-2011, 04:57 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
I changed the bindings to some unused letters (not symbols, like before) and it works.

Hadn't thought that wmii can't parse those symbols.

Thanks for your help, all problems solved (besides a conky problem that is unsolvable), so I can totally ditch Xmonad and have fun with wmii.
 
Old 10-23-2011, 05:28 PM   #10
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
Quote:
Originally Posted by TobiSGD View Post
I changed the bindings to some unused letters (not symbols, like before) and it works.

Hadn't thought that wmii can't parse those symbols.

Thanks for your help, all problems solved (besides a conky problem that is unsolvable), so I can totally ditch Xmonad and have fun with wmii.
Yeah, I was a bit ticked when I found out conky and wmii did not mix well which is why I used dwm for so long... but wmii is just a far more convenient wm. It does exactly what I want and is damned logical.

Now all I have to do is get you to switch from Vimperator to Pentadactyl :P
 
Old 10-23-2011, 05:50 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by Ian John Locke II View Post
Now all I have to do is get you to switch from Vimperator to Pentadactyl :P
I tried that, and it doesn't seem to be that different. What are the advantages of Pentadactyl (that I am obviously missing, I would think)?
 
Old 10-24-2011, 07:45 PM   #12
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
Quote:
Originally Posted by TobiSGD View Post
I tried that, and it doesn't seem to be that different. What are the advantages of Pentadactyl (that I am obviously missing, I would think)?
Well it's been trying to keep more in line with the vim ideology rather than having started from there and gone off the deep end. It's faster in terms of start-up speed. It doesn't use so much hackish CSS to make it look "pretty" which further slows it down. Kris recently revamped completions so it's even faster and I think he's doing some part of it in C++ now to further optimize the speed of the code (although I'm not entirely certain what the purpose is).

There are also some more logical keybindings and less "add-ons" required to accomplish some things I wanted in Vimperator (like using the homerow for hints instead of numbers).
 
Old 10-24-2011, 11:46 PM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Thanks for clarification. I think I will try that a little bit more and see if I like it.
 
Old 10-25-2011, 03:19 PM   #14
Ian John Locke II
Member
 
Registered: Mar 2008
Location: /dev/null
Distribution: Slackware, Android, Slackware64
Posts: 130

Rep: Reputation: 17
Quote:
Originally Posted by TobiSGD View Post
Thanks for clarification. I think I will try that a little bit more and see if I like it.
Also, even though there hasn't been a release like "1.0", the development branch is extraordinarily stable.
 
Old 10-25-2011, 03:29 PM   #15
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Original Poster
Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Switched to it this evening. Let's see how it works for me, but currently I can't see any differences to vimperator, but I was fairly new to that, too.
 
  


Reply

Tags
keybindings, wmii


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
wmii + Slackware 13.37 Jinx-Wolf Slackware 5 06-13-2011 02:30 PM
wmii not showing up 10100010 Linux - Desktop 1 08-31-2010 09:38 PM
wmii slackbuild fails... What can I do...? Alexvader Slackware 3 11-02-2009 10:59 AM
Ubuntu - Problem with WMII RUBY Wind_Sp00n Ubuntu 0 10-10-2006 09:44 PM
bbconf problems: blackbox keybindings don't work a27x64sy Linux - Software 1 09-29-2003 12:48 AM


All times are GMT -5. The time now is 09:20 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration