Re: [dev] [wmii] Flash in fullscreen regularly freezes screen
On Sat, Aug 06, 2011 at 12:42:15PM +0100, Rob wrote: On 6 August 2011 12:15, Kris Maglione wrote: http://hg.suckless.org/vp is. Last updated: 19 hours ago Just about :P Well, YouTube only broke things again yesterday. -- Kris Maglione It's all right to tell a man to lift himself by his own bootstraps, but it is a cruel jest to say to a bootless man that he ought to lift himself by his own bootstraps. --Martin Luther King, Jr.
Re: [dev] [wmii] Flash in fullscreen regularly freezes screen
On Sat, Aug 06, 2011 at 11:09:26AM +0100, Ethan Grammatikidis wrote: On Sat, 6 Aug 2011 09:19:24 +0100 Rob wrote: On 5 August 2011 17:39, Kris Maglione wrote: > On Fri, Aug 05, 2011 at 09:31:40AM -0700, Suraj Kurapati wrote: >> # see http://www.reddit.com/r/linux/comments/dky73/ >> lsof -p $(pgrep -f libflashplayer) | grep /tmp/Flash | >> awk '{print "/proc/" $2 "/fd/" $4}' | sed 's/[rwu]$//' | >> xargs mplayer -fs > > That's only the case for HTTP streams. RTMP streams are never written to > disk. And there are quite a lot of cases where it automatically unlinks the > files, in any case. Even then, you still need to let the non-fullscreen > player buffer the things, which kind of defeats the point. Somewhat off topic now, but http://repo.hu/projects/yget/ works fine for me Shell script and an order of magnitude smaller than youtube-dl which I've been using, nice! Is it updated quickly when youtube changes? http://hg.suckless.org/vp is. -- Kris Maglione I can hardly see how anyone ought to wish Christianity to be true; for if so the plain language of the text seems to show that the men who do not believe, and this would include my Father, Brother, and almost all my best friends, will be everlastingly punished. And this is a damnable doctrine. --Charles Darwin
Re: [dev] [wmii] Flash in fullscreen regularly freezes screen
On Fri, Aug 05, 2011 at 09:26:11PM +0100, Ethan Grammatikidis wrote: On Fri, 5 Aug 2011 12:35:35 -0400 Kris Maglione wrote: On Fri, Aug 05, 2011 at 03:24:36PM +0100, Ethan Grammatikidis wrote: >On Fri, 5 Aug 2011 14:39:23 +0200 >Eckehard Berns wrote: > >> I also have encountered freezes with fullscreen flash video playback (I >> haven't tested something other than youtube). I noticed that I didn't >> encounter those freezes when using compositing. Thus I simply added a >> "xcompmgr &" to my .xinitrc. I don't know if it helps with other setups. >> I thought this problem was kinda unique to my setup. > >Thanks for the tip! I just tried it and it's a fine now, on my machine >with the 945GME. (My other machine doesn't have Linux installed as of >last night.) > >Aint progress wonderful, eh? You'll always need more, just to stay in >the same place. No wonder nature has forest fires and other disasters. For what it's worth, I've never had compositing enabled and still no problem. %uname -a Linux kris 2.6.38-bfs #1 SMP PREEMPT Thu Apr 14 22:31:00 EDT 2011 x86_64 AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 AuthenticAMD GNU/Linux What graphics chipset? 00:12.0 VGA compatible controller: nVidia Corporation C67 [GeForce 7000M / nForce 610M] (rev a2) (prog-if 00 [VGA controller]) Commercial drivers version 270.41.19-1 -- Kris Maglione Real misanthropes are not found in solitude, but in the world; since it is experience of life, and not philosophy, which produces real hatred of mankind. --Giacomo Leopardi
Re: [dev] [wmii] Flash in fullscreen regularly freezes screen
On Fri, Aug 05, 2011 at 09:31:40AM -0700, Suraj Kurapati wrote: On Fri 05 Aug 2011 03:50:51 PM PDT, Daniel Kowalski wrote: I usually download videos as MP4 files using 'MP4 Downloader' addon for firebloat and play them offline. Adobe's flash player caches video streams in memory (and in the past: on disk), so you can play them directly from that cache: # see http://www.reddit.com/r/linux/comments/dky73/ lsof -p $(pgrep -f libflashplayer) | grep /tmp/Flash | awk '{print "/proc/" $2 "/fd/" $4}' | sed 's/[rwu]$//' | xargs mplayer -fs That's only the case for HTTP streams. RTMP streams are never written to disk. And there are quite a lot of cases where it automatically unlinks the files, in any case. Even then, you still need to let the non-fullscreen player buffer the things, which kind of defeats the point. -- Kris Maglione It is what you read when you don't have to that determines what you will be when you can't help it. --Oscar Wilde
Re: [dev] [wmii] Flash in fullscreen regularly freezes screen
On Fri, Aug 05, 2011 at 03:24:36PM +0100, Ethan Grammatikidis wrote: On Fri, 5 Aug 2011 14:39:23 +0200 Eckehard Berns wrote: I also have encountered freezes with fullscreen flash video playback (I haven't tested something other than youtube). I noticed that I didn't encounter those freezes when using compositing. Thus I simply added a "xcompmgr &" to my .xinitrc. I don't know if it helps with other setups. I thought this problem was kinda unique to my setup. Thanks for the tip! I just tried it and it's a fine now, on my machine with the 945GME. (My other machine doesn't have Linux installed as of last night.) Aint progress wonderful, eh? You'll always need more, just to stay in the same place. No wonder nature has forest fires and other disasters. For what it's worth, I've never had compositing enabled and still no problem. %uname -a Linux kris 2.6.38-bfs #1 SMP PREEMPT Thu Apr 14 22:31:00 EDT 2011 x86_64 AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 AuthenticAMD GNU/Linux -- Kris Maglione The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures. --Frederick P. Brooks, Jr.
Re: [dev] [wmii] Flash in fullscreen regularly freezes screen
On Fri, Aug 05, 2011 at 12:37:52AM +0200, dtk wrote: putting the flash player on a website into fullscreen regularly (very -.-) freezes my screen. wmii seems to continue to work in the background (I can change tags, kill the browser, ...) and the mouse continues to respond (I can click to pause the vid (sound oftentimes continues to play back) and 'defocus' the player so it doesn't catch key presses anymore) but I can't get a new image to be drawn. Neither reload'ing nor clear'ing wmii via mod+a works. All I can do to fix it so far is to restart GDM. This is not by any chance a known problem? I am running tip [wmii-hg2788+] and rumai. I can reproduce the problem on another machine (running pretty much the same config). I've never had that problem. Granted, I avoid using flash video as much as possible, but I use it often enough that I would have noticed if this were a regular problem. -- Kris Maglione The sorrow which has no vent in tears may make other organs weep. --Henry Maudsley
Re: [dev] Cleanup of (hg.)suckless.org - wmii & libixp mirror
On Tue, Jun 21, 2011 at 12:00:06PM -0700, Suraj Kurapati wrote: On Tue 21 Jun 2011 09:54:15 AM PDT, Nick wrote: given that you're disowning wmii, and are skeptical of libixp. I have mirrored wmii and libixp source repositories on GitHub: https://github.com/sunaku/wmii https://github.com/sunaku/libixp There's no need. They've been available on Google Code for some years now: http://wmii.googlecode.com/ http://libixp.googlecode.com/ -- Kris Maglione Sufficiently advanced incompetence is indistinguishable from malice.
Re: [dev] wmii floating window titlebar decoration
On Mon, May 30, 2011 at 12:15:52PM -0500, orlando wrote: I've recently started using wmii and I'm really liking it so far. The one thing that is bugging me is this rectangle shown in the right side of the titlebar (when in floating mode). How can I make it disappear? I've looked into the guide and styling part section, but nothing. I've looked at a couple of screenshots from people using wmii and some of them don't have that type of decoration in the titlebar. I'm not very familiar with older versions of wmii so could this be a feature implemented in the newest versions? If so, any clues on how to make it go away? It's not possible to remove it, nor has anyone asked for it to be removeable before. I don't see a reason for it to be possible, either, since it would add complexity for no useful end. Yes, it is a feature of recent versions. For a long time, the most requested feature was to make floating windows more distinguishable from managed windows. That's why it was added. -- Kris Maglione Programming X Windows is like trying to find the square root of Pi using roman numerals. --Henry Spencer
Re: [dev] Re: [PATCH] wmii - client mapping events
On Sun, Apr 03, 2011 at 12:15:08PM -0700, Suraj Kurapati wrote: On Sun, Apr 3, 2011 at 7:38 AM, Kris Maglione wrote: I like this idea, but I don't like that it only applies to the selected view. I'll add an attach event that includes the client and the view. Sure, emitting an event like that should be sufficient for my needs: event("ArrangeView %s %#C\n", f->view->name, f->client); I need this to know when to reapply an automated arrangement (like LarsWM style tiling) whenever the managed layer changes in the current view in my wmiirc, for example: event "ArrangeView" do |tag, client_id| apply_larswm_arrangement if tag == curr_tag end I'm not sure I see the point of the map and unmap events. The map/unmap events are not necessary; they are vestiges from my first try of the patch. Thanks for your consideration. Changeset 2786:f93fd217b7fb -- Kris Maglione Do not fear to be eccentric in opinion, for every opinion now accepted was once eccentric. --Bertrand Russell
Re: [dev] Re: [PATCH] wmii - client mapping events
On Mon, Mar 28, 2011 at 03:53:26PM -0700, Suraj Kurapati wrote: On Sun, Mar 27, 2011 at 1:04 AM, Suraj Kurapati wrote: The following patch against wmii-hg r2785 allows my wmiirc to know when clients are added to or removed from the current view. Here is an updated patch that renames the events to ClientAttach and ClientDetach and, more importantly, fires those events only when the current view is actually changed. No need for special logic to detect valid boundaries of MapClient and UnmapClient events. Cheers. I like this idea, but I don't like that it only applies to the selected view. I'll add an attach event that includes the client and the view. I'm not sure I see the point of the map and unmap events. -- Kris Maglione There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. --C.A.R. Hoare
Re: [dev] [PATCH] wmii hg - witray in normcolors
On Thu, Mar 24, 2011 at 04:27:29PM -0700, Suraj Kurapati wrote: Hello, I became tired of seeing witray render itself in selcolors (by default) and changed it to use normcolors as shown below. That's one less distraction and more productivity for me. Hm. I have to admit that I think I chose selcolors because that's the color of my clock panel to the far right of my bar. It may have something to do with the fact that hardly any of the bar is visible for me, but I don't see how changing the colors would make it more or less distracting... although you do tend towards a blue and black color scheme, don't you? -- Kris Maglione Lovers of problem solving, they are apt to play chess at lunch or doodle in algebra over cocktails, speak an esoteric language that some suspect is just their way of mystifying outsiders. Deeply concerned about logic and sensitive to its breakdown in everyday life, they often annoy friends by asking them to rephrase their questions more logically. --Time Magazine in 1965
Re: [dev] [wmii] Chromium always starts as a floating window
On Fri, Mar 18, 2011 at 01:12:04AM +0200, Le Tian wrote: its quite simple, 1. start chromium 2. goto preferences 3. goto personal stuff 4. in appearance choose use GTK-theme or "use system title bar and borders". 5. thats it that will make chromium start with system borders that are managed by wmii, so browser will not start in a floating window. Ah, I knew there was a reason it didn't try to start floating for me. -- Kris Maglione Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. --Rich Cook
Re: [dev] [wmii] Chromium always starts as a floating window
On Thu, Mar 17, 2011 at 05:39:03PM -0400, Aaron Lindsay wrote: Hi all, I'm using wmii under Arch, and have found that whenever I start Chromium (version 10.0.648.133) (whether by Mod-p or by command line) it is spawned as a floating window in wmii. I have installed both the default from the Arch package repository as well as the latest version from mercurial, and double- and triple-checked that none of my tag rules could be setting it to be a floating window. Every other application starts normally as a stacked window. I cannot find a way to explicitly set a window as non-floating via tag rules (i.e., the inverse of ~). I assume this is by design because windows should start as non-floating by default. Has anyone else encountered this problem, or have any insight into it? I suspect that on 3.9, you'd want: /^chrom/ -> -~ In tip, it'd be: /^chrom/ floating=off -- Kris Maglione Good judgement comes from experience, and experience comes from bad judgement. --Fred Brooks
Re: [dev] [wmii] likely memory leak
On Fri, Feb 18, 2011 at 09:15:14PM +0300, Roman Belov wrote: I use wmii-3.9.2-r1 (gentoo ebuild) on my workstation. Today I looked at memory usage and saw that wmii had been occupying all memory and swap. Uptime was about three month. I am trying to reproduce this issue at home with wmii- (hg, cloned today). Seems the devel version has this issue too. Ok, I looked into this and it turns out that it wasn't a leak. Certain structures used in the filesystem are allocated from a free list because they're used in huge numbers. However, in one particular place, a structure was allocated directly rather than taken from the free list, and was re-added to the free list later, and thus the free list grew without bound by one structure for each filesystem walk. It should be fixed by revision 141:339db5c6d2c9 in the libixp repo. -- Kris Maglione Lisp doesn't look any deader than usual to me. --David Thornley
Re: [dev] [wmii] likely memory leak
On Fri, Feb 18, 2011 at 09:15:14PM +0300, Roman Belov wrote: I use wmii-3.9.2-r1 (gentoo ebuild) on my workstation. Today I looked at memory usage and saw that wmii had been occupying all memory and swap. Uptime was about three month. I am trying to reproduce this issue at home with wmii- (hg, cloned today). Seems the devel version has this issue too. Take a look. $ ps axu | grep wmii$ amaora3045 0.2 0.4 6228 2480 tty1 S19:37 0:00 wmii After a couple hours. $ ps axu | grep wmii$ amaora3045 0.1 0.7 7404 3620 tty1 S19:37 0:07 wmii I did not find any non-outdated mentions about such issue. Strangely, does anyone observe this issue? That's interesting. I hadn't noticed it before, but wmii's resident size is up to 15MB for me. I'll look into it. -- Kris Maglione Oh, come *on*. Revelation was a mushroom dream that belonged in the Apocrypha. The New Testament is basically about what happened when God got religion. --Terry Pratchett, alt.fan.pratchett
Re: [dev] [wmii] wedged indication does not go away
On Mon, Feb 14, 2011 at 12:41:14PM +0100, Thomas Dahms wrote: As for the flag not going away, when does it happen? It did not occur since then. You can consider it a very minor issue. Please fix the more annoying ones first if you find the time. I am thinking of issue 201 and of course the infamous issue 22. ;) Well, colrules are in for a revamp, possibly sometime this month. As for #22, to be honest, it's never bothered me. I wasn't aware that it was "infamous". There's a known bug where the wedged indication appears for all clients, due to the timer that pings the clients dieing, but it happens so rarely that I always forget to fix it. I had some emacs, evince, and xterm clients. Only the xterms were not indicated as wedged. Ah, that makes sense. xterms don't advertise that they respond to pings, so they would never show the wedged indication. This is indeed the same bug. -- Kris Maglione I had a running compiler and nobody would touch it. They told me computers could only do arithmetic. --Rear Admiral Grace Hopper
Re: [dev] [wmii] wedged indication does not go away
On Mon, Feb 07, 2011 at 01:25:53PM +0100, Thomas Dahms wrote: Hi, some of my windows (namely Emacs and Evince) are suddenly marked "(wedged)". There was no obvious reason, the clients were responsive all the time. I would not bother, but the indications do not go away. New Emacs client windows from the same server instance do not have the indication. I don't really understand what is done here (changeset 2697:fe8a99d89597). If these clients were really unresponsive, shouldn't this trigger the Unresponsive event in wmiirc and thus bring up an xmessage? The Unresponsive event only happens when you try to manually delete the client. As for the flag not going away, when does it happen? There's a known bug where the wedged indication appears for all clients, due to the timer that pings the clients dieing, but it happens so rarely that I always forget to fix it. If it only happens for a select few clients which aren't actually unresponsive then it's hard to say and the most likely explanation is that they advertise that they'll respond to pings but for some reason don't. However, I don't think I've seen this happen. -- Kris Maglione When in doubt, use brute force. --Ken Thompson
Re: [dev] libixp-hg and gnu make 3.82 build failed
Same here. No such problem. On Mon, Feb 07, 2011 at 12:20:01PM +0300, LionMV wrote: libixp freshly checked out from mercurial and gmake 3.82 07.02.2011, 12:17, "Kris Maglione" : I don't get that. Have you edited your config.mk, and what version of gmake are you using? -- Kris Maglione It’s not that I’m so smart, it’s just that I stay with problems longer. --Albert Einstein
Re: [dev] libixp-hg and gnu make 3.82 build failed
I don't get that. Have you edited your config.mk, and what version of gmake are you using? On Mon, Feb 07, 2011 at 11:51:46AM +0300, LionMV wrote: Thanks for quick reply and fix, but: config.mk:21: *** missing separator. Stop. :) 06.02.2011, 07:04, "Kris Maglione" : On Sun, Feb 06, 2011 at 06:47:19AM +0300, lionmv wrote: Building of libixp, pulled from hg failed with gnu make. mk/hdr.mk:48 *** missing separator. Stop. BINSH := $(shell \ if [ -x /bin/dash ]; then echo /bin/dash; \ elif [ -x /bin/ksh ]; then echo /bin/ksh; \ else echo /bin/sh; fi) BINSH != echo /bin/sh #<= line48 Sorry about that. I fixed that in the wmii repo ages ago, but I never noticed it myself in the libixp repo because I use BSD make. It's fixed. -- Kris Maglione Microsoft is not the answer. Microsoft is the question. NO is the answer. --Eric Naggum -- Kris Maglione I can hardly see how anyone ought to wish Christianity to be true; for if so the plain language of the text seems to show that the men who do not believe, and this would include my Father, Brother, and almost all my best friends, will be everlastingly punished. And this is a damnable doctrine. --Charles Darwin
Re: [dev] libixp-hg and gnu make 3.82 build failed
On Sun, Feb 06, 2011 at 06:47:19AM +0300, lionmv wrote: Building of libixp, pulled from hg failed with gnu make. mk/hdr.mk:48 *** missing separator. Stop. BINSH := $(shell \ if [ -x /bin/dash ]; then echo /bin/dash; \ elif [ -x /bin/ksh ]; then echo /bin/ksh; \ else echo /bin/sh; fi) BINSH != echo /bin/sh #<= line48 Sorry about that. I fixed that in the wmii repo ages ago, but I never noticed it myself in the libixp repo because I use BSD make. It's fixed. -- Kris Maglione Microsoft is not the answer. Microsoft is the question. NO is the answer. --Eric Naggum
Re: [dev] wmii put computer to sleep/suspend
On Thu, Jan 20, 2011 at 10:23:34AM -0500, Eitan Goldshtrom wrote: Is there a way to put your computer to sleep/suspend it in wmii? I've been 'quit'ing and suspending from the Ubuntu login screen but it would be nice to be able to keep all my apps and such open. Even just being able to switch users instead of logging off. I use uswsusp's s2ram. -- Kris Maglione First, solve the problem. Then, write the code. --John Johnson
Re: [dev] wmii unicode in the status? [SOLVED]
Re wmii on Ubuntu: https://launchpad.net/~maglione-k/+archive/ppa On Mon, Jan 24, 2011 at 08:07:50AM -0500, Eitan Goldshtrom wrote: I've been told that Ubuntu might not be the best choice for running wmii. I really only did it because at the time, and still really, I was only familiar with Ubuntu and didn't/don't have the time to familiarize myself with how to get around another linux distro -- I'm a thesising college student. But once I'm done with school I fully plan on moving to another distro, not just because of wmii *caugh*ubuntu sucks*caugh*. Lucky for me right now, however, the new build works perfectly. However Ubuntu does things seems to have made it so the upgrade build took hold automatically. So I'm good to go. Thanks everyone for the help. -Eitan -- Kris Maglione Technology is dominated by two types of people: Those who understand what they do not manage. Those who manage what they do not understand. --Putt's Law
Re: [dev] wmii unicode in the status?
On Sun, Jan 23, 2011 at 06:43:01PM -0500, Eitan Goldshtrom wrote: Isn't xft what I want for proper unicode support? I'm building 3.9.2 Yes, but as I said, it's loaded on demand in the hg version and no development headers are required during the build. Having the libxft2 package at runtime should be sufficient. -- Kris Maglione Question with boldness even the existence of God; because if there be one, He must approve the homage of Reason rather than that of blindfolded Fear. --Thomas Jefferson
Re: [dev] wmii unicode in the status?
On Sun, Jan 23, 2011 at 05:27:52PM -0500, Eitan Goldshtrom wrote: I appreciate the tip. I downloaded the latest source, but I'm having a problem building. Make says it can't find the xft package, and I'm not sure where to get it because I have libxft2. What version are you trying to build? I recommend building from hg. It doesn't require libxft-dev. Or xft at all for that matter (it's loaded only on request). -- Kris Maglione If C gives you enough rope to hang yourself, C++ gives you enough rope to bind and gag your neighbourhood, rig the sails in a small ship and still have enough rope left to hang yourself from the yardarm. --Anonymous
Re: [dev] wmii unicode in the status?
On Sun, Jan 23, 2011 at 10:40:20AM -0500, Eitan Goldshtrom wrote: Forgot to say that I don't know about anything else. Everything for wmii is at it's defaults. I'm using wmii-3.5 You really shouldn't be using wmii 3.5. It's ancient. Your best bet if you want unicode, sadly, is to use a version that supports xft and then choose a font like xft:terminus or xft:fixed. Failing that, just using a font like terminus with standard X font sets should probably get you half decent coverage. That said, I chose the current default font, '-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*', because it seems to have the most reliable support under standard X font rendering. -- Kris Maglione Real Programmers don't believe in schedules. Planners make up schedules. Managers "firm up" schedules. Frightened coders strive to meet schedules. Real Programmers ignore schedules.
Re: [dev] [bug] wmii segfaults on sudo wireshark
On Sun, Jan 23, 2011 at 05:26:30PM +0100, dtk wrote: On 01/14/2011 04:52 PM, Kris Maglione wrote: On Fri, Jan 14, 2011 at 04:13:34PM +0100, dtk wrote: Running wireshark as my default non-priviledged user works fine, as does running wireshark as root under awesome/gnome. The wireshark splash displays nicely, showing the modules being loaded, and I can glance the error dialog stating that some lua functionality has been disabled, due to being run as root, before wmii crashes, gdm reloads and prompts me with the user selection to log me in again. Can anybody confirm this behaviour? No. Can you perchance provide a backtrace? Actually, I don't know how to (besides compiling from source), since the binary from the ubuntu package doesn't contain debug symbols :/ Yes, compiling from source is the thing to do. I believe you can do something like: DEB_BUILD_OPTIONS="nostrip" make deb -- Kris Maglione The programmer, who needs clarity, who must talk all day to a machine that demands declarations, hunkers down into a low-grade annoyance. It is here that the stereotype of the programmer, sitting in a dim room, growling from behind Coke cans, has its origins. The disorder of the desk, the floor; the yellow Post-It notes everywhere; the whiteboards covered with scrawl: all this is the outward manifestation of the messiness of human thought. The messiness cannot go into the program; it piles up around the programmer. --Ellen Ullman
Re: [dev] wmii freezes momentarily and regularly
On Tue, Jan 18, 2011 at 09:36:14PM -0500, Eitan Goldshtrom wrote: I'm using wmii with Ubuntu and everything was fine at first. I wanted to get wireless working so I installed Wicd. Now every few seconds the whole thing freezes up for a few seconds. I can move the mouse and access Mod-a in order to 'quit', and I haven't tested what else I can do, but the open windows are non-responsive to keyboard and mouse alike, though sometimes after it unfreezes the windows respond to all of the events I triggered while they were frozen. Is it just wmii that freezes or is it everything? Does it happen with other window managers? I don't think this is related to wmii at all. As it happens I use wicd and I don't have any such issues. -- Kris Maglione Lisp has jokingly been called "the most intelligent way to misuse a computer". I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts. --Edsger W. Dijkstra, CACM, 15:10
Re: [dev] wmii: Chrome does not open in a wmii managed window for some reason.
On Tue, Jan 18, 2011 at 07:42:05PM -0600, Matt Young wrote: I am using wmii 3.9.2, with whatever version of chrome is the current stable version (got it from the website) on Ubuntu 10.10 uname -a: Linux mattosaurus 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux My best guess is that the new version tries to open sans window decorations, which makes it automatically float. You can fix it in /rules (You'll need a hg version for that. Sorry) with something like: /^google-chrome:/ floating=off -- Kris Maglione “Did God have a mother?” Children, when told that God made the heavens and the earth, innocently ask whether God had a mother. This deceptively simple question has stumped the elders of the church and embarrassed the finest theologians, precipitating some of the thorniest theological debates over the centuries. All the great religions have elaborate mythologies surrounding the divine act of Creation, but none of them adequately confronts the logical paradoxes inherent in the question that even children ask. --Michio Kaku
Re: [dev] write to 9p mount problem
On Sat, Jan 15, 2011 at 08:10:46PM +0100, Michal Hajek wrote: Hi, I have mounted wmii dir using 9p on gentoo machine, so mount shows: /tmp/ns.michal.:0/wmii on /mnt/wmii type 9p (rw,trans=unix,uname=root,noextend,dfltgid=0,dfltuid=0) and I can see the mount: # ls -la /mnt/wmii total 2 dr-x-- 1 root root 0 Jan 15 20:04 client -rw--- 1 root root 48 Jan 15 20:04 colrules -rw--- 1 root root 0 Jan 15 20:04 ctl -rw--- 1 root root 0 Jan 15 20:04 event -rw--- 1 root root 441 Jan 15 20:04 keys drwx-- 1 root root 0 Jan 15 20:04 lbar drwx-- 1 root root 0 Jan 15 20:04 rbar dr-x-- 1 root root 0 Jan 15 20:04 tag -rw--- 1 root root 19 Jan 15 20:04 tagrules or # cat /mnt/wmii/ctl bar on bottom border 1 colmode stack focuscolors #00 #81654f #00 font -*-fixed-medium-r-*-*-13-*-*-*-*-*-*-* fontpad 0 0 0 0 grabmod Mod1 incmode squeeze normcolors #00 #c1c48b #81654f view 3 However, when I want to write to ctl to change something, I cannot. For example if I do # cat test > /mnt/wmii/ctl bash: /mnt/wmii/ctl: Unknown error 526 And dmesg shows: p9_errstr2errno: server reported unknown error function not implemented So how I am supposed to work with 9p mounts? Did I do something wrong? Use >> rather than >. The virtual files don't support truncation, which > tries to do. -- Kris Maglione I have always found that plans are useless, but planning is indispensable. --Dwight Eisenhower
Re: [dev] [bug] wmii segfaults on sudo wireshark
On Fri, Jan 14, 2011 at 04:13:34PM +0100, dtk wrote: Running wireshark as my default non-priviledged user works fine, as does running wireshark as root under awesome/gnome. The wireshark splash displays nicely, showing the modules being loaded, and I can glance the error dialog stating that some lua functionality has been disabled, due to being run as root, before wmii crashes, gdm reloads and prompts me with the user selection to log me in again. Can anybody confirm this behaviour? No. Can you perchance provide a backtrace? Thanks, -- Kris Maglione If the lessons of history teach us anything it is that nobody learns the lessons that history teaches us.
Re: [dev] Re: [wmii] Is it possible *not* to select a category of spawned clients?
On Mon, Dec 20, 2010 at 07:04:21PM +0100, Christophe-Marie Duquesne wrote: I now realize I made this mail a bit too long about awesome and not long enough about wmii. tl;dr, I just do want uzbl clients not to automatically go in /client/sel Looking at http://www.uzbl.org/wiki/wmii, it seems that Dieter has the same problem as me. Did you fix that? No-one's asked for this before, so it hasn't been implimented, but it's certainly doable. -- Kris Maglione I just hate to be pushed around by some fucking machine. --Ken Thompson
Re: [dev] Problem starting wmii with fresh ruby github wmiirc
On Fri, Nov 12, 2010 at 11:31:27AM -0500, Armando Di Cianno wrote: I have a fresh Ubuntu 10.10 install, and compiled and installed the tarball of wmii 3.9.2 via 'make deb' and dpkg. When using the default sh wmiirc, I have to manually set WMII_CONFPATH to ~/.wmii, or it tries writing to "/.wmii/foo". I set this in my ~/.bashrc, which does make it into my environment I followed sunaku's directions on the github wmiirc ruby page. I've used wmii on gentoo before, but wanted to get a setup going on Ubuntu before I started before modding stuff. However, while the window manager is running and managing windows, I don't get the menu. I've installed 'suckless-tools' package as well, in case it was trying to use dmenu. I thought that (for the same reason as WMII_CONFPATH) I might have to define WMII_NAMESPACE explicitly, but that doesn't seem to help. So ... help! Ideas? I can't say for certain, but I believe that the version of Suraj's wmiirc on github is currently compatible with wmii-hg rather than the 3.9 release. -- Kris Maglione Good judgement comes from experience, and experience comes from bad judgement. --Fred Brooks
Re: [dev] [wmii] Changing view, but not launching programs in the new view
On Sun, Oct 31, 2010 at 12:14:38AM -0200, zweifel wrote: Thanks I'll take a look at it! Do you think that using bash script as I did might cause problems (incompatibilities) in future versions? Probably not more than the version that I posted, but yours only works with numbered tags, whereas the one I provided works with any tags currently in existence. Yup, I narrowed down the problem to the "gnome-terminal", everything else works great. Do you know how can I fix it? Probably by putting something like the following in /tagrules, though I'm not certain that it works in 3.9: /gnome-terminal/ -> sel -- Kris Maglione Programming X Windows is like trying to find the square root of Pi using roman numerals. --Henry Spencer
Re: [dev] python configuration
On Sun, Oct 31, 2010 at 12:01:22PM +0100, Renato wrote: Hello, just installed wmii from the Archlinux repos and still finding my way around it... I need some clarification on configuring wmii. I'd like to configure it using python. What are my options? Can I just copy the /etc/wmii/python directory to ~/.wmii and start wmii with $ wmii -r ~/.wmii/python/wmiirc.py ? There should be no need to copy anything. Just run wmii -r python/wmiirc You can put your configuration in ~/.wmii/wmiirc_local.py, or otherwise copy /etc/wmii/python/wmiirc.py to ~/.wmii/wmiirc.py and modify it, if you prefer (though I don't recommend it). What's the difference between using the python files in /etc/wmii/python and installing pywmii? I have no idea what pywmii is. -- Kris Maglione I think conventional languages are for the birds. They're just extensions of the von Neumann computer, and they keep our noses in the dirt of dealing with individual words and computing addresses, and doing all kinds of silly things like that, things that we've picked up from programming for computers; we've built them into programming languages; we've built them into Fortran; we've built them in PL/1; we've built them into almost every language. --John Backus
Re: [dev] [wmii] Changing view, but not launching programs in the new view
On Sat, Oct 30, 2010 at 11:20:16PM -0200, zweifel wrote: I managed to pass almost all my configuration to the new wmii 3.9's wmiirc, though the following lines continue not to work: Key $MODKEY-$RIGHT i=`wmiir read /ctl| grep view | cut -d ' ' -f 2` i=$(($i+1)) wmiir xwrite /ctl view "$i" Key $MODKEY-$LEFT i=`wmiir read /ctl| grep view | cut -d ' ' -f 2` i=$(($i-1)) wmiir xwrite /ctl view "$i" You'd probably be better off with the code from the stock rc: Key $MODKEY-$RIGHT # Move to the next tag wmiir xwrite /ctl view $(wi_tags | wi_nexttag) Key $MODKEY-$LEFT # Move to the previous tag wmiir xwrite /ctl view $(wi_tags | sort -r | wi_nexttag) A slightly modified version worked on previous versions. Now I can only change the views, but when I try to execute a terminal or other things, they still appear on the other view. Any ideas on how to make it work? It's probably because of something you have in tagrules, or, failing that, you're using a terminal that for some reason marks all of its new windows as belonging to the same group. -- Kris Maglione Make everything as simple as possible, but not simpler. --Albert Einstein
Re: [dev] [wmii] grow command does not work on floating mplayer
On Thu, Oct 28, 2010 at 02:14:06PM +0200, Thomas Dean wrote: mplayer windows keeps a fixed aspect ratio when floating. Growing such windows via wmiir does not seem to work, because one can only grow either horizontally or vertically, but not both at the same time. (Shrinking works, the other direction gets shrunk accordingly.) Is there any way to still grow floating mplayer windows without the mouse? Fixed in tip. -- Kris Maglione A program is portable to the extent that it can be easily moved to a new computing environment with much less effort than would be required to write it afresh. --W. Stan Brown
Re: [dev] [wmii] grow command does not work on floating mplayer
On Thu, Oct 28, 2010 at 02:14:06PM +0200, Thomas Dean wrote: mplayer windows keeps a fixed aspect ratio when floating. Growing such windows via wmiir does not seem to work, because one can only grow either horizontally or vertically, but not both at the same time. (Shrinking works, the other direction gets shrunk accordingly.) Is there any way to still grow floating mplayer windows without the mouse? That's an interesting problem. The aspect ratio algorithm always fits the window to the largest size possible in the given rectangle, which works fine for the mouse, but is clearly problematic with the keyboard. I guess I'll have take the aspect ratio hint into account for keyboard resizes. -- Kris Maglione ...the designer of a new system must not only be the implementor and the first large-scale user; the designer should also write the first user manual. ... If I had not participated fully in all these activities, literally hundreds of improvements would never have been made, because I would never have thought of them or perceived why they were important. --Donald Knuth
Re: [dev] [wmii] sh wmiirc broken and Arch Python changes
On Wed, Oct 13, 2010 at 08:49:08PM +0200, Thomas Dahms wrote: after updating to tip today, I get the error eval: 399: Syntax error: end of file unexpected (expecting ")") I am not sure, but maybe this is introduced by changeset 2782:3a645190bda8 which changed wmii.sh. Unfortunately I don't quite understand the point of this change, so can't help more. And something unrelated: In Arch Linux, python is now Python 3. Using python2 with wmii is not smooth: It builds when changing the supplied PKGBUILD to depend on python2 and using the PYTHON=python2 flag, but /etc/wmii-hg/python/wmiirc still uses "#!/usr/bin/env python". Should be fixed in 2784:9466b4993b71. -- Kris Maglione Good judgement comes from experience, and experience comes from bad judgement. --Fred Brooks
Re: [dev] [wmii] sh wmiirc broken and Arch Python changes
On Wed, Oct 13, 2010 at 08:49:08PM +0200, Thomas Dahms wrote: after updating to tip today, I get the error eval: 399: Syntax error: end of file unexpected (expecting ")") I am not sure, but maybe this is introduced by changeset 2782:3a645190bda8 which changed wmii.sh. Unfortunately I don't quite understand the point of this change, so can't help more. Sorry, it looks like my patch queue got corrupted. I'll have it fixed once I've had some coffee. As for the point of the change, it's basically so that wmiirc.local can be written something like this, wi_events < # ... wi_events < Event bar ... ! rather than, local_events() { cat < And something unrelated: In Arch Linux, python is now Python 3. Using python2 with wmii is not smooth: Oh. I haven't done a full upgrade in a while. That's a change I certainly didn't expect any time soon. It builds when changing the supplied PKGBUILD to depend on python2 and using the PYTHON=python2 flag, but /etc/wmii-hg/python/wmiirc still uses "#!/usr/bin/env python". Thanks. Easy fix. -- Kris Maglione Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin. --John von Neumann
Re: [dev] wmii recommended release
On Mon, Oct 11, 2010 at 10:21:38PM +0100, Michael wrote: Hello, What is the latest recommended (stable) version of wmii? Website says 3.9.2 but I see 3.9.4 in download section. Should I bother updating? No, the 3.9 minor releases were all minor fixes for system-specific bugs. If 3.9.2 works, then there's no reason to update. -- Kris Maglione It is a farce to call any being virtuous whose virtues do not result from the exercise of its own reason. --Mary Wollstonecraft
Re: [dev] debugging wmii
On Thu, Oct 07, 2010 at 11:00:28AM -0400, Vladimir Levin wrote: Hi, I'm running the latest hg of wmii, and it seems that once in a while it's causing X to crash on me (mostly during resizing in the floating layer). This also happened to me when I was using the latest stable release. The question I have is how would I go about debugging this problem (since it might be caused by some of changes that I made, or could be just my general setup)... Is there some sort of a guide to this? Some flags I could enable, or logs to go through? Or should I just look up debugging X? Well, generally the easiest way is to read the virtual files under /debug. You can also enable console debugging output with the -D flag (or the debug property of /ctl), i.e., wmii -D event+ewmh. Is there a crash or a stack dump? Also, I don't suppose you're starting wmii in a way that X quits when it does? -- Kris Maglione The tragedy of modern war is not so much that young men die but that they die fighting each other, instead of their real enemies back home in the capitals. --Edward Abbey
Re: [dev] Wmii - wmiirc from 3.5 not working on 3.9
On Fri, Sep 24, 2010 at 04:30:46PM -0300, zweifel wrote: Hi guys, As the title says, I had an old wmiirc with some nice features which is currently not working on the 3.9.2 version. I searched for some way of importing this wmiirc or maybe a changelog with some information on how to proceed. But did not find anything. If someone can help me, it would be really nice (and then I can stop using wmaker in this computer :) ) . I am attaching the wmiirc itself. I think you might be better off just migrating your customizations to the stock wmiirc. It would be a lot easier. At any rate, I think your main problem is that wmiiloop has been replaced by a function in wmii.sh. In fact, if you cut out the customization that are important to you, I'll format them as a wmiirc_local file for you. -- Kris Maglione Get and set methods are evil. --Allen Holub
Re: [dev] [OT] Music?
On Wed, Sep 22, 2010 at 12:41:01AM +, hiro wrote: did you consider using webfs? No, and I'll give you my reasons, 1) It's been several years since I last ported webfs to plan9port, and I wasn't in the mood to do it again. 2) webfs needs a client, and I'd have had to write one. I'd rather have used hget, but webcookies isn't ported, and even if it were, plan9port's hget isn't modified to access it the p9p way. 3) Even if webcookies were ported, YouTube requires a player that can read the cookies from a previous web access, and none of them support mplayer. It would require an external process to prefetch for every play (or a real OS mount of the filesystem, and opening the data stream file with the player), which means no live seeking. -- Kris Maglione The computing scientist's main challenge is not to get confused by the complexities of his own making. --Edsger W. Dijkstra
Re: [dev] [OT] Music?
On Tue, Sep 21, 2010 at 10:01:10AM +, Bjartur Thorlacius wrote: On 9/21/10, Ammar James wrote: I feel compelled to reply to this since none of you fools seem to listen to hip-hop. ;p [bunch of good artists] http://www.youtube.com/watch?v=JQRRnAhmB58 http://www.youtube.com/watch?v=IcY0a8gKCzc Ugh, YouTube links on d...@suckless.org? See http://hg.suckless.org/vp -- Kris Maglione He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would suffice. --Albert Einstein
Re: [dev] wmii display size issue
On Sat, Sep 11, 2010 at 04:55:37PM -0400, Benjamin Cathey wrote: Kris I really appreciate all your help today. I was able to get this resolved. Apparently the default modkey is mod4 and I have always used mod1 Dumb mistake but then, it's a Saturday ... Ah, yes. Most people have historically changed it to Mod4. It should have promped you, I think. Perhaps I added that after the 3.9 release, though... -- Kris Maglione Doing linear scans over an associative array is like trying to club someone to death with a loaded Uzi. --Larry Wall
Re: [dev] wmii display size issue
On Sat, Sep 11, 2010 at 03:59:41PM -0400, Benjamin Cathey wrote: Kris This is what I had thought originally. The behavior made me think possibly something was running that was trapping keyboard input (like a process that did not get a "&" after it). However this is not the case. My old config was in .wmii-3.5/ however I moved .wmii to .wmii.orig just to be sure. Still no keyboard input works at all. Any further thoughts? It's running on 'lucid' if that helps. I can send any output of any commands/logs, etc that you think might help Well, the easiest tests are, ps ax | grep wmiirc # Should list 1 or 2 processes wmiir read /keys# Should list all of your key bindings wmiir read /event # Press some key bindings, should show up If all else fails, try this from the console: wmii -r python/wmiirc -- Kris Maglione You do not really understand something unless you can explain it to your grandmother. --Albert Einstein
Re: [dev] wmii display size issue
On Sat, Sep 11, 2010 at 03:04:08PM -0400, Benjamin Cathey wrote: Well it worked great! I now have the entire display available. The only trouble now is that once wmii launches, it will not take any keyboard input. It is essentially frozen. I swear I saw this when I upgraded wmii on my Arch install as well however I cannot, for the life of me, remember how I fixed it. I don't have the time to research now since I'm at work. Anything come to mind that I should check? I suspect it's a config file issue. Try renaming ~/.wmii -- Kris Maglione One can promise actions, but not feelings, for the latter are involuntary. He who promises to love forever or hate forever or be forever faithful to someone is promising something that is not in his power. --Friedrich Wilhelm Nietzsche
Re: [dev] wmii display size issue
On Sat, Sep 11, 2010 at 01:07:24PM -0400, Benjamin Cathey wrote: Unfortunately, the results are still the same. The external monitor's entire display allows the mouse cursor, however wmii is only available in the upper left corner. As you can see in the screenshot below, the statusbar shows the bottom of the workable space, even though I can mouse over the entire display and you can see the alt-p menu at the very bottom: http://yfrog.com/6escreenshot20100911p Any help would truly be appreciated. I thought that there *must* be a way to force wmii's display size so that it is using the entire thing. It always uses the entire display. Can you post the new output of `xrandr -q` after running the --right-of command. Also, try moving a window past the edge of the screen. Either Mod-l twice or Mod-j for the window at the bottom of the column should do it. BTW, what version are you using? That looks like dmenu that you're running, but newer versions use wimenu. I believe that the last release that used dmenu was 3.6, and that didn't support Xinerama. I simply need a way to tell it that it should be using 1050x1680 -- Kris Maglione Measuring programming progress by lines of code is like measuring aircraft building progress by weight. --Bill Gates
Re: [dev] wmii display size issue
On Sat, Sep 11, 2010 at 09:06:53AM -0400, Benjamin Cathey wrote: Kris Here is the output: Screen 0: minimum 320 x 200, current 1050 x 1680, maximum 4096 x 4096 VGA1 connected 1050x1680+0+0 left (normal left inverted right x axis y axis) 473mm x 296mm 1680x1050 60.0*+ 1600x1000 60.0 1280x1024 75.0 1440x900 59.9 1280x960 60.0 1152x864 75.0 1152x720 60.0 1024x768 75.1 60.0 832x62474.6 800x60075.0 60.3 640x48075.0 60.0 720x40070.1 LVDS1 connected (normal left inverted right x axis y axis) 1024x600 60.0 + 640x48059.9 As you can see, the current screen is 1050x1680 (it's a vertically oriented wide-screen). As I mentioned, the wmii window is in the upper left corner and is only taking up 1024x600 (the laptop screens resolution). The rest of the space is available to the mouse and the wmii menus brought up by alt-p and alt-a display at the very bottom of the monitor rather than the bottom of the box in the upper left. It looks to me like your two XRandR screens are overlapping. That probably means if you try to move a client to the right off the edge of the screen, it'll take up the entire screen (either over or under any clients in the smaller area). As for the menus, they always open on whichever screen has the mouse. Try, xrandr --output VGA1 --right-of LVDS1 -- Kris Maglione Sufficiently advanced political correctness is indistinguishable from sarcasm. --Eric Naggum
Re: [dev] wmii display size issue
On Fri, Sep 10, 2010 at 11:48:28AM -0400, Benjamin Cathey wrote: I setup a secondary monitor to be used as my only display and have things almost completely worked out. Using 'xrandr' I have the external display on with the correct resolution and the laptop display turned off when I go into X (xrandr executes prior to wmii executing). However wmii's active display appears in the upper left as a box that is the size of the laptop display (rather than expanding to take up the entire screen). Using the menu (via alt-p) displays the program selection list at the very bottom of the screen (outside of the little wmii window in the upper left). How can I force wmii to start using the entire resolution of the screen? Can you post the output or `xrandr -q` Thanks, -- Kris Maglione It's always good to take an orthogonal view of something. It develops ideas. --Ken Thompson
Re: [dev] [OT] What's wrong with C++?
On Fri, Sep 10, 2010 at 08:19:38PM +0300, Nikhilesh S wrote: I must start out saying I don't have much experience in software development with larger teams on large projects or with lots of other people, or in 'commercial software development' in companies - I've just done stuff as a hobby in my free time for the past 5 years or so, learning on my own - but I hope to learn more in the coming years (going to university next year). Wow you write long emails for flame-bait... There's a very good quote to answer your question in brief, C++: an octopus made by nailing extra legs onto a dog. In C, to the best of my knowledge, either you would do this by having an enum of types and 'switching' on it, or by doing a function pointer table thing (which is functionally (no pun intended) equivalent to a virtual function table right?). So aren't you just building the same idea on it again? I've also seen in a lot of open-source C code some kind of attempt at making OO-stuff in C such as the 'GObject' things. Often a lot of the code is of the form somestruct_dosomething(struct somestruct *p, ... ). Please don't mention GObject. Nearly anything GNU is not worth mentioning. I haven't really understood the problems with C++ that the people here that have problems with C++ have, although I must say in recent years (especially with C++0x?) they've been adding a lot of features and it's getting a little 'fat'. Are you just feeling the same thing, just that you probably used C before C++ or have otherwise been at it for a long time and thus this feeling has come in earlier? Maybe C++ is 'complex' but doing things with it is 'simple', whereas it's the other way round in C? Look at ASM and C for instance - I've only lightly touched ASM but I think it's simpler than C but doing things in C is simpler than in ASM. Is C++ broken because no one really understands it fully? Is allowing multiple paradigms in a single langauge a problem? Should language enforce paradigm? It's not OO that we're against. Not per se, anyway. It's that C++ is simply a poorly designed hodge-podge that basically nails a lot of extra features on C, without any real core design principles, and incidentally kept the heinous old textual preprocessor and added yet another symbolic preprocessor just to insult to insanity. For an example of what C++ should have been, have a look at D, which is easily as simple as C and more powerful than C++. And now there's Go, and there's always been Lisp and Objective-C, both of which have cleaner designs than C++ and follow the original Object Oriented model much better than the latter. -- Kris Maglione You do not really understand something unless you can explain it to your grandmother. --Albert Einstein
Re: [dev] [OT] Music?
On Thu, Sep 09, 2010 at 07:33:04PM +0100, Ethan Grammatikidis wrote: On 8 Sep 2010, at 11:27 pm, David Tweed wrote: On Wed, Sep 8, 2010 at 10:35 PM, Joel Davila <6336...@gmail.com> wrote: On 8 September 2010 15:12, Nikhilesh S wrote: What kind of music do you listen to? Your favourite artists, genres, etc.? Interesting. Suckless music may be classics as Beethoven, Brahms,Chopin, Ravel, Tchaikovsky... I thought the only music that would count as suckless is John Cage's 4′33″. It's the only piece where there's just no bloat. Even that Nokia "classic" ringtone has 13 notes that are unnecessarily inflates the NOM (notes of music) metric. [I'm sorry, this is cruel caricaturing but I couldn't resist]. I very much enjoy the rich sounds of classical music but I can't see how it could be suckless at all. Some jazz pieces pack an immense amount of feeling into a very sparse melody only using a few instruments. I would listen to jazz a lot, but the good stuff is rather overshadowed by the sheer volume of pointless crap which somehow manages to get the same genre label. I quite agree with you about Jass, but I don't think you're being fair to Classical. Depending on how you define Classical, you're being quite unfair. Consider Satie, who was post-Romantic and thus not technically Classical, for instance. His solo piano music is utterly simplistic and yet completely, stunningly beautiful at times. And then there's Bach (Baroque-era, and thus pre-Classical), who's known for his fantastic counterpoint, and yet manged to write solo music, such as his Chaconne from Partita No. 2, which is based on a simple developed theme from one instrument, and yet is absolutely masterful. And even when you go beyond that, well, I don't like to use the term suckless at all, but I wouldn't shudder to apply it to most classical. Composers may sometimes work with a huge orchestra, but what the music boils down to in the end is incredibly simple. And unlike a lot of pop musicians, composers have spent a lot of time and thought on their music, often striving to get it exactly right, pare off anything unnecessary, hone any rough edges. And unlike so many musicians and software developers, most of them tend not to rehash the same tired crap for years or decades on end. Anyway, in classical my tastes have changed recently. I used to like Tchaikovsky and Sibelius, anything dramatic and/or wild, I forget who wrote the Hungarian Dances, but I loved those too. I won't say what I think of Tchaikovsky now. ;-} Brahms. And, please don't say what you think of Tchakovsky. We may come to blowe. Now, listening to last.fm I find I like anything from the renaissance to baroque transition and a smattering of composers from all eras since, including Schönberg. I know nothing of 12-tone and post-modernism, maybe what I like is transitional music; music from artists who are just discovering new forms. I like most musical forms in their early stages. Once they're well-defined and people start getting taught the form rather than feeling their way you start to get pointless crap promoted as 'really good'. I don't listen to last.fm very much, I find it takes a bit of managing to keep it on track with what I want to listen to, and there are several different themes I'd like to train it to. Perhaps I need several accounts to use it properly, and I really couldn't be bothered. I prefer to download from Jamendo. Still with the classical, Jamendo has a couple of albums by Arnaud Conde which I absolutely love, but I haven't generally gone looking for classical there. I've given up on Last.fm. Have a go at Pandora. In my experience, they're much better at giving you music that's actually good. And orders of magnitude better at finding related music. Last.fm had an annoying habit of playing Roy Orbisson in the classical channels, for instance (it was so bad that I had to write my own client to automatically stop and ban certain artists). -- Kris Maglione On the mountains of truth you can never climb in vain: either you will reach a point higher up today, or you will be training your powers so that you will be able to climb higher tomorrow. --Friedrich Nietzsche
Re: [dev] [OT] Music?
On Thu, Sep 09, 2010 at 10:03:11AM +0200, Antoni Grzymala wrote: Kris Maglione dixit (2010-09-08, 19:05): On Wed, Sep 08, 2010 at 03:21:52PM -0700, Paolo wrote: > Alban Berg, Arnold Schoenberg, Debussy, Satie, Schönberg. 12 Tone... Ah, would that he were never born. Please don't create a suggestion that Schönberg only (or even mostly) created 12-tone music. He personality and artistic development is a truly fascinating process in which 12-tone composition was a chapter that he basically started getting out of as soon as he got into. The technique was essentially has, and is widely attributed to him. More importantly, though, he did more to popularize it than any other compuser. Don't misunderstand me, I think he was a brilliant composer, and I especially love some of his earlier work. I just have a cultivated disdain for postmodernism. For most people, it's little more than a phase, but I can't stand to see charlatans and mediocre artists elevated above masters in certain circles because they're so hard to understand that people assume they must be good. And, for the same reason, I can't stand to see exceptionally talented artists doing the same. -- Kris Maglione Organizations which design systems are constrained to produce designs which are copies of the communication structures of these organizations. (For example, if you have four groups working on a compiler, you’ll get a 4-pass compiler) --Conway’s Law
Re: [dev] [OT] Music?
On Wed, Sep 08, 2010 at 11:07:44PM -0400, Jacob Todd wrote: On Wed, Sep 08, 2010 at 07:10:56PM -0400, Kris Maglione wrote: social justice Social justice is just yet another way of saying slavery and theft. I suppose when I say social justice you read socialism, which is a different matter entirely, and has nothing to do with Bad Religion. -- Kris Maglione Learning is not compulsory. Neither is survival. --W. Edwards Deming
Re: [dev] [OT] Music?
On Thu, Sep 09, 2010 at 03:31:09AM +0300, Nikhilesh S wrote: On Thu, Sep 09, 2010 at 12:35:17AM +0200, Antoni Grzymala wrote: Paolo dixit (2010-09-08, 15:21): Isn't his name just 'Paolo'? > ( fav ever: Horowitz plays Scriabin's "Vers la flamme" > http://www.youtube.com/watch?v=WlqGkVc29Gw&feature=fvwd) Basically, Horowitz's anything is in the fav-ever category. He's certainly the best represented single artist in my (probably largish) CD collection. This is cool, I was just checking this out on YouTube. Call me a typography nerd, but the thing that struck me most about that video was the beautifully hand-engraved sheet music. -- Kris Maglione Intellectual laziness is punishable by brain death. It is a natural law. --Eric Naggum
Re: [dev] [OT] Music?
On Wed, Sep 08, 2010 at 05:37:56PM -0400, Peter John Hartman wrote: On Wed, Sep 08, 2010 at 05:29:06PM -0400, Kris Maglione wrote: On Thu, Sep 09, 2010 at 12:12:24AM +0300, Nikhilesh S wrote: >What kind of music do you listen to? Your favourite artists, genres, >etc.? Oh no... No, no, no... This is going to be one of those threads that turns into a series of long, off-topic threads about things like off-topic threads, isn't it? Hm. Not good. But, I'll answer. :) I don't use an audio player that keeps statistics, and Last.FM is useless for my collection, but I think my top played artists are Mahler, Beethoven, Brahms, Chopin, Holst, Sibelius, Tchaikovsky, Rachmaninoff, Debussy, Ravel, Bad Religion, with some generous helpings of Tim Minchin, Flogging Molly, Tool, Clapton, The Who, Sublime, System of a Down, The Beach Boys, and Falling You. I love the fact that there isn't even a beat before you turn from the classics to Bad Fng Religion! Well, the way I see it, any band that's been making music for 30 years without losing its edge, with a Ph.D. for a lead singer, that can write a song about Boltzmann's orchestration of the law of entropy on the same album as songs about heroin abuse, social justice, superstition, and other just general awesomeness, easily deserves to be listed among the likes of Ravel, Holst, and Debussy. Maybe it's just me. -- Kris Maglione Real misanthropes are not found in solitude, but in the world; since it is experience of life, and not philosophy, which produces real hatred of mankind. --Giacomo Leopardi
Re: [dev] [OT] Music?
On Wed, Sep 08, 2010 at 03:21:52PM -0700, Paolo wrote: Alban Berg, Arnold Schoenberg, Debussy, Satie, Schönberg. 12 Tone... Ah, would that he were never born. -- Kris Maglione Just because the standard provides a cliff in front of you, you are not necessarily required to jump off it. --Norman Diamond
Re: [dev] [OT] Music?
On Thu, Sep 09, 2010 at 12:35:17AM +0200, Antoni Grzymala wrote: Paolo dixit (2010-09-08, 15:21): ( fav ever: Horowitz plays Scriabin's "Vers la flamme" http://www.youtube.com/watch?v=WlqGkVc29Gw&feature=fvwd) Basically, Horowitz's anything is in the fav-ever category. He's certainly the best represented single artist in my (probably largish) CD collection. That's interesting. I've got a lot more Rubinstein than Horowitz. -- Kris Maglione Haskell is faster than C++, more concise than Perl, more regular than Python, more flexible than Ruby, more typeful than C#, more robust than Java, and has absolutely nothing in common with PHP. --Autrijus Tang
Re: [dev] [OT] Music?
On Thu, Sep 09, 2010 at 12:12:24AM +0300, Nikhilesh S wrote: What kind of music do you listen to? Your favourite artists, genres, etc.? Oh no... No, no, no... This is going to be one of those threads that turns into a series of long, off-topic threads about things like off-topic threads, isn't it? Hm. Not good. But, I'll answer. :) I don't use an audio player that keeps statistics, and Last.FM is useless for my collection, but I think my top played artists are Mahler, Beethoven, Brahms, Chopin, Holst, Sibelius, Tchaikovsky, Rachmaninoff, Debussy, Ravel, Bad Religion, with some generous helpings of Tim Minchin, Flogging Molly, Tool, Clapton, The Who, Sublime, System of a Down, The Beach Boys, and Falling You. -- Kris Maglione For a long time it puzzled me how something so expensive, so leading edge, could be so useless, and then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match. --Bill Bryson
Re: [dev] [wmii] Remove titlebar
On Wed, Sep 08, 2010 at 12:19:56PM +0300, Nikhilesh S wrote: On Wed, Sep 08, 2010 at 03:47:25AM -0400, Kris Maglione wrote: On Wed, Sep 08, 2010 at 09:32:20AM +0200, thuban wrote: >Le Wed, 8 Sep 2010 03:22:25 +0300, >>Is there a way to disable drawing of titlebars? > >I suppose there isn't, at least for the use of stack mode. But you can >use dwm instead ;) Or RatPoison or LarsWM or XMonad or Rio. No window manager can be everything to everyone, and I prefer not to pollute wmii with every possible option. That said, it would be an easy patch to write, and I may experiment with it after 3.10 is released, but the changes of it making it to the main line are low. I've tried all of those - I'm sticking with wmii due to the 'freedom' in making layouts. I thought there must've been some quick option I missed so I asked. If it's a deep-in feature and requires some messing I guess I'm fine with the titlebar - the other parts of wmii I like till now. :) Maybe if I figure it out I could patch it... It wouldn't be hard. The managed mode code does assume that all windows have titebars, but it's only hard coded at the tops of a few functions in column.c (where labelh(def.font) is assigned to variables). There's already code to deal with titleless floating windows. You just need to change frame_client2rect/frame_rect2client remove the floating window check. -- Kris Maglione Real Programmers don't believe in schedules. Planners make up schedules. Managers "firm up" schedules. Frightened coders strive to meet schedules. Real Programmers ignore schedules.
Re: [dev] [wmii] Remove titlebar
On Wed, Sep 08, 2010 at 09:32:20AM +0200, thuban wrote: Le Wed, 8 Sep 2010 03:22:25 +0300, Is there a way to disable drawing of titlebars? I suppose there isn't, at least for the use of stack mode. But you can use dwm instead ;) Or RatPoison or LarsWM or XMonad or Rio. No window manager can be everything to everyone, and I prefer not to pollute wmii with every possible option. That said, it would be an easy patch to write, and I may experiment with it after 3.10 is released, but the changes of it making it to the main line are low. -- Kris Maglione Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the solution set rather than the problem set? --Edsger W. Dijkstra
Re: [dev] libdraw development
On Mon, Sep 06, 2010 at 10:10:16PM +0200, Moritz Wilhelmy wrote: Why not just split it, like everybody else does? Plus, other compilers possibly don't support it. I't quite a convention for libraries, as far as I know. Instead, you make it work only with gcc, something you usually complain about as big and sucky that has more fuss than necessary because of GNU and ponies. How is that consistent? Does breaking conventions for static libraries really make it suckless? Isn't portability one of the goals? I can give you one single good reason: It takes from 8 to 20 times as long to compile if you split it. That said, I don't use that kind of GNU extension gunk so I split my files anyway. And the convention is less common with the advent of dynamic linking. Only libraries which are explicitly intended for static linking split their files anymore. -- Kris Maglione Fast, fat computers breed slow, lazy programmers. --Robert Hummel
Re: [dev] [OT] c syntax tree dumping tool
On Mon, Sep 06, 2010 at 07:39:31PM +0200, pancake wrote: I think anselm was already interested on something like this. So we can probably take it to do a suckless sloc or a c compiler based in radare2 assembler backend. Which would be far more minimal than gcc or llvm I'd also like to see a simple documentation extractor. My current solution requires adding 'Function: foo' or 'Variable: foo' and then grepping the documents from the C files and the prototypes from the output of cproto. I'd rather not need the Function: lines and cproto is crap. -- Kris Maglione Life isn't about finding yourself. Life is about creating yourself. --George Bernard Shaw
Re: [dev] [patch] dmenu - support for xft font rendering
On Mon, Sep 06, 2010 at 01:48:15PM +0100, Ethan Grammatikidis wrote: That's no excuse for the absolutely appalling specification format. Fontconfig may be a reeking pile of insanity, but at least you can read its specs. Usually a font name by itself is enough, or with a size, 'Terminus - 12', and beyond that, it's still easy enough to parse: Terminus:style=Bold:pixelsize=12:charset=iso10646-1 as opposed to -*-terminus-bold-*-*-*-12-*-*-*-*-*-iso10646-1 12-pixel terminus bold in a utf-8 encoding. I'd honestly rather read the X font spec, the Xft style all seems to run together. Then again, given a decent and decently-rendered font maybe the Xft spec strings are readable. Seems a bit of a chicken-and-egg problem with my eyes. In that example it's not too bad, but you still have all of those extra elements that I don't think you could remember if you were constructing the string by hand. And the FC string was just an example. Normally you don't need any attributes at all, with the possible exception of style, which covers bold, italic, ... The only reasin I use pixelsize is that without it my bitmap fonts get scaled. Regarding the XML configuration, would it help to convert it to YAML? Just mentioning it because I've heard YAML is a lot more human-readable than XML and XML can be converted to/from YAML. I'm going to rewrite it in scheme. YAML would definitely be an improvement, but I'd rather just have a font selection in scheme. It's simpler than having to parse and then execute a spec, and more powerful. At least, it would allow me to replace the XML monstrosity at the end of this message with the somewhat more reasonable scheme version, but I think I can probably do better. I haven't written the matcher yet, so I'll decide on the config format after that. At the least, the scheme engine could ceratainly parse a YAML file. I've noticed how Plan's font system allows you to make a unicode font by writing a text file referencing other fonts, and thought that was light-years ahead of X fonts complete inability to do so. Are you saying Xft can automatically fall back to other fonts for missing characters? That would impress me. Yes, Plan 9's font system is much simpler. It was designed to support large character sets from the start. X now supports font sets, too, but they don't work well at all. As for Xft, yes, it does support rendering glyphs that a font doesn't include, but not as well as you might expect, and I'm not entirely certain of the rules. URxvt had to resort to its own glyph selection algorithm. (defrules 'font (#t (set! rgba fc:none, hinting #t hintstyle fc:hintfull antialias #t))) (defrules 'pattern ((= family "ProggyCleanTT") (set! antialias #f)) ((= family "Lucida") (set! family "Lucida Std")) ((= family "Lucida Sans") (set! family "Lucida Sans Std")) ((= family "Lucida Typewriter") (set! family "Lucida Typewriter Std")) (deffilters 'font ((not scalable) #t)) none true hintfull true ProggyCleanTT false Lucida Lucida Std Lucida Sans Lucida Sans Std LucidaTypewriter Lucida Typewriter Std false -- Kris Maglione Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian W. Kernighan
Re: [dev] libdraw development
On Tue, Sep 07, 2010 at 12:00:27AM +0800, sqweek wrote: On 4 September 2010 21:25, Uriel wrote: On Sat, Sep 4, 2010 at 12:34 AM, Connor Lane Smith wrote: One file per function means a binary will only link the objects it needs, which helps keep binary size down when statically linking The linker should be capable of including only the symbols that are actually used in the program. Apparently this works only at the granularity of objects. ie, if any symbol within an object is required, all symbols are pulled in. At least, with gcc - wonder if kencc is different... No, KenCC is the same. -- Kris Maglione Lisp doesn't look any deader than usual to me. --David Thornley
Re: [dev] [patch] dmenu - support for xft font rendering
On Sun, Sep 05, 2010 at 11:28:17PM -0400, Josh Rickmar wrote: On Sun, Sep 05, 2010 at 11:02:58PM -0400, Kris Maglione wrote: I still don't think that the auto-hinter is nearly up to par with designer hinted fonts. For the fonts that I have screen and print varieties from different foundaries, the versions without hinting information look considerably worse on-screen (though better in print) than the auto-hinted varieties. This all really depends on how you like your fonts rendered. When Apple first ported Safari to Windows, everyone was screaming about how the fonts looked like crap. The Apply way is to use little hinting and respect the shape of the font glyphs, while the Microsoft way is to hammer the font into the pixel grid so it looks sharper, but also causes the original typeface's unique shape to suffer. Personally, I prefer the autohinter since I've found that with slight hinting it looks very similar to the way Apple renders their fonts. I don't know if Apple uses an autohinter or the hints in the font, but they certainly put a lot less emphasis on the hinting and more on the shape. Generally, if you like your fonts sharp on screen (Microsoft), designer hints are usually the best. If you want your fonts to look more like print (Apple), using the autohinter seems to work better. Not that this matters much, as I spend most of my time staring at bitmaped monospace fonts. Apple's font rendering engine and display screens are miles beyond Microsoft's or Freetype's. If either of them could match the quality of font rendering on a MacBook, I'd be all for it, but instead of the crisp, high contrast fonts you get on an Mac, you just wind up with fonts with blurry edges that are ugly and hard to read. -- Kris Maglione I believe that when I die I shall rot, and nothing of my ego will survive. I am not young, and I love life. But I should scorn to shiver with terror at the thought of annihilation. Happiness is none the less true happiness because it must come to an end, nor do thought and love lose their value because they are not everlasting. --Bertrand Russell
Re: [dev] [patch] dmenu - support for xft font rendering
On Mon, Sep 06, 2010 at 01:50:24AM +0100, Ethan Grammatikidis wrote: Last I really checked the autohinter had become very good. A few years ago I actually recompiled freetype to disable the interpreter because the autohinter produced so much better results for me. I suspect that was due to my use of free fonts which were unlikely to have properly-done bytecode, if they had any bytecode at all. Ariel actually suffered quite badly from the autohinter, much more than other fonts, which to my mind says "Ariel is a suck-more font." ;) I still don't think that the auto-hinter is nearly up to par with designer hinted fonts. For the fonts that I have screen and print varieties from different foundaries, the versions without hinting information look considerably worse on-screen (though better in print) than the auto-hinted varieties. And I'd say that Ariel is one of the better hinted fonts around these days (as are most of the Microsoft core fonts). I have Linotype variants of most several of them, and they all begin to look blurry beyond ~11pt, whereas the Microsoft variants remain pixel-perfect. Sometimes I think there's a lot of things like this in computing. Someone produces something which works well for most things but which doesn't work so well for the flagship that area, therefore it has to be replaced with something which requires more work from everyone just as the flagship had a lot of work invested into it. Then again, chances are what I'm saying is quite irrelevant for fonts. I don't think this is the case. The hinting information is optional on both ends. Foundaries spend a lot of money to provide it for screen fonts because it makes a difference. Anyone choosing not to support it doesn't have to. But I'd say that designer hinted fonts are actually significantly easier to render than auto-hinted fonts, which means that it only makes it easier on font designers, not implemenenters. -- Kris Maglione The easy confidence with which I know another man's religion is folly teaches me to suspect that my own is also. --Mark Twain
Re: [dev] [patch] dmenu - support for xft font rendering
On Mon, Sep 06, 2010 at 02:40:32AM +, hiro wrote: Don't tell me Arial is a bad font. And about this aliasing shit: my printer doesn't show it. Is this really a matter of taste? Or my younger eyes? Don't be a fool. Your printer doesn't show it because it has 10 times the horizontal resolution of your monitor. But it certainly shows the difference between bitmap and vector fonts even more as a result. And Arial is a terrible font for anything other than screen reading at less than 12 point height. The Microsoft version does have rather exceptional hinting support, though. -- Kris Maglione Understand this, I mean to arrive at the truth. The truth, however ugly in itself, is always curious and beautiful to seekers after it. --Agatha Christie
Re: [dev] [patch] dmenu - support for xft font rendering
On Mon, Sep 06, 2010 at 02:20:47AM +0100, Ethan Grammatikidis wrote: On 1 Sep 2010, at 8:30 pm, Kris Maglione wrote: On Wed, Sep 01, 2010 at 06:00:17PM +0100, Ethan Grammatikidis wrote: Connor Lane Smith wrote: If someone were to write a simple clean xft patch for libdraw it could be useful, perhaps even integrated into mainline. This may just be my limited perspective, or it may be my upset stomach talking, but I'm very surprised to see xft seriously suggested in this mailing list. Xft is (to me) synonymous with the transition of X.org from something bad but usable into a black box nightmare best left to distro tools to cope with. Maybe it wasn't so bad for other people, maybe it got better. As bad as Xft/fontconfig is, the X font system is worse. At least with Xft, you can copy just about any font you like (TTF, OTF, Type-1, PCF, BDF) to ~/.fonts and then use it. You also don't need to worry about having scaled bitmaps for every font size that you want. And, probably most importantly, you don't need to deal with hoary and inscrutable X font spec strings. cd .fonts mkfontdir xset +fp ~/.fonts # or if you ran that already: xset fp rehash Granted, xset not a wonderful program itself, being essentially a multi-call binary with a number of entirely unrelated tasks and no syntax consistency whatsoever. Scaled bitmaps are an issue for the web, certainly. I've never personally needed them elsewhere except in apps I'd really describe as having brain-damaged UIs. I would like to have web pages rendered in such a way as to not need precise font sizes. You're not considering the fact that a) that won't work if you're connecting over a network, b) you can't use scalable fonts without a font server, c) quite a few other problems that I can't think of off of the top of my head but bite from time to time. Speaking of UIs, good ones can make excellent tutorials. 10-20 minutes with xfontsel and X font spec strings look a whole lot better. They may still be a little hard to hand-edit but not entirely so and xfontsel itself is a pretty good tool for when they are. After using xfontsel for years the Gtk+2 font selector's lack of any means to filter the font list was unbearable! Honestly, that lack of filtering was one of the bigger things turning me off Xft, and I don't know if the situation's improved. That's no excuse for the absolutely appalling specification format. Fontconfig may be a reeking pile of insanity, but at least you can read its specs. Usually a font name by itself is enough, or with a size, 'Terminus - 12', and beyond that, it's still easy enough to parse: Terminus:style=Bold:pixelsize=12:charset=iso10646-1 as opposed to -*-terminus-bold-*-*-*-12-*-*-*-*-*-iso10646-1 Also note that the charset is almost entirely superfluous in the first spec, but the second is a crap shoot without it. And at least with the former you can run 'fc-list | grep Terminus' to get a list of the available opts. Try grepping 'xlsfonts -l' some time. On my machine, it freezes my X server for 30 seconds, prints a few hundred lines to TTYv1, and finally returnes a few hundred lines of similarly inscrutable font specs for each font. I still say that fontconfig is crap, but it's certainly less crap than the X font system, if only it weren't for the damned XML configuration garbage. I'm not really trying to advocate X font strings as such, nor Xlib; one of my monitors really needs anti-aliasing and UTF-8 support is a good thing, referring to your comment below. I'm not sure what I am getting at. I use Xft with wmii wihout antialiasing, because I do need UTF-8 support and the X font system doesn't get it right for me. And I'm tired of dealing with those blighted font specs. -- Kris Maglione The pessimist complains about the wind; the optimist expects it to change; the realist adjusts the sails. --William Arthur Ward
Re: [dev] [OT] c syntax tree dumping tool
On Sun, Sep 05, 2010 at 01:44:06PM +0200, Szabolcs Nagy wrote: i'm involved in a c parsing tool project, c99tree, and pleased to announce its first release http://repo.hu/projects/libporty it is in early development, but it can parse c99 code (without includes and preprocessor tokens) and print an abstract syntax tree eg useful for listing function calls of a .c file etc (the current form is very sensitive to undefined type ids this will be fixed up later) c99tree knows c99 grammar very well (and a fair amount of gcc extensions), but it does not try to check syntax errors or semantic problems, just dumps a tree or fails the difficult part will be the preprocessor some part of it is scheduled for the next release for suckless it maybe useful for code analysis and code audit as it tells a bit more than a wc -l :) the grammar is based on the .y and .l files of pcc http://pcc.ludd.ltu.se (actually http://golang.org/src/cmd/cc/cc.y is cleaner, but seemed more work to cut out and make c99/gcc compatible, might take another look at it later..) Thank you. I've been wantingsomething like this for a long time. -- Kris Maglione i've wondered whether Linux sysfs should be called syphilis --forsyth
Re: [dev] [patch] dmenu - support for xft font rendering
On Fri, Sep 03, 2010 at 08:56:22PM +0200, hiro wrote: Admittedly, the newer auto-hinters do a decent job of this these days The freetype autohinter? http://freetype.sourceforge.net/autohinting/hinter.html#screenshots Perhaps this is outdated, but it looks horrible to me. It depends on the font, but I believe it's gotten better since that screenshot was taken. Hinting patents have expired and any distribution should now be able to include the proper bytecode interpreter. I agree. My point was that the (simple) bytecode interperater is not a bad thing. It's just the simplest way for font designers to control how vector fonts are rasterized on low-resolution media or in very small sizes. The auto-hinted fonts tend to look much less like their printed counterparts than the designer hinted fonts. Before the bytecode interperater was introduced, the practice was to use bitmap fonts for small glyph sizes and low resolution displays, even for vector fonts, and I'm glad to see the end of that. -- Kris Maglione Don't surrender your loneliness / So quickly. / Let it cut more deeply. / Let it ferment and season you / As few human / Or even divine ingredients can. --Hafez
Re: [dev] [patch] dmenu - support for xft font rendering
On Thu, Sep 02, 2010 at 11:30:18PM +0200, Uriel wrote: I certainly think that having such possibility will be good. I know that font systems are a quite mad, and utf8 is far more complex than just plain ascii or bitmapped fonts. In fact ttf is a virtual machine, and opentype supports as weird things as many different capital letters or combinations of two chars. This is great for typographic ppl, and they tend to defend this position in benefit of ease of reading. I know nothing about all this crap, but why not just use FreeType to render the fonts into a bitmap, and ignore the whole retarded X-font-systems? Or you could just use the *real* libdraw, which handles bitmap fonts quite nicely (and if you want another font at another size, you can always generate it). Have you ever *tried* to write a text rendering engine from scratch using Freetype? It's not as simple as it sounds. First you actually have to find the fonts, lookup their names and variants, and decide which one to use based on an arbitrary name. Then you have to individually render and kern each individual glyph, which isn't actually too terribly bad, but it's much, much more complicated than using one of the X libraries. I'd considered doing it in the past, but it's not worth it. I'm currently planning to replace the godawful fontconfig XML configuration on with a Scheme-based lookup system which may save my sanity, though. -- Kris Maglione It's always good to take an orthogonal view of something. It develops ideas. --Ken Thompson
Re: [dev] [patch] dmenu - support for xft font rendering
On Wed, Sep 01, 2010 at 10:40:27PM +0200, Arian Kuschki wrote: Excerpts from Connor Lane Smith's message of 2010-09-01 21:33:23 +0200: I'm sympathetic with this view, being a lover of typography myself. But you're in luck! dmenu, dwm, and libdraw already do support variable-width fonts. My desktop system runs dmenu in Helvetica. :) great news, glad to hear there is a like-minded soul here with the programming chops to actually make stuff happen! I suspect that it's more the fact that nearly every method of rendering fonts on X11 supports variable width fonts by default, and requires significantly more effort not to support them than to. -- Kris Maglione He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would suffice. --Albert Einstein
Re: [dev] [patch] dmenu - support for xft font rendering
On Wed, Sep 01, 2010 at 10:02:16PM +0200, pancake wrote: I personally use 10x20 font or the fixed one. But certainly..reading the web with courier is not as nice as with verdana.. Typographic nazis tend to be quite extremist in pro to a correct use of fonts, like killing comic sans and so on.. I should think that any sane person would be in favor of killing Comic Sans and Courier, and preferably also the designer of the former (although perhaps he can't be blamed, given that the original purpose of the font was restricted to the domain of comic speech bubbles, though it was a badly designed font even for that). I certainly think that having such possibility will be good. I know that font systems are a quite mad, and utf8 is far more complex than just plain ascii or bitmapped fonts. In fact ttf is a virtual machine, and opentype supports as weird things as many different capital letters or combinations of two chars. This is great for typographic ppl, and they tend to defend this position in benefit of ease of reading. The TTF hinting virtual machine is fairly simple, and with good reason: it makes it possible to display AA fonts onscreen with as little blurring as possible. Admittedly, the newer auto-hinters do a decent job of this these days, but not nearly as good as as the professional hinting encoded into high quality fonts. As for OTF features, they're meant for professional typesetting more than for screen fonts. But even then, kerning tables make a big difference even for screen fonts, and the proper small caps fonts look orders of magnitude better than faked small caps. Other than that, you don't even have to the other OTF features from most applications (except occasionally for ligature substitution), other than typesetting programs like InDesign and XeTeX. -- Kris Maglione Every program has (at least) two purposes: the one for which it was written, and another for which it wasn't. --Alan J. Perlis
Re: [dev] [patch] dmenu - support for xft font rendering
On Wed, Sep 01, 2010 at 07:57:03PM +0300, Henri Mannerberg wrote: A rewrite of the highlight colour handling is probably in order, as it looks rather messy atm (if anyone feels like taking a swing at it, go right ahead! :) You may want to have a look at the following from wmii: lib/libstuff/x11/colors/parsecolor.c lib/libstuff/x11/colors/xftcolor.c lib/libstuff/x11/xft.c There's really no good way to deal with colormaps in X11 except using RENDER everywhere, so it will always come down to a hack, in my opinion. -- Kris Maglione You can get into a habit of thought in which you enjoy making fun of all those other people who don’t see things as clearly as you do. We have to guard carefully against it. --Carl Sagan
Re: [dev] [patch] dmenu - support for xft font rendering
On Wed, Sep 01, 2010 at 06:00:17PM +0100, Ethan Grammatikidis wrote: Connor Lane Smith wrote: If someone were to write a simple clean xft patch for libdraw it could be useful, perhaps even integrated into mainline. This may just be my limited perspective, or it may be my upset stomach talking, but I'm very surprised to see xft seriously suggested in this mailing list. Xft is (to me) synonymous with the transition of X.org from something bad but usable into a black box nightmare best left to distro tools to cope with. Maybe it wasn't so bad for other people, maybe it got better. As bad as Xft/fontconfig is, the X font system is worse. At least with Xft, you can copy just about any font you like (TTF, OTF, Type-1, PCF, BDF) to ~/.fonts and then use it. You also don't need to worry about having scaled bitmaps for every font size that you want. And, probably most importantly, you don't need to deal with hoary and inscrutable X font spec strings. On the other hand, you need to edit XML to make configuration changes and deal with aweful scaling issues with bitmap fonts unless you use :pixelsize=whatever: in the spec. In my experience, Xft also deals with UTF-8 significantly better than the Xlib implementation, which is the reason I've started using it locally (with non-AA fonts nonetheless). -- Kris Maglione Question with boldness even the existence of God; because if there be one, He must approve the homage of Reason rather than that of blindfolded Fear. --Thomas Jefferson
Re: [dev] [wmii] "multiplication" after wmiirc
On Wed, Sep 01, 2010 at 05:04:25PM +0100, Piotr Zalewa wrote: I've got no wmii- ebuild Is it in some non standard layer? I don't know about the official layers, but there's a suckless overlay: http://github.com/dokipen/suckless-overlay But I didn't think this problem existed in 3.9.2. -- Kris Maglione Make everything as simple as possible, but not simpler. --Albert Einstein
Re: [dev] wmii9menu items alignment
On Thu, Aug 26, 2010 at 04:31:09PM -0400, Kris Maglione wrote: On Thu, Aug 26, 2010 at 09:22:00PM +0100, Ethan Grammatikidis wrote: On 26 Aug 2010, at 7:33 pm, Kris Maglione wrote: On Wed, Aug 25, 2010 at 09:48:24PM -0400, Vladimir Levin wrote: I've actually considered this myself. I've written scripts which have looked rather bad with the items centered. However, if I were going to add a feature, it would only be a -l flag for left alignment, since I can't see a use for right alignment and couldn't justify the extra complexity. ثم أنت لا تفهم أعظم لغة على وجه الأرض! Not relevant. It doesn't support ltr text, and if it did, an entirely different approach would be required anyway. Sorry, I meant rtl, obviously. -- Kris Maglione Technology is dominated by two types of people: Those who understand what they do not manage. Those who manage what they do not understand. --Putt's Law
Re: [dev] wmii9menu items alignment
On Thu, Aug 26, 2010 at 09:22:00PM +0100, Ethan Grammatikidis wrote: On 26 Aug 2010, at 7:33 pm, Kris Maglione wrote: On Wed, Aug 25, 2010 at 09:48:24PM -0400, Vladimir Levin wrote: I've actually considered this myself. I've written scripts which have looked rather bad with the items centered. However, if I were going to add a feature, it would only be a -l flag for left alignment, since I can't see a use for right alignment and couldn't justify the extra complexity. ثم أنت لا تفهم أعظم لغة على وجه الأرض! Not relevant. It doesn't support ltr text, and if it did, an entirely different approach would be required anyway. -- Kris Maglione “Did God have a mother?” Children, when told that God made the heavens and the earth, innocently ask whether God had a mother. This deceptively simple question has stumped the elders of the church and embarrassed the finest theologians, precipitating some of the thorniest theological debates over the centuries. All the great religions have elaborate mythologies surrounding the divine act of Creation, but none of them adequately confronts the logical paradoxes inherent in the question that even children ask. --Michio Kaku
Re: [dev] wmii9menu items alignment
On Wed, Aug 25, 2010 at 09:48:24PM -0400, Vladimir Levin wrote: I'm very new to this mailing list, but have been using wmii for a year or so now. It's an awesome WM. Thank you very much for maintaining it. Here's my humble contribution. I found that some menu scripts that I've thrown together look much better with the items aligned to the left. As a result, I wrote a small patch to the wmii9menu.c which adds an optional -p flag and takes left right or centered as an argument. This allows the user to specify which way to align the items in the menu. I've actually considered this myself. I've written scripts which have looked rather bad with the items centered. However, if I were going to add a feature, it would only be a -l flag for left alignment, since I can't see a use for right alignment and couldn't justify the extra complexity. The diff follows. I'm not sure how people react to these things (I'm new to all mailing lists)... but hopefully this helps someone who might be looking for the same thing. Patches are generally well received, so long as you don't expect them to be added to mainline when new features are involved. I will say, though, that you should try to stick to the coding style of the files you patched. It may just be your mail client, but it looks like you've changed tabstops to 4 and expanded tabs, which means that this patch won't apply without the -l flag. Also, I'd suggest the following modifications to maintain consistent style: diff -r b767f9a84346 cmd/x11/wmii9menu.c --- a/cmd/x11/wmii9menu.cMon Aug 16 19:38:17 2010 -0400 +++ b/cmd/x11/wmii9menu.cWed Aug 25 21:37:41 2010 -0400 @@ -71,6 +71,7 @@ static char**labels;/* list of labels and commands */ static char**commands; static intnumitems; +static Alignalign = Center; void usage(void); void run_menu(void); @@ -124,6 +127,17 @@ case 'i': initial = EARGF(usage()); break; +case 'p': +cp = EARGF(usage()); +align = (strcmp(alignString, "left") == 0) ? West : +(strcmp(alignString, "right") == 0) ? East : +(strcmp(alignString, "center") == 0) ? Center : + North; + +if(align == North) +usage(); + +break; default: usage(); }ARGEND; @@ -173,7 +187,7 @@ usage(void) { lprint(2, "usage: %s -v\n", argv0); -lprint(2, " %s [-a ] [-i ] menitem[:command] ...\n", argv0); +lprint(2, " %s [-a ] [-i ] [-p ] menitem[:command] ...\n", argv0); exit(0); } @@ -306,7 +320,7 @@ c = &cnorm; r = rectsetorigin(r, Pt(0, i * high)); fill(menuwin, r, &c->bg); -drawstring(menuwin, font, r, Center, labels[i], &c->fg); +drawstring(menuwin, font, r, align, labels[i], &c->fg); } } -- Kris Maglione The trouble with the world is that the stupid are cocksure and the intelligent full of doubt. --Bertrand Russell
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
On Thu, Aug 26, 2010 at 09:51:10AM +0200, yy wrote: 2010/8/26 Kris Maglione : It does not work that way in postscript and, as I already said in another message, it does not work that way in forth, neither in toka or raven. Would you mind explainning why your way is more logical? I think it could get compicated once you introduce else or nested if blocks. It does work that way in forth. At least, the conditional comes just before the if token (though the branches come after it). Therefore, it does not work that way in forth. You can also say that the "branch" (forth has no branches!) comes after the conditional. My question stands: why your way is more logical? what makes it worth to take a different approach from all the other stack based languages which use blocks? I never said it was more logical, I said I prefer it. But my point was that in forth the conditional comes just before the if token. That's the only part that interests me. I find it easier to read than having to backtrack bast two code branches when I come across the if token to find out what the condition was. Please, don't tell is the forth way when it is not. In forth, IF only takes one argument and is compiled to a conditional jump to THEN (or ELSE). How is that not a branch? -- Kris Maglione There's no sense being exact about something if you don't even know what you're talking about. --John von Neumann
Re: [dev] Stripping html from email
On Thu, Aug 26, 2010 at 11:24:11AM +0100, Kai Hendry wrote: I noticed no one mentioned http://packages.qa.debian.org/m/mpack.html `munpack` Indeed, I've been using mpack and ripmime for years, but I think that altermime would be cleaner in this case. -- Kris Maglione Religion began when the first scoundrel met the first fool. --Voltaire
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
On Thu, Aug 26, 2010 at 12:19:33AM +0200, yy wrote: 2010/8/25 pancake : * I will probably swap the order of the conditional clauses: (what do you think about it) 3 3 == { 'Is equal duppy\n' print } if --> { 'Is equal duppy\n' print } 3 3 == if Hmm, personally I prefer the 'condition first' order... Why do you like the 'condition later' order? My way is more logical fr a stack based vm. Just flip your mind. :) It does not work that way in postscript and, as I already said in another message, it does not work that way in forth, neither in toka or raven. Would you mind explainning why your way is more logical? I think it could get compicated once you introduce else or nested if blocks. It does work that way in forth. At least, the conditional comes just before the if token (though the branches come after it). -- Kris Maglione A smart terminal is not a smartass terminal, but rather a terminal you can educate. -- Rob Pike
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
On Thu, Aug 26, 2010 at 03:02:08AM +0300, Nikhilesh S wrote: The current way of doing it makes the implementation very simple - if it encounters a '$' it just reads the variable name and makes a new one. If it encounters an '&', it just sets 'callFunc' to 0 and continues like a normal name-read except it won't execute it now - it'll just push the object onto the stack. Then 'callFunc' is set back to 1 (the default). I don't see how this is any more complicated. When a $token is encountered, the symbol should be pushed onto the stack. Then when def is encountered, the top two items should be popped to the stack, and the second should be assigned to the symbol that is the first. It's deadly simple. As for &, I haven't looked into the VM (I'm sorry to say that the code does not match my esthetic), but I don't think that this would be considerably more complicated. Instead of pushing the object on the stack, you push the symbol onto the stack, then dereference it when you need the object. Then again, I can't really think of a use for &tokens, so I could be wrong there. Actually I will probably rewrite the whole parser in a more proper way some time - right now it just runs through the characters with a primitive state system and some forward-peeking, and simply executes the code as it goes by (the whole thing is in 'ns_interpret' in nscript.c). Should I use 'bison' or something instead? God no! The whole point of stack based language is that they don't need anything nearly as complicated as a LALR grammar. Or, as lispers are so fond of saying, they have no grammar. The most complicated thing you have to do is parse {} blocks. The rest is down to your lexer, which you'd have to write for yacc anyway. -- Kris Maglione Reason should be destroyed in all Christians. --Martin Luther
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
On Wed, Aug 25, 2010 at 10:02:56PM +0200, Moritz Wilhelmy wrote: The whole thing actually reminds me of postscript, which I consider a language with a nice syntax. The only thing that sucks about it, is that adobe buried it in favour of this PDF crap, which is really sad. PDF is, for all intents and purposes, compressed PS with some extensions, and some forced encapsulation so that seeking works. If you decompress it, you can edit it just the same as any other PS document. The only real bad part is that they use too damned many XML streams these days. As for PS, it's not even remotely buried. Most high end printers are still PS based, and I don't see that changing any time soon. -- Kris Maglione The wireless telegraph is not difficult to understand. The ordinary telegraph is like a very long cat. You pull the tail in New York, and it meows in Los Angeles. The wireless is the same, only without the cat. --Albert Einstein
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
On Wed, Aug 25, 2010 at 03:24:03AM +0300, Nikhilesh S wrote: Preceding a name with '$' will create a variable with that name and pop and assign the last thing on the stack to it. Simply a name will push the value of the variable with that name onto the stack (if it's not executable, we're getting to executables soon). 3 $var 2 5 var + print # prints '8', 2 is left on stack Personally, I don't think that a special syntax for variable definition fits well in a stack-based language. I prefer the PostScript syntax of quoting the word and using the def keyword, so: 2 $var def or { 'hi' print } $foo def or the reverse, or another quoting character. It could also replace &foo to push a block onto the stack, since executing the quoted word would be equivalent to executing its associated block. -- Kris Maglione Correctness is clearly the prime quality. If a system does not do what it is supposed to do, then everything else about it matters little. --Bertrand Meyer
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
On Wed, Aug 25, 2010 at 01:54:37PM +0200, pancake wrote: I encourage you to make the nstest program smarter by removing help messages, prompts and others and just keep the read-eval-print loop. I'd rather the script go in nstest.ns and either be sourced at runtime or processed by the makefile into a header. Stuffing scripts into quoted C strings is always ugly and makes them hard to read and edit. * I would probably prefer '"' quote char for strings. I think this is irrelevant. It's down to the preference of the language designer. Most scripting languages support single quoted strings, some (python) favor them, and some (rc) implement them exclusively. My personal preference is for single-quoted strings to ignore escape sequences, and to escape single quotes by doubling them, and for double-quoted strings to process escapes and possibly do simple interpolation. * I will probably swap the order of the conditional clauses: (what do you think about it) 3 3 == { 'Is equal duppy\n' print } if --> { 'Is equal duppy\n' print } 3 3 == if I agree. It's cleaner, and it's closer to forth, which is always good. -- Kris Maglione The X server has to be the biggest program I've ever seen that doesn't do anything for you. --Ken Thompson
Re: [dev] [wmii] colrules percentages?
On Wed, Aug 18, 2010 at 06:48:58PM +0300, Nikhilesh S wrote: How do the colrules percentages work? Does each number represent the percentage of column n as a fraction of the width of the whole screen, or of the last selected column before it was created, or ... ? I ask because I was messing with colrules for GIMP for a while but I wasn't able to get it working the way I wanted it. I want to make it look like this (which I set up by manually resizing the columns with Mod-RMB):- http://i.imgur.com/7n47q.png I took a screenshot of that setup, got the pixel widths of each column and put in the numbers as pix_width_n/pix_width_screen * 100 for each in the colrules but it still didn't come out right (the leftmost one was too small, rightmost too big). Thanks for your help! :-) Sorry, this got lost in the noise. It depends on which version you're using. The percentage is always a percentage of the entire screen width. Assume we have a rule: 10+60+20. Before 3.9, the behavior was, when a new column is created it is given the width of the nth element in the rule. So, when there is one column, the next column you create gets 60% of the screen width. When there are two, the next you create gets 20% and all other columns shrink to 80% of their previous widths. In 3.9 (I believe), the new width depends on the location of the new column rather than the total numbers of columns. I suspect that your difficulty is in the shrinking of all other columns when a new one is created. I intend to fix this in 3.10 (where you can already specify a column width in pixels rather than as a percentage of the screen), but I haven't decided on the exact semantics yet. -- Kris Maglione I can hardly see how anyone ought to wish Christianity to be true; for if so the plain language of the text seems to show that the men who do not believe, and this would include my Father, Brother, and almost all my best friends, will be everlastingly punished. And this is a damnable doctrine. --Charles Darwin
Re: [dev] [9base] /bin/rc
On Wed, Aug 25, 2010 at 02:51:07AM +0100, Ethan Grammatikidis wrote: I never thought of keeping a copy of rc in /bin. What I came up with was an rc+ed script to modify that first line.[1] It itself launches with /usr/bin/env, but it modifies every rc and awk script it finds except itself so that the #! lines reference the rc and awk which were in the path at the time it was run. That sounds complicated... Basically, run it in a dir with rc and/or awk scripts and the rc and awk you want to use in dirs at the head of path. It will fix the #! lines. It searches recursively too. I've used it to fix plan9port itself after a move, which p9p's own INSTALL won't do. My main motive was that I wanted most of my scripts to run on Plan 9 as well as my BSD/Linux systems without any hassle. At any rate, I'd rather have a shebang line that works everywhere than a script that modifies them all, especially since my scripts tend to either live on a network filesystem or move around a lot via rsync or hg. -- Kris Maglione UNIX is simple. It just takes a genius to understand its simplicity. --Dennis Ritchie
Re: [dev] [9base] /bin/rc
On Tue, Aug 24, 2010 at 11:31:21PM +0400, anonymous wrote: On page http://suckless.org/people/Kris there are scripts that starts with /bin/rc she-bang. Someone have also sent some script with #!/bin/rc in it to this list. So I want to ask what is the best way to put rc into /bin under Linux. Is there any options in plan9port or 9base that allow to install non-conflicting utilities in /bin? Of course, I can just move 'rc' into 'bin' using mv in my build script but maybe someone know any better way? Hope to get Kris reply, looks like he already use /bin/rc without problems. Also strange that he uses #!/usr/bin/env rc in 'vp'. I just keep a statically linked copy there on all of my machines. There's nothing special about it. I used /usr/bin/env in vp because I expect that most other people don't have a copy there. I don't like to use /usr/bin/env because it might hit on Byron's incompatible rc, but it's the best shot at having scripts work everywhere. I should probably update or remove most of the scripts on that page... I didn't even realize that it was ever migrated from the old diri setup. -- Kris Maglione I did say something along the lines of "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows your whole leg off." --Bjarne Stroustrup
Re: [dev] Re: [dev] [dev] Usage , -h, --help, help, synopsis, …
On Tue, Aug 17, 2010 at 07:54:44PM -0700, Suraj Kurapati wrote: On Tue, Aug 17, 2010 at 8:40 AM, Alexander Teinum wrote: What is the most concise way of outputting a usage and help text? For my programs, the --help option simply displays their manpage. :-) man(1) is better suited for information display (text-wrapping to 80 characters or $COLUMNS, pagination, and emphasis with bold, reverse video, underline, etc.) than anything I could care to reinvent poorly in each of my programs. GNU man has the annoying and difficult to stop habit of filling the entire width of the terminal rather than wrapping at 80 chars. And if you set $MANWIDTH or $COLUMNS to 80 and the terminal isn't that wide, you wind up with badly broken wrapping. As for bold, fortunately my terminal has it disabled, and reverse video has no place in manual pages. By the way, this is the script I use to launch man. If anyone knows of something better (other than Plan 9 man which unfortunately can't handle system man pages), please tell me: #!/bin/rc *=`{stty size} { cols = $2 } MANWIDTH=`{9 bc<= 72) print 72 if($cols < 72) { if($cols >= 65) print 65 if($cols < 65) print $cols } ! exec /usr/bin/man $* | 9 tr − - | less -- Kris Maglione He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife. --Douglas Adams
Re: [dev] [wmii] wimenu custom completion
On Tue, Aug 17, 2010 at 03:56:38PM +0200, LuX wrote: OK, let us call: - 'post' the last script I have posted, on: http://lists.suckless.org/dev/1008/5609.html - 'patch' and 'script' the patch and script you posted on: http://lists.suckless.org/dev/1008/5610.html I copied 'post' and 'patch' from the online archive to files in the same directory. No luck: $ patch post patch patching file post Hunk #1 FAILED at 5. Hunk #2 FAILED at 25. Hunk #3 FAILED at 46. Hunk #4 FAILED at 78. 4 out of 4 hunks FAILED -- saving rejects to file post.rej --> Don't waste your time with this, I must be doing some stupid mistake somewhere and that's all (I'm not at all used with patching). Well, broadly speaking... But not stupid so much as wrong. The white space in the html version is mangled. 'patch -l' would work, but you'll wind up with a badly formatted result. It works, undoubtedly. But… - The command 'sh script' produces some strange outputs in the terminal when I am typing. This might be normal, since what is important is that the very last output is the content of the input line, which is the case so the script works anyway. Sorry, remove the line that starts with 'print "read "'. Examples with 'script': Input List displayed by wimenu 'lp ' List of files in current dir 'lp -' -o media=a4 -o landscape … 'lp -o '-o media=a4 -o landscape … --> Good! 'lp -o m' List of files in current dir containing 'm' --> Bad! 'lp -o media=a4 ' List of files in current dir See below. 'ls ' List of files in $HOME 'ls -a' Nothing --> Good. 'ls -a 'Nothing as well --> Bad! 'ls -a w' List of files in current dir containing 'w' Ah, I'd missed that. This should fix it: --- menu_thing 2010-08-17 06:25:53.0 -0400 +++ - 2010-08-17 19:09:52.759287656 -0400 @@ -33,7 +33,7 @@ if (!match($0, /.*[ \t]/)) # First argument, provide the program list update(0, progs) -else if($NF ~ /^-/) +else if($NF ~ /^-/ && !/ $/) # If the last argument starts with a -, list # options declared in opt instead of files update(RLENGTH, Good and bad examples with 'post' are almost opposite: Input List displayed by wimenu 'lp ' List of files in current dir 'lp -' -o media=a4 -o landscape … 'lp -o 'List of files in current dir--> Bad! 'lp -o m' List of files in current dir containing 'm' --> Bad (logical). 'lp -o media=a4 ' List of files in current dir This behavior is achievable, but considerably magnitude more complex. I've written such completion systems before, but they're far beyond the scope of this script. However, it's not as bad as it might seem. For one thing, you can elide the space after -o, and thus give -omedia=a4. This is perhaps the most obvious solution. However, in the case of the example you provided, I don't think it's that important, given that there are few enough options that you can tab between them without much trouble. If you do want the behavior that you suggest, the simplest approach would be to specify for each object which requires an argument a shell script to produce the results, such as: lp: -o echo media=a4 landscape sides=two-sided-long-edge sides=two-sided-short-edge number-up=N The script to make use of it would be fairly simple (the key would be to check $(NF - 1) above rather than $NF and pass the part of the line following the option to system()), but I'm not going to write it at the moment. -- Kris Maglione Common sense is the collection of prejudices acquired by age 18. --Albert Einstein
Re: [dev] [wmii] wimenu custom completion
On Tue, Aug 17, 2010 at 12:04:28PM +0200, LuX wrote: I'd suggest some slight changes, though: *** Here is a patch (diff file) The following will do what you want: *** Here is a full script I'm sorry but I'm a little bit confused here (recall that I'm somewhat a beginner in this area). It seems to me that some of the changes in your patch are included in your script but not all of them. For example the 'update' function in the script doesn't use its 'cmpl' argument. Thus I'm not sure about which version of your script I have to a apply the patch to. Probably I did something wrong but all the variants I have tried to build by mixing all of this, contain erroneous code. Either they produce odd messages in the terminal when I run 'sh wi_cli.sh', or typing options which are not declared in $opts doesn't work properly: after typing for example 'vim -e ' in the input line, no list of files is displayed after the last ' ' as I would expect. The patch was against your script. They weren't useful to mine since it worked differently. The main intention was not to have to pass the completion results through the shell in your case and thus introduce possible escaping bugs and slowness. Since my version got the results from an external file and command anyway, it wasn't necessary. It might be good to leave it for flexibility in future modifications, but the script wouldn't make use of it. I take it the unmodified script that I posted works (as it does for me)? -- Kris Maglione I cannot agree with those who rank modesty among the virtues. To the logician all things should be seen exactly as they are, and to underestimate one's self is as much a departure from truth as to exaggerate one's own powers. --"Sherlock Holmes"
Re: [dev] [wmii] wimenu custom completion
On Tue, Aug 17, 2010 at 02:15:13AM +0200, LuX wrote: On Sun, 15 Aug 2010 18:51:55 -0400, Kris Maglione wrote: Yes, I already fixed that problem when I made it into an example file for distribution. Attached. I have a few unessential remarks, if you allow me: Of course. - Although I don't understand this, it seems that the last 'tail -1' is no longer needed. Ah, you're right. I'd intended to remove that. Fortunately this changeset hasn't left my patch queue yet. :) - Since you replaced the call to dirname by a 'sub' command just after the comment '# Strip the trailing filename', it happens that when I type 'ls /' in the input area, it is the content of the $HOME directory instead of / which is displayed by wimenu. Here is a fix: # Strip the trailing filename if(match(str, "^/[^/]*$")) str = "/" str sub("(/|^)[^/]*$", "", str) This would be better: sub("[^/]+$", "", str) I'll update the script. - I have read somewhere that /dev/shm was a good place to put files used by programs to discuss one with each others. This would apply to "fifo" in this case. I don't know if you have an opinion on this. That would not help in this case. For one thing, /dev/shm is very system specific. Only certain Linux distributions support it. For another, its value is in that it's a memory filesystem, so file contents are stored in RAM rather than on disk. But our file is a FIFO, anyway. Its contents never touch the disk. It would probably be better in ~/.wmii/menu_fifo or the like, though. - I liked more the previous behaviour, when the script ends by sending the input string to stdout (like wimenu does) so that it can can be processed by some independent script like for example this one: I think that you're right in principle. However, I'm going to leave the example as is because it illustrates the purpose of the script better and as it's fully self-contained, it works without modification. In addition I enjoyed adding another minor feature: when a list of options has been declared in the script for the initial command of the input line, every time a '-' is typed at the beginning of a new argument in a line starting with that command, this list of options is displayed instead of a list of files. I find it convenient for some commands, like 'lp' or 'pdfnup' which accept many options, useful to me but that I do not use to remember. I think this is a good idea, and it was what my help file example was meant to suggest. I'd suggest some slight changes, though: --- menu_thing 2010-08-16 20:32:26.0 -0400 +++ - 2010-08-16 20:49:19.051116173 -0400 @@ -5,18 +5,18 @@ # Program name completion requires that a program list already # exist in $(wmiir namespace)/.proglist -fifo="/dev/shm/wim_$USER" +fifo=$HOME/.wmii/menu_fifo mkfifo $fifo 2>/dev/null script=$(cat <<'!' BEGIN { -progs = "cat $(wmiir namespace)/.proglist" +progs = read("cat $(wmiir namespace)/.proglist") # Favorite options for some programs opt["lp"] = "-o media=a4\n-o landscape\n-o sides=two-sided-long-edge\nsides=two-sided-short-edge\n-o number-up=N\n" # Print the first set of completions to wimenu’s fifo -print read(progs) >fifo +print progs >fifo fflush(fifo) } @@ -25,13 +25,17 @@ # Skip the trailing part of the command. # If there is none, this is the result. if (!getline rest) { -print -exit +print +exit } if (!match($0, /.*[ \t]/)) # First argument, provide the program list -update(0, progs) +update(0, "", progs) +else if($NF ~ /^-/) +# If the last argument starts with a -, list +# options declared in opt instead of files +update(RLENGTH, "", opt[$1]) else { # Set the offset to the location of the last # space, and save that part of the completion @@ -46,31 +50,21 @@ # If the last component of the path begins with # a ., include hidden files arg = "" -if(match(str, "(^|/)\\.[^/]*$")) -arg = "-A" +if(str ~ "(^|/)\\.[^/]*$") +arg = "-A " # Substitute ~/ for $HOME/ sub("^~/", ENVIRON["HOME"] "/", str) # Strip the trailing filename -if(match(str, "^/[^/]*$")) -str = "/" str -
Re: [dev] [wmii] C configuration
On Tue, Aug 17, 2010 at 03:05:34AM +0300, Nikhilesh S wrote: Any of you guys use a program in C with libixp for wmii configuration? I have in the past, but not for my entire configuration, just for certain operations. -- Kris Maglione It is impossible to defeat an ignorant man in argument. -William G. McAdoo
Re: [dev] [wmii] wimenu custom completion
On Mon, Aug 16, 2010 at 12:37:54AM +0200, LuX wrote: On Thu, 12 Aug 2010 21:19:52 -0400, Kris Maglione wrote: But if you're looking for a start, this is the above modified to (crudely) complete a command and then files in the current directory: I have an issue with this second variant, which I didn't notice first and am unable to solve. Whether I quit it with Return or Esc, the result is the same: the input string is sent to stdout. If you still want to help… I'm stuck here. Yes, I already fixed that problem when I made it into an example file for distribution. Attached. This is why I left completion up to the program executing the menu. It knows what it's running it for better than I do. ---> I think that this is very clever! Bash completion is excellent, but not customizable (as far as I know). Thus I do agree that it is a good thing that wimenu comes with a much more elementary completion (it is not intended to duplicate bash), but fully customizable (it allows to do other things, even those that bash can not). Bash completion is actually written in bash, so it's very customizable. This is also why it can in theory be used to provide completion results for wimenu, if someone well enough acquainted with its internals puts his mind to it. Example: In bash I have always been missing a history behaving like in vim. Let me explain this. If you have typed a long command 'cmd' at some moment and want to repeat it, you will probably want to use the history. Bash will then display successively all the (possibly numerous) other commands that you typed in the mean time, while vim while jump directly to 'cmd' provided you type only the beginning of it. Using bash history inside wimenu with your script (the 'second variant' mentioned above, which I called 'wim' in another post) allows to recover this nice behaviour of vim, which eventually makes wim a significantly BETTER way (in my opinion) of typing commands than to use a terminal. Just add this to ~/.inputrc: C-w: backward-kill-word C-p: history-search-backward C-n: history-search-forward Although I believe C-r brings up some kind of incrimental search dialog. I don't use bash though, so I'm a bit rusty. PS: I haven't been able to access http://lists.suckless.org/dev/att-5538/menu.pl I take you at your word if you say that it is 'considerably more arcane than the awk version'. Anyway this is one more reason to 'make a point of only using POSIX utilities in examples' as you said. Hm. Silly pipermail. I take it you're not subscribed to the list, then? I'll paste it inline below, although I've a much more sophisticated version now (attached). #!/usr/bin/env perl use warnings; use strict; use IPC::Open2; my $proglist = `wmiir namespace|tr -d "\n"` . "/.proglist"; open2 my $procout, my $procin, "wimenu", "-c"; sub quote(_) { local ($_) = @_; return $_ unless m/[\[\](){}\$'^#~!&;*?|<>\s]/; s/'/''/g; "'$_'"; } my $oldoffset; sub update(&;$) { my ($choices, $offset) = @_; if(not defined $offset or $offset != $oldoffset) { $oldoffset = $offset || 0; print $procin $offset, "\n" if defined $offset; print $procin $choices->(), "\n\n"; } } sub readout(@) { my ($mode, $expr, @rest) = @_; open(my $fd, $mode, $expr, @rest); join "\n", map {chomp; quote} <$fd> } update {readout "<", $proglist}; while(local $_ = <$procout>) { chomp; unless(<$procout>) { print; exit; } if(not /.*\s/) { update {readout "<", $proglist} 0; } else { my $offset = length $&; $_ = substr $_, $offset; my @args = m{(/|^)\.[^/]*$} && ("-A") || (); $offset += length $& if m{.*/}; s,/.*?$,,; update {readout "-|", "ls", @args, $_ || "."} $offset; } } -- Kris Maglione When a religion is good, I conceive it will support itself; and when it does not support itself, and God does not take care to support it so that its professors are obliged to call for help of the civil power, 'tis a sign, I apprehend, of its being a bad one. --Benjamin Franklin wimenu-file-completion.sh Description: Bourne shell script #!/usr/bin/env perl use warnings; use strict; use File::Glob qw(:glob); use IPC::Open2; sub dequote(_); sub quote(_); sub readout(@); sub update(&;$$); open2 my $procout, my $procin, ("wimenu", "-c", @ARGV); sub main() { my $proglist = `wmiir namespace` . "/.proglist"; $proglist =~ s/\n//; update {readout "<", $proglist}; while(local $_ = <$procout>) {
Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines
On Sun, Aug 15, 2010 at 02:14:51PM -0700, Robert Ransom wrote: On Sun, 15 Aug 2010 16:45:13 -0400 Kris Maglione wrote: On Sat, Aug 14, 2010 at 03:29:35PM -0700, Suraj Kurapati wrote: >On Sat, Aug 14, 2010 at 5:18 AM, Alexander Teinum wrote: >> http://github.com/alexanderte/flo > >Congratulations on choosing the ISC license for your project. Too >many projects still use MIT/X these days when ISC is clearly more >suckless IMHO: because it has less LOL (lines of license ;-) Cheers. I refuse to have anything to do with the people responsible for BIND, ISC dhcp, and ISC ntp. They can do no right in my eyes. At any rate, there's nothing wrong with the MIT license. It takes a few seconds longer to read and is just as clear. Plus, it explicitly extends its rights to the documentation and explicitly allows for sublicensing, which ISC doesn't. Dan Bernstein hates BIND, too. Use the DJB license: "Public domain" Yes, hating BIND is Dan Bernstein's trademark. But "public domain" isn't a license, and until recently his code didn't even have that much of a license. -- Kris Maglione If the lessons of history teach us anything it is that nobody learns the lessons that history teaches us.
Re: [dev] [vp] A media website video player/fetcher
On Sun, Aug 15, 2010 at 09:44:43PM +0200, thuban wrote: Le Sun, 15 Aug 2010 05:18:55 -0400, Here is a project that might help you to make vp usable for other websites : http://code.google.com/p/cclive/ I was using cclive to replace flashplugin with a shortkey, exactly as you described above, to read the videos with mplayer for example. but I'll try vp I think. I hadn't come across that one before. Its quvi portion, at least, is a lot better than most of the alternatives, although it seems to need 1500 lines of C to do what I did in a few dozen lines of shell script. I'm don't even understand what the C++ portion is for. But I don't think it will be of much help. The Lua portions are generally pretty clean, but most of the scrapers are easy to write if you've got a mind to write them. And I notice that the YouTube scraper, at least, uses my old method which I had to give up when it began to fail for some videos (which is unfortunate, since it also removed the need for a cookie jar and thus allowed direct streaming by vlc). -- Kris Maglione Testing can only prove the presence of bugs, not their absence. --Edsger W. Dijkstra
Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines
On Sat, Aug 14, 2010 at 03:29:35PM -0700, Suraj Kurapati wrote: On Sat, Aug 14, 2010 at 5:18 AM, Alexander Teinum wrote: http://github.com/alexanderte/flo Congratulations on choosing the ISC license for your project. Too many projects still use MIT/X these days when ISC is clearly more suckless IMHO: because it has less LOL (lines of license ;-) Cheers. I refuse to have anything to do with the people responsible for BIND, ISC dhcp, and ISC ntp. They can do no right in my eyes. At any rate, there's nothing wrong with the MIT license. It takes a few seconds longer to read and is just as clear. Plus, it explicitly extends its rights to the documentation and explicitly allows for sublicensing, which ISC doesn't. P.S. I know that that was tongue-in-cheek, but I'm in the mood to rant... -- Kris Maglione I have always found that plans are useless, but planning is indispensable. --Dwight Eisenhower
Re: [dev][wmii] wimenu custom completion
On Sun, Aug 15, 2010 at 06:25:49AM +, carmen wrote: I couldn't have said it better myself. -- Kris Maglione Lisp has jokingly been called "the most intelligent way to misuse a computer". I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts. --Edsger W. Dijkstra, CACM, 15:10