You are not logged in.

#51 2006-07-05 02:54:54

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: The wmii thread

Hahah, ok.  It's a little ridiculous for me to think I'll get credit for things I have all ready posted as public, but thanks for being honest big_smile

Sometimes I get pissy.  I sent him an email.

Offline

#52 2006-07-05 03:32:45

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: The wmii thread

@codemac: I saw in the Screenshots thread you're back on Ion; mind posting your config or some pointers? I wanted to try out Ion just to compare, but it seems the learning curve is a little steeper (or maybe I just dove into wmii on account of tasty ruby goodness, and the curve is just as steep); I would like to give Ion a shot, though. Maybe we need a "The Ion thread", at least for comparison's sake wink . I don't think I'll be forsaking wmii, since it really is KISS and ruby-licious (did I mention I like ruby yet? wink ), but I know Ion's supposed to be able to do quite a bit more, while still staying out of my way.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#53 2006-07-05 04:02:27

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: The wmii thread

codemac wrote:

Hahah, ok.  It's a little ridiculous for me to think I'll get credit for things I have all ready posted as public, but thanks for being honest big_smile

Oh it's ok man, it's not like I'm saying i did it or something lol, i'm not that kind of man, I just forgot to say `codemac' did the code, I changed the battery applet to do a defined action on low/critical and i sent it to him as a darcs patch, my fault again to forget mentioning it, really sorry, i guess i got so excited discovering wmii, learning ruby and stuff big_smile lol

Glad you mailed mfp though smile

Offline

#54 2006-07-05 04:24:37

AllTom
Member
Registered: 2006-01-02
Posts: 60
Website

Re: The wmii thread

def to_hash(str)
  x = str.split("n").map { |x| x.split(':') }.map { |x| [x.first.gsub(' ','_').to_sym, x.last.strip] }.flatten
  Hash[*x]
end

I wrote that function when I was working on the battery bar because I found the use of line numbers, etc. a bit annoying. Passing the contents of files in /proc/acpi to that function generates a hash that maps the name of the field to its value. For my battery bar, it looks like this:

batt = IO.readlines(statefile).join
battinfo = IO.readlines(infofile).join
battery = {}.merge(to_hash(batt)).merge(to_hash(battinfo)) # combine state and info for convenience

batt_percent = [battery[:remaining_capacity].to_f / battery[:last_full_capacity].to_f * 100.0, 100].min.truncate
batt_state = battery[:charging_state]

Also, I have modded the volume applet to control multiple mixers--on my computer, Master, Master Mono, and Headphone. The reason is that Master doesn't adjust the subwoofer speaker's volume (Master Mono), and I don't want a second control just for the headphone jack. I'll be submitting that back to the author, but I can post it if that's bugging anyone right now...

Offline

#55 2006-07-06 00:06:35

ingvildr
Member
From: Brighton, England
Registered: 2005-04-19
Posts: 203

Re: The wmii thread

a quick question about wmii, is it possible to make a program load borderless (gmplayer).

Offline

#56 2006-07-06 02:11:59

SleepyDog
Member
Registered: 2004-10-15
Posts: 114

Re: The wmii thread

No

Offline

#57 2006-07-06 11:57:27

AllTom
Member
Registered: 2006-01-02
Posts: 60
Website

Re: The wmii thread

Azureus makes its notifications pop up borderless because it manages them itself, but wmii reacts by making it impossible to click or type into them...

Offline

#58 2006-07-06 12:23:01

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: The wmii thread

That's an azureus bug, and exists in all WM's, not just wmii.

Offline

#59 2006-07-07 00:33:23

AllTom
Member
Registered: 2006-01-02
Posts: 60
Website

Re: The wmii thread

codemac wrote:

That's an azureus bug, and exists in all WM's, not just wmii.

I wasn't reporting a bug...

Offline

#60 2006-07-07 00:49:11

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: The wmii thread

AllTom wrote:

[....blah blah...] but wmii reacts by making it impossible to click or type into them...

Note the bold.  You said wmii was doing it.  I said Azureus was doing it.

No one was talking about bug reporting.

Offline

#61 2006-07-07 02:05:29

Paul
Member
Registered: 2004-04-12
Posts: 72

Re: The wmii thread

I have a question about volume shortcuts
I came up with this but its not right...

$MODKEY-Control-$DOWN)
PATH="$OLD_PATH" amixer sset Master,0 10%- &;;
$MODKEY-Control-$UP)
PATH="$OLD_PATH" amixer sset Master,0 10%+ &;;

Could you help me out?

Btw, would the wmii gurus mind setting up a wmii wiki page with your great scripts and configs?[/list]

Offline

#62 2006-07-07 02:49:18

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: The wmii thread

Paul wrote:

I have a question about volume shortcuts
I came up with this but its not right...

$MODKEY-Control-$DOWN)
PATH="$OLD_PATH" amixer sset Master,0 10%- &;;
$MODKEY-Control-$UP)
PATH="$OLD_PATH" amixer sset Master,0 10%+ &;;

it's "amixer set" not "amixer sset" unless it's a post typo, and BTW you use bash configs or ruby-wmii ??

Paul wrote:

Could you help me out?

Btw, would the wmii gurus mind setting up a wmii wiki page with your great scripts and configs?

I'd love to but am not very good at wiki syntax :oops:

Offline

#63 2006-07-07 03:20:17

Paul
Member
Registered: 2004-04-12
Posts: 72

Re: The wmii thread

Gandalf: I'm using bash

Hmm, turns out my UP and DOWN keys aren't registering...? changing them to "j" and "k" fixed it.

Another question, how do I shutdown the computer from wmii? Is the only way via the terminal (like halt)?

Also, can mpc play radio streams?

Thanks!

Offline

#64 2006-07-07 03:38:53

Borosai
Member
From: Sandy Appendix, U.S.A.
Registered: 2006-06-15
Posts: 227

Re: The wmii thread

Would someone be so kind and explain (briefly is good) what the differnce is between wmii and ruby-wmii. Thanks.

Offline

#65 2006-07-07 03:44:34

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: The wmii thread

wmii is the window manager itself; it can be controlled via pretty much any programming language. It ships w/ a bash shell control script. Any such script can be used; whatever is in ~/.wmii-3/wmiirc will be sourced as the controlling script. The ruby-wmii script is a project over at mfp's site that performs the control using the programming language Ruby. That means the key bindings, bar applets, everything are controlled via ruby. It's a pretty elegant project/solution, and seems to be a fav among wmii users here on the forums (some users mentioned writing a python wmiirc, but I don't know how/if that's progressing).  HTH


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#66 2006-07-07 03:48:12

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: The wmii thread

Paul wrote:

Gandalf: I'm using bash

Hmm, turns out my UP and DOWN keys aren't registering...? changing them to "j" and "k" fixed it.

Another question, how do I shutdown the computer from wmii? Is the only way via the terminal (like halt)?

Also, can mpc play radio streams?

Thanks!

Not sure why the UP/DOWN keys wouldn't be working (the others work fine?); unfortunately, I think most people on here are using the ruby-wmii project, instead of the bash script wmii ships with. So, I don't know if this advice applies to the bash version; with ruby-wmii, hitting alt-p to activate the program menu, and then typing "quit<enter>" causes wmii to quit.

As for mpc (assuming you have MPD running), yes, you can use it to play streams; I do it all the time. The usual procedure is to download the .pls file of whatever stream you want, extract the actual url of the stream (usually the line "File1=..." indicates the URL), then pass that url using "mpc add <URL>", which will add it to MPD's playlist.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#67 2006-07-07 04:07:38

Paul
Member
Registered: 2004-04-12
Posts: 72

Re: The wmii thread

nogma:
I'm not getting any sound from the stream (I can from local mp3's): did i do this correctly?

$ mpc add http://di.fm/mp3/chillout.pls
adding: http://di.fm/mp3/chillout.pls
$ mpc play
http://di.fm/mp3/chillout.pls
[playing] #1/1   0:00 (100%)
volume:100%   repeat: off   random: off
$ 

"quit<enter>" causes wmii to quit.

So the only way to shutdown the computer is to exit wmii and then "halt"?

Offline

#68 2006-07-07 04:26:12

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: The wmii thread

Sorry, my mpc commands perhaps weren't clear. Here we go:

[tambooki@komadori:~/docs/radio]% wget http://kexp-mp3-128k.cac.washington.edu:8000/listen.pls

00:20:11 (5.94 MB/s) - `listen.pls' saved [81]
[tambooki@komadori:~/docs/radio]% cat listen.pls 
[playlist]
NumberOfEntries=1
File1=http://kexp-mp3-128k.cac.washington.edu:8000/
[tambooki@komadori:~/docs/radio]% mpc add http://kexp-mp3-128k.cac.washington.edu:8000/
adding: http://kexp-mp3-128k.cac.washington.edu:8000/
[tambooki@komadori:~/docs/radio]% mpc play
http://kexp-mp3-128k.cac.washington.edu:8000/
[playing] #1/1   0:00 (100%)
volume:  0%   repeat: off   random: off
[tambooki@komadori:~/docs/radio]%

