You are not logged in.
To avoid floading the desktop thread, the discussion that was going here, let's continue it here
Just a reminder of some important links,
- Scripting the wmii-3 window manager with Ruby
- ruby-wmii: Ruby configuration/scripting for the wmii window manager
- My wmii-3 configs (always up-to-date)
Some screenshots from the desktop thread:
- _Gandalf_ :
[URL=http://Serv3.imagehigh.com/view.php?id=13890_22_06_2006.png&path=/imgs/04][/URL][URL=http://Serv3.imagehigh.com/view.php?id=4708_22_06_2006_2.png&path=/imgs/04][/URL]
[URL=http://Serv1.imagehigh.com/view.php?id=13275_1.png&path=/imgs//ih000001][/URL][URL=http://Serv1.imagehigh.com/view.php?id=15919_mess.png&path=/imgs//ih000001][/URL]
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Although I don't feel that wmii works all that well for me at this point, I can't help being interested. It seems useful in certain cases...who knows, maybe I will give it a try. I was just wondering how wmii handles a dual-head setup (spec. TwinView). Does it "see" the monitor edges, or does it treat it as one huge desktop and place columns in the center of the monitors?
Offline
I'm not sure about dual-head, I use Xinerema (my card does not support TwinView) I haven't tried it yet but if u want i can see how it does handle it...
[My Blog] | [My Repo] | [My AUR Packages]
Offline
I'm not sure about dual-head, I use Xinerema (my card does not support TwinView) I haven't tried it yet but if u want i can see how it does handle it...
wmii doesn't support xinerema you would have to start two instances of wmiiwm on the two screens i think.
Offline
So, as I incorrectly asked in the desktop thread; is it possible to get a "taskbar" in wmii?
I don't imagine it would be too difficult, if I knew anything about Ruby.
If......
Offline
You missed my screenshot. :?
sf.: I don't know about you, but between tags and the bars I already have, a task bar wouldn't fit that well. I imagine that if you capture all of the CreateClient events, you could generate the task bar, but I don't see any events that you could capture to remove the closed windows.
Offline
It would probably work better as a menu. Just something to see/switch to what I have open in the current view when everything is maximized
Offline
A couple of small snippets/edits:
First, I modified the MPD stuff so I can change which host I'm monitoring (sometimes, I'm listening on my laptop, and sometimes I'm controlling my Media PC from my laptop). You can use MODKEY-Ctrl-m to change hosts. Note: This doesn't have all the play/pause/skip functionality; I really just want it so I can glance and see what's playing. Also, I use some tricky hackery to record when I'm changing servers; if you guys know a cleaner way to do that, let me know.
setup_bar("01_mpd", normcolors) do |bar|
bar.data = "Connecting: #{`hostname`.chomp}"
serv_name = bar.data.split[1]
mpd_serv = MPD.new(serv_name)
mpd_update = lambda do
if bar.data =~ /^Connecting/
serv_name = bar.data.split[1]
mpd_serv = MPD.new(serv_name)
end
text = "#{serv_name}: "
begin
case mpd_serv.status["state"]
when "play"
text << ">>: "
when "pause"
text << "||: "
else
text << "[]: "
end
text << mpd_serv.strf("%a - %t (%e/%l)")
rescue
text << "MPD not running"
end
bar.data = text
end
Thread.new do
loop do
begin
mpd_update.call
rescue
bar.data = "Error!"
end
sleep 3
end
end
on_key("MODKEY-Control-m") { wmiimenu("hostname:") { |server| bar.data = "Connecting: #{server}" } }
end
Here's another relatively brain-dead one for use on my laptop, that just shows the current CPU speed:
# {{{ CPU info
setup_bar("80_cpuinfo", normcolors, "CPUINFO --- init") do |bar|
Thread.new do
loop do
cpuinfo = `cat /proc/cpuinfo`.split("n")[6].split[-1].sub(/..*$/,'')
bar.data = cpuinfo.chomp + " Mhz"
sleep 5
end
end
end
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
@AllTom: screenshot added but your site ain't working, please fix...
@nogoma: Thanks for the CPU info Applet
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Modularization, FTW! Personally, I don't like having my config as a giant file w/ color settings and code snippets, so I refactored my wmiirc to allow me to place snippets (like the MPD controller) in a subdirectory (~/.wmii-3/snippets), and have them loaded via an array. This also makes rearranging them in the bar simpler (instead of having to modify the numbers, the order they appear in the array determines the order in the bar.) On to the code:
First, I added a simple global var to hold the location of the snippets; this code goes near the beginning of my wmiirc:
WMIIRC_VERSION = "0.2.1"
WMIIRC_HOME = ENV["HOME"] + "/.wmii-3/"
SNIPPET_DIR = WMIIRC_HOME + "snippets"
Next, I added a small chunk of code to load each listed snippet:
# Loads mpd.rb, then cpuinfo.rb, etc. This array
# determines the order of the snippets in the bar.
%w{mpd cpuinfo mode volume status}.each_with_index do |snippet, index|
setup_bar("#{"%02d" % (index+1)}_#{snippet}") do |bar|
eval(IO.read("#{SNIPPET_DIR}/#{snippet}.rb"), binding)
end
end
Finally, into my ~/.wmii-3/snippets dir I put all the applets; each of which is basically the lines that would appear between the do/end of setup_bar block; for example, for the MPD applet I posted earlier, I copy the following code into ~/.wmii-3/snippets/mpd.rb:
bar.data = "Connecting: #{`hostname`.chomp}"
serv_name = bar.data.split[1]
mpd_serv = MPD.new(serv_name)
mpd_update = lambda do
if bar.data =~ /^Connecting/
serv_name = bar.data.split[1]
mpd_serv = MPD.new(serv_name)
end
text = "#{serv_name}: "
begin
case mpd_serv.status["state"]
when "play"
text << ">>: "
when "pause"
text << "||: "
else
text << "[]: "
end
text << mpd_serv.strf("%a - %t (%e/%l)")
rescue
text << "MPD_BAR not running"
end
bar.data = text
end
Thread.new do
loop do
begin
mpd_update.call
rescue
bar.data = "Error!"
end
sleep 3
end
end
on_key("MODKEY-Control-m") { wmiimenu("hostname:") { |server| bar.data = "Connecting: #{server}" } }
Of course, the code for each snippet should now be commented out/removed from the wmiirc itself.
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
Nice job nogoma, mfp (the ruby script author) is doing the same idea AFAIK from the last mail but I send him another maybe save him time or maybe another idea
Thx
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Man, Mauricio is modularizing wmiirc? I'm sure his results will be much better, his Ruby-foo is much stronger than mine . Oh well, I'll stick to this until the next release, I guess. This solution is pretty hack-y; for example, if you modify the array of snippets to load, it doesn't do a good job of removing the old ones. Also, it probably doesn't fail gracefully if you type, for example "mpf" instead of "mpd", and it can't find mpf.rb.
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
Yeah of course he is , I also wait till next release, Oh BTW
to all ruby-wmii ver 0.2.1 users please apply this patch -> http://pastebin.ca/70973
If you haven't noticed your .wmii-3/wmiirc.log is a huge file (maybe not, the bug wasn't reported by everyone)...
more information -> http://eigenclass.org/hiki.rb?ruby-wmii+0.2.1
P.S: did I ever mention that I HATE phpbb more than anything in this life ?? if not ->
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Nice; I probably should have commented when I noticed my logfile was 2.1G (seriously :shock: !)
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
This solution is pretty hack-y; for example, if you modify the array of snippets to load, it doesn't do a good job of removing the old ones. Also, it probably doesn't fail gracefully if you type, for example "mpf" instead of "mpd", and it can't find mpf.rb.
My idea wasn't about creating a static array, I mean this is Ruby, lovely code can be done.
Anyway My idea was to have ~/.wmii-3/plugins and ~/.wmii-3/bars, then in ~/.wmii-3/wmiirc, have something like
Dir[ENV["HOME"] + '.wmii-3/plugins/*.rb'].each do |plugin|
# Do stuff...
end
Got the idea
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Yeah, good point. The only reason I didn't do that is that sometimes I'll have some extra code (e.g. the dictionary snippet) that I don't want to include, but I'm (apparently) too lazy to move/disable the code; having an explicit array of snippets to include seemed easier at the time. Also, the array solution made re-ordering on the bar a little easier. Of course, this latter concern could be dealt with by naming the files, e.g. 01_mpd.rb, 02_cpuinfo.rb, etc (which kind of makes more sense, as this is how "wmiir read /bar" will report them). So, yeah, there is certainly a better (or at least different) way to do this. This is a question I should probably direct at mfp, but do you know how far along his efforts are? I'm sort of interested in pulling out the appropriate code into a separate module, as has been suggested in the eignenclass comments, but I don't really want to duplicate work. It'd certainly make my silly modularization hack easier, as I wouldn't have to rely on stuff like "eval(IO.read(file),binding)", etc. Making a little WMII::Snippet class probably makes more sense. Anyway, I should probably stop hijacking this thread from being a wmiirc discussion into a ruby library dev thread .
-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/
Offline
hehe
no i don't know his progress yet, but we'll just wait to see his latest code
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Hmm, wmii doesn't seem all that great to me. I looked at the screenshots it it seems far to simple based to me. Nothing wrong with that, but I like my captions to have a littl more detail than completely flat. I think I'll stick to OB3 until I research this wm more .
Offline
Hey, I'd modularized my version of 0.2.1 in pretty much the same way, so it should be interesting to see how the original author does it.
With the release as downloaded from the wiki, I've had lots of problems with terminals resizing improperly. When I have only one tag and more than one terminal open, if I close any of them or restart the window manager, they fly all over the place until I change the mode of each of the columns. I don't get that with the shell script provided with wmii... I'm still trying to track that one down. It happens with urxvt and xterm.
I haven't had problems with my site today, but I was joking about the screenshot.
Offline
I have the same issue with urxvt flying around when I close/open something, Plus a lot of times when i close something WMII just close...
[My Blog] | [My Repo] | [My AUR Packages]
Offline
I have the same issue with urxvt flying around when I close/open something, Plus a lot of times when i close something WMII just close...
In the default wmiirc, programs are run with wmiisetsid(There's a setsid binary in linux that does the same thing). If you don't do this, programs that don't set a separate session id from wmii will take the wm down when they close.
Offline
Little question to wmii:
How about virtual desktops? Somehow managed to assign them "Terminals" which is in the bar in the bottom of screen, and "1". I am using Gandalf's config, but virtual desktops means a lot to me Tried some researching without any luck.
Offline
Thx SleepyDog we need eventually a run program function instead of system"..." to take care of it...
Loke wmii-3 does not have virtual desktops, but Tags, You can tag a windows via Alt+Shit+t and choose the Tag (or type the new one) Tags can be a number or a name...
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Great, just what I was looking for, thanks
Just one last question, keyboard shortcut to close a window? Wasn't able to find it anywhere
Offline
Close window = Alt + Shift + c
I added a function called run_cmd which basicly run the command but vie wmiisetsid, For those using my config can you please re-download the file and tell me if there's any problems with it now???
Thx.
[My Blog] | [My Repo] | [My AUR Packages]
Offline