You are not logged in.
<OFFTOPIC>
codemac i have a little issue with wmii and mpd, for some reason the applet stop refreshing after a very little while (like it refresh for 3 or 4 times).
Also when I login, if mpd is not playing the status will not exist i have to play and then run wmiirc again, maybe I have to add a static text first ??
here's the mpd applet part
# {{{ MPD Bar
mpd_name = "01_mpd"
setup_bar(mpd_name, normcolors)
update_bar = lambda do
mpdserv = MPD.new
if mpdserv.status["state"] == "play"
text = ">>: "
else
if mpdserv.status["state"] == "pause"
text = "||: "
else
text = "[]: "
end
end
text = text + mpdserv.strf("%a - %t (%e/%l)")
write("/bar/#{mpd_name}/data", text)
end
Thread.new{ loop { update_bar.call; sleep 1 } }
on_barclick(mpd_name, MOUSE_SCROLL_UP){ Thread.new {mpdserv = MPD.new;mpdserv.seek(3) ;update_bar.call} }
on_barclick(mpd_name, MOUSE_SCROLL_DOWN){ Thread.new {mpdserv = MPD.new;mpdserv.seek(-3); update_bar.call} }
on_barclick(mpd_name, MOUSE_BUTTON_LEFT) do
Thread.new do
mpdserv = MPD.new
if mpdserv.status["state"] == "pause"
mpdserv.play
else
mpdserv.pause
end
update_bar.call
end
end
on_barclick(mpd_name, MOUSE_BUTTON_RIGHT) do
mpd_handle = on_createclient do |cid|
write("/view/sel/sel/geom", "400 0 center+200 south")
e.unregister mpd_handle
end
write("/view/ctl", "select toggle")
system "urxvt -e ncmpc &"
end
# }}}
whole wmiirc -> http://wael.nasreddine.com/files/config … i-3/wmiirc
I appreciate you help
</OFFTOPIC>
[My Blog] | [My Repo] | [My AUR Packages]
Offline
# {{{ MPD Bar
mpd_name = "01_mpd"
setup_bar(mpd_name, WMII_NORMCOLORS)
mpdserv = MPD.new
update_bar = lambda do
if mpdserv.status["state"] == "play"
text = ">>: "
else
if mpdserv.status["state"] == "pause"
text = "||: "
else
text = "[]: "
end
end
text = text + mpdserv.strf("%a - %t (%e/%l)")
write("/bar/#{mpd_name}/data", text)
end
Thread.new{ loop { update_bar.call; sleep 1 } }
on_barclick(mpd_name, MOUSE_SCROLL_UP){ Thread.new {mpdserv.seek(3); update_bar.call} }
on_barclick(mpd_name, MOUSE_SCROLL_DOWN){ Thread.new {mpdserv.seek(-3); update_bar.call} }
on_barclick(mpd_name, MOUSE_BUTTON_LEFT) { mpdserv.pause }
on_barclick(mpd_name, MOUSE_BUTTON_RIGHT) do
mpd_handle = on_createclient do |cid|
write("/view/sel/sel/geom", "400 0 center+200 south")
e.unregister mpd_handle
end
write("/view/ctl", "select toggle")
system "urxvt -e ncmpc &"
end
NEW ONE ^^^^
After deciding to actually figure out how mpd.rb worked, I redid parts of the script. Making a new MPD connection was the wrong way to go. The if else for the pause/play toggle is unnecessary, and can lead to your mess ups, I think it was what was messing up mine.
Yay for working bars!
Offline
Wow very nice !!!!! :mrgreen:
May I get your .Xdefaults? How did you do this unusual prompt?
Offline
codemac you are right, I was actually working on it I didn't see your post but i fixed it too, the error was to connect each time to MPD, but now i implement MPD is_connected? method to check for connection first, if no connection then initialize it...
here's the part and patch (just to see where I changed stuff)
# {{{ MPD Bar
mpd_name = "01_mpd"
setup_bar(mpd_name, normcolors)
mpdserv = MPD.new
update_bar = lambda do
if mpdserv.status["state"] == "play"
text = ">>: "
else
if mpdserv.status["state"] == "pause"
text = "||: "
else
text = "[]: "
end
end
text = text + mpdserv.strf("%a - %t (%e/%l)")
write("/bar/#{mpd_name}/data", text)
end
# Initialize MPD status
write("/bar/#{mpd_name}/data", "[]: NOT PLAYING")
Thread.new do
loop do
if not mpdserv.is_connected?
# Try to connect first
mpdserv = MPD.new
end
update_bar.call
sleep 1
end
end
on_barclick(mpd_name, MOUSE_SCROLL_UP) do
Thread.new do
if not mpdserv.is_connected?
# Try to connect first
mpdserv = MPD.new
end
mpdserv.seek(3)
end
end
on_barclick(mpd_name, MOUSE_SCROLL_DOWN) do
Thread.new do
if not mpdserv.is_connected?
# Try to connect first
mpdserv = MPD.new
end
mpdserv.seek(-3)
end
end
on_barclick(mpd_name, MOUSE_BUTTON_LEFT) do
Thread.new do
if not mpdserv.is_connected?
# Try to connect first
mpdserv = MPD.new
end
mpdserv.pause
end
end
on_barclick(mpd_name, MOUSE_BUTTON_RIGHT) do
mpd_handle = on_createclient do |cid|
write("/view/sel/sel/geom", "400 0 center+200 south")
e.unregister mpd_handle
end
write("/view/ctl", "select toggle")
system "urxvt -e ncmpc &"
end
# }}}
=== wmiirc
==================================================================
--- wmiirc (revision 1917)
+++ wmiirc (revision 1927)
@@ -123,8 +123,8 @@
# {{{ MPD Bar
mpd_name = "01_mpd"
setup_bar(mpd_name, normcolors)
+ mpdserv = MPD.new
update_bar = lambda do
- mpdserv = MPD.new
if mpdserv.status["state"] == "play"
text = ">>: "
else
@@ -137,19 +137,43 @@
text = text + mpdserv.strf("%a - %t (%e/%l)")
write("/bar/#{mpd_name}/data", text)
end
- Thread.new{ loop { update_bar.call; sleep 1 } }
-
- on_barclick(mpd_name, MOUSE_SCROLL_UP){ Thread.new {mpdserv = MPD.new;mpdserv.seek(3) ;update_bar.call} }
- on_barclick(mpd_name, MOUSE_SCROLL_DOWN){ Thread.new {mpdserv = MPD.new;mpdserv.seek(-3); update_bar.call} }
+ # Initialize MPD status
+ write("/bar/#{mpd_name}/data", "[]: NOT PLAYING")
+ Thread.new do
+ loop do
+ if not mpdserv.is_connected?
+ # Try to connect first
+ mpdserv = MPD.new
+ end
+ update_bar.call
+ sleep 1
+ end
+ end
+ on_barclick(mpd_name, MOUSE_SCROLL_UP) do
+ Thread.new do
+ if not mpdserv.is_connected?
+ # Try to connect first
+ mpdserv = MPD.new
+ end
+ mpdserv.seek(3)
+ end
+ end
+ on_barclick(mpd_name, MOUSE_SCROLL_DOWN) do
+ Thread.new do
+ if not mpdserv.is_connected?
+ # Try to connect first
+ mpdserv = MPD.new
+ end
+ mpdserv.seek(-3)
+ end
+ end
on_barclick(mpd_name, MOUSE_BUTTON_LEFT) do
Thread.new do
- mpdserv = MPD.new
- if mpdserv.status["state"] == "pause"
- mpdserv.play
- else
- mpdserv.pause
+ if not mpdserv.is_connected?
+ # Try to connect first
+ mpdserv = MPD.new
end
- update_bar.call
+ mpdserv.pause
end
end
on_barclick(mpd_name, MOUSE_BUTTON_RIGHT) do
EDIT: There still one problem, When I pause/play the tha appler does not refresh anymore
EDIT2: FIXED, the error was calling update_bar in each of pause/forward/backward, We should leave it to the loop instead, Patch and code updated...
[My Blog] | [My Repo] | [My AUR Packages]
Offline
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Do you have a different boldFont? If so, what is it? It looks nice, I wants to steals it!
Offline
LOL Actually I stole urs phrakture , I didn't use some specific bold fonts, but I used bigger fonts than urs
.fonts.conf
.Xdefaults
.vimrc
and Vim theme
Check My config files here -> http://wael.nasreddine.com/files/config/
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Wauw, wmii has changed _alot_ sinde I tried wmi. :shock:
Arch - It's something refreshing
Offline
Yea whargoul a lot, I was also impressed by it, the Ver 3 rocks
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Gandalf, you could make your wmiirc a little more succinct if instead all those if not else lines, just do:
mpdserv = MPD.new unless mpdserv.is_connected?
o/ yay ruby o/
Offline
Already done, *still learning ruby :oops: *
Thx anyway
[My Blog] | [My Repo] | [My AUR Packages]
Offline
Gandalf, codemac - you should really move your discussion in a new thread. I am sure that somebody would like to use wmii (like my self), so another thread is just easier to browse through.
Arch - It's something refreshing
Offline
I agree, Can any mod split the posts into a new topic please ??
thx
[My Blog] | [My Repo] | [My AUR Packages]
Offline
This probably isn't the place to ask, but is there a Ruby solution to getting a "taskbar" in Wmii-3?
Maybe wanting a taskbar is a sign that I should be using something else
Offline
I read this topic and I saw that Wmii is using by 'pro'-users... I want to taste it and I've install it... You should make several topic about it...
Wmii is very interesting!
Offline
[URL=http://img240.imageshack.us/my.php?image=kde35240620066cz.png][/URL]
This is a pilot. I guess it won't be long till I'm fed up with having 20 desktops, but it may be worth a shot.
Some PKGBUILDs: http://members.lycos.co.uk/sweiss3
Offline
For wmii stuff, Please go to http://bbs.archlinux.org/viewtopic.php?t=22592 and please keep the discussion in one topic
[My Blog] | [My Repo] | [My AUR Packages]
Offline
a huge mess, pic says everything
[URL=http://Serv1.imagehigh.com/view.php?id=15919_mess.png&path=/imgs//ih000001][/URL]
[My Blog] | [My Repo] | [My AUR Packages]
Offline
ion3
[URL=http://img144.imageshack.us/my.php?image=ion3yaarglook1on.png][/URL]
Offline
So for someone who has used ion3 only for 5min, would you recommend messing with it, or wmii?
I've been wanting to try tiled WMs for a while... i don't know any ruby, but i'm good enough in bash.
Offline
I never used ion3 (well not longer than 10 mins), so from the 10 mns experience I say wmii is a bit more advanced (maybe features) anyway iphitus uses ion3 so he should have the answer...
[My Blog] | [My Repo] | [My AUR Packages]
Offline
I'd say that ion3 is substantially more advanced than wmii, and definitely has more features, but then again, it's quite a bit more complex too. I should be wary saying that, a I havnt really used WMII for any period of time, but everything I've seen in the screenshots, can be done in ion3, and there's a helluva lot more that I havn't seen done in any WMII screenshots. I don't have any doubt though that ion3 is far more scriptable and configurable than wmii.
You really need to set some time aside with ion3 to work out the config files and work out how you want to set it up and explore the features, cause there's a helluva lot - more than I even use.
James
Offline
The real difference is not the advancement that iphitus claims, but really how much is done all ready for you. When you start with wmii, you've got nothing. It's easy to add things, but a scratchpad takes a fair about of knowledge and finengling just to get poorly emulated, whereas in ion it's the default. Ion is great, and I may go back to it soon, it's just fun to have a WM to hack up again, ion was all ready tricked out from 7 years of configs :-P
I think that with ion you have lua bindings, whereas with wmii you have to make them yourself, or download hald decent ones. Once some much more advanced/abstracted bindings come out for WMII, I think it could do everything Ion did. That's what's neat about wmii, it can do _anything_ you want. Ion can do the same, but it's a bit harder to get right.
Think of it this way, if you enjoy configuring your wm, use wmii. If you want your wm to have a very specific behavior set, and really don't care about changing it after that, Ion > wmii every time. That's another reason why I may go back... I'm really not tagging my windows. I just have urxvt and firefox most of the time
Offline
To stay OT:
(wonder why the mplayer window is black like that : )
It would be more fair, I think, to judge wmii in terms what it *doesn't* do and features it *doesn't* have. You cannot, for example, create most of the elaborate layouts you see in most ion screenshots. There is no tabbing. There are no special frames/windows (referring to ion3's scratchpad) beyond floating/managed. There are no xft fonts. There are no pixmap buttons in title bars. There are no gradients, gauges, meters, or anything of the sort. And there are very few options.
Ion3 is more configurable than wmii. It has tenfold more settings to set. Even the look of ion is much more configurable than wmii. There's even some sort of session support in there. However, wmii has a big advantage as far as scriptability goes. As you've seen in this thread, you can script it in *any* language that can call outside programs (or that has libraries for the 9P protocol). Not everybody likes Lua. Not everybody likes any single language, which makes wmii's language-agnostic scripting very appealing. There are wmiircs in sh, rc, python, awk, ruby, perl, common lisp...the list goes on. There's also a very powerful event interface.
I think iphitus summed up wmii perfectly:
You really need to set some time aside with ion3 to work out the config files and work out how you want to set it up and explore the features, cause there's a helluva lot - more than I even use.
WMII is all about wasting as little of your time as possible. It does this by doing as little as possible. Ideally it should do nothing. Or at least, it should feel this way. You shouldn't even notice wmii because it acts in a predictable manner whatever you do(this is currently not the case, but I think it's going in the right direction). There aren't any 'killer features', just useful ones. So if you try wmii and are underwhelmed, don't worry; you should be.
Offline
(wonder why the mplayer window is black like that : )
It does that with the default video driver (x11 ?). You need to use another one. I think it works with xv.
Offline