(Note: it isn't always the case that the stream url inside in the .pls file will just be the same host as you download the .pls file from! That just happned  to be the case here)

So, basically, my steps were:
1) Download the .pls file (using wget, in my case).
2) Read the .pls file for the url. Doing `cat listen.pls | grep "File.="` works great to quickly grab the URLs
3) Pass the result of the grep to mpc w/ mpc add <url>

That should do it.

As for the shutdown question: Sorry, I totally misread your question the first time! If your user can invoke the shutdown (or halt) command w/o entering a password (via the 'sudo' command or what have you), you could create a keybinding for it. How to do this depends on what scripts you're using to control wmii; are you using the default shell script wmii comes with, or the ruby-wmii project?

---
Edit: I added a preliminary wiki page on using wmii, primarily focused on using ruby-wmii with it. Configuring_wmii. New users and old users alike are invited to check it out and edit! I'm not sure if I covered all the right bases (or if the ones I covered are clear at all), so if there are newbies out there feeling that something's missing, speak up and somebody will try their best to add it. There is currently a (small) section at the end for users to post their own snippets and such.[/url]


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#69 2006-07-07 04:40:37

Paul
Member
Registered: 2004-04-12
Posts: 72

Re: The wmii thread

Hey nogma, thanks for your help, I really appreciate it. My mpd is now playing streams thanks to you!

I am using the default script but I see that all the popular kids are using the ruby script. Is the ruby script a drop in replacement for the default?

Offline

#70 2006-07-07 04:43:27

Borosai
Member
From: Sandy Appendix, U.S.A.
Registered: 2006-06-15
Posts: 227

Re: The wmii thread

nogoma wrote:

wmii is the window manager itself; it can be controlled via pretty much any programming language. It ships w/ a bash shell control script. Any such script can be used; whatever is in ~/.wmii-3/wmiirc will be sourced as the controlling script. The ruby-wmii script is a project over at mfp's site that performs the control using the programming language Ruby. That means the key bindings, bar applets, everything are controlled via ruby. It's a pretty elegant project/solution, and seems to be a fav among wmii users here on the forums (some users mentioned writing a python wmiirc, but I don't know how/if that's progressing).  HTH

Great reply...thanks.

Offline

#71 2006-07-07 04:47:36

Paul
Member
Registered: 2004-04-12
Posts: 72

Re: The wmii thread

nogoma wrote:

I added a preliminary wiki page on using wmii, primarily focused on using ruby-wmii with it.


Nogma for the win!

Offline

#72 2006-07-07 04:51:05

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: The wmii thread

Paul wrote:

Hey nogma, thanks for your help, I really appreciate it. My mpd is now playing streams thanks to you!

np; you can of course also cook up (or probably locate via google) some simple shell script to do the fetch/parse/mpc add for you.

Paul wrote:

I am using the default script but I see that all the popular kids are using the ruby script. Is the ruby script a drop in replacement for the default?

It is; the only caveat is you'll need ruby installed on your machine (available via pacman from [current]). After that, simply download the project from mfp's site, install ('ruby install.rb' in the unpacked directory), and it places itself at ~/.wmii-3/wmiirc. From there, you can re-load the wmiirc (or restart wmii), and you're good to start customizing and enjoying.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#73 2006-07-07 17:11:47

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: The wmii thread

_why (everybody's favorite insane rubyist) posted a little mailbox checker. I didn't post it to the wikipage, as obviously I didn't author it, but thought people would find it useful.

Edit: Just realized the plugin supports POP and IMAP mailboxes  8) .


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#74 2006-07-07 21:38:40

AllTom
Member
Registered: 2006-01-02
Posts: 60
Website

Re: The wmii thread

nogoma wrote:

Edit: Just realized the plugin supports POP and IMAP mailboxes  8) .

With SSL!

nogoma & Paul: The MPD plugin requires the Ruby bindings for mpd, or it will do bad things if you try to enable it. The package is in community, ruby-mpd I think.

Offline

#75 2006-07-08 18:47:47

abhidg
Member
From: City of Kol
Registered: 2006-07-01
Posts: 184
Website

Re: The wmii thread

Is there a way to show titiles in wmii? (I am using the bash version)

Offline

Board footer

Powered by FluxBB