[dev] Re: [dwm] How to make R's windows floating?
2009/5/26 Jeremy Jay : > I guess I should have been more explicit: > > { NULL, NULL, "R Graphics", 0, True }, > Then, { NULL, NULL, "R", 0,True }, should have worked. It probably didn't because the window title is set after rules have been applied. It is amazing that after a dozen messages we still don't know which is the class of the window, and in particular if setting it to the right value in the rules fix the problem. No issue about rules should be answered before knowing the output of: xprop |awk ' /^WM_CLASS/{sub(/.* =/, "instance:"); sub(/,/, "\nclass:"); print} /^WM_NAME/{sub(/.* =/, "title:"); print}' Kind regards, PS: Sorry for editing the subject, but I think wmii guys will be thankful. -- - yiyus || JGL .
Re: [dev] Re: [dwm] How to make R's windows floating?
2009/5/27 Anselm R Garbe : > Hi, > > the problem is that R sets the properties at a later point (once the > window has been mapped). > > I propose to add the following key handler to your config.h > > static void reapplyrules(const Arg *arg) { > Client *c; > for(c = clients; c; c = c->next) > applyrules(c); > } > > And bind that to something like Mod1-r. This will reapply all rules to > all windows when executed (might be handy for other things as well). > > Kind regards, > Anselm > I have thought about this before. It would be handy to automaticly "re-tag" some windows. For example, to apply the dev tag to all the browser windows with man pages, or to organize ssh sessions depending on the host. I don't know if I will really be use it, but it is worth a try. -- - yiyus || JGL .
[dev] [ON TOPIC] libixp examples
Sorry if I interrupt your priceless discussion about mailing lists, but I need some help with libixp. Since finding documentation (and/or examples) is not easy, I have decided to write something myself. What I'm doing is keeping tags in a mercurial repository from a very simple Hello World to a more complet 9P server. Explanations are not exhaustive, but having everything in mercurial allows to track changes in a gradual way. With the help of sqweek m9u (thanks sqweek!) I have started with the first steps: http://www.anarchyinthetubes.com/src/hello_libixp I will be progressively adding more content, but it is the first time I touch libixp and could be doing something wrong. Since this is intended be used as a base for someone starting with libixp I want to avoid obvious mistakes, so I'm asking if somebody with more experience could have a look at my code from time to time. Of course, any other comment is welcomed too. Kind regards, -- - yiyus || JGL .
Re: [dev] surf: web browser on archlinux
2009/7/3 Alex Matviychuk : > Also, does anyone know of a good stand alone adblock? Privoxy doesn't > pick up most of the ads adblock targets. > Actually, a good private proxy with greasemonkey support would be really useful for me. I found GrimeApe, but it is written in Java (eek!). -- - yiyus || JGL .
Re: [dev] dwm in a window
2009/7/5 Alexander Polakov : > Well, explaining is not my best (and english too), so better take a > look at a picture > http://rootshell.be/~polachok/trash/dwm-in-a-win.png Well, I think this is awesome, it is sad to see how quickly this thread turned into another dead-end discussion about how much X sucks. There are so many possibilities with nested dwm instances that I think some ideas would be worth trying. I can see its application to web browsers like surf or uzbl, or how a "master dwm" with a nested dwm per tag could be used as a workspaces on top of dwm solution. I can think of better examples, but I have some questions: I had a quick glance at the code and I guess what you are doing is getting control of the windows given in the command line with scan. Is there any reason windows cannot be moved between dwm's on the fly? how difficult would it be to communicate the different dwm instances? (moving clients between them based on rules and user actions would be enough for me, more elaborated interfaces could be possible). Also, I would really like to know where is dwm on a window situated with respect to xephyr and rio, whatever you think about Plan9, running rio inside rio is a great feature, if I can have that with dwm I think is one of the most killer features you could have in a window manager. Don't you think the integration of this feature into dwm could be well worth? Maybe not, maybe it is just a hack or not a good idea at all, but I would like to see some discussion about that. -- - yiyus || JGL .
Re: [dev] [dwm] bug: title rules
2009/7/11 Szabolcs Nagy : > * applyrule()+arrange() is called whenever client title changes +1, but only if the client has no tags yet. -- - yiyus || JGL .
Re: [dev] dwm number of clients pointless?
2009/9/13 Kurt H Maier : > On Sun, Sep 13, 2009 at 2:38 PM, Anselm R Garbe wrote: >> Anyone disagrees that the number of clients indicating recently >> introduced to dwm-5.6+ is pointless and should be removed again? > > It's crucial for monocle, but wastes space in other layouts. > crucial? i have not updated dwm to any version with the counter yet and have never felt the need for it. may i suggest to use only a little indicator in monocle mode to indicate that there are more clients? drawsquare could do the job. -- - yiyus || JGL . 4l77.com
Re: [dev] dwm number of clients pointless?
2009/9/14 Kurt H Maier : > I use surf, and multiple windows in monocle mode have taken the place > of browser tabs. I know *if* I have a window open; the square woun't > tell me whether I have five or fifty. > so what? eventually, you will have to cycle through all your windows until you find the one you are looking for, the counter won't tell you if it is in the position 5 or 50. how does the counter help you when you have fifty windows? -- - yiyus || JGL . 4l77.com
Re: [dev] rule for floating gnuplot window
2009/10/2 : > Does anybody have a clue about what's wrong? > I'm not in front of my box now, so I could be wrong, but I guess the window is mapped before its properties are set. If this is your case, you could write a function that calls applyrules(sel) and call this function from a key combination. Unfortunately, once you make your window float it will have already been resized by dwm. hth, -- - yy.
Re: [dev][dwm] window tagging
2010/1/12 Lorenzo Bolla : > open your browser to youtube; then use xprop to get WM_CLASS and WM_NAME for > that window: > $> xprop | grep -e "WM_CLASS(STRING)" -e "WM_NAME(STRING)" > in config.h put: > { , NULL, , 0, True, -1 }, > hth, > L. > That won't work neither. The problem is the rules are applied when the window is managed, but the title of the window won't change until you reach youtube (after it has been managed by dwm). You could define a reapplyrules() function to apply rules again to the current window, but you would have to call it manually - with a key or something - and, at that point, it would probably be easier to simply make the window floating. -- - yiyus || JGL . 4l77.com
Re: [dev] [dwm] mimic a rio behavior
2010/1/12 Yoshi Rokuko : > If you start i.e. page in a term in rio on plan9, page will 'take' the > 'view' of your term. If you start surf in a term in dwm on linux in > monocle it will look very similar. > > I was thinking about whether it would be easy to design a layout that is > like tiling but like a nested monocle for apps started from uxterm or not. > Would that be a nice feature? > It would be nice, but not easy, not at all. One of the main problems with X is you cannot know where windows come from, that is one of the reasons we use rules to tag them. You could launch all your applications from scripts which set the geometry or give some hint to dwm about what to do with new windows, but I guess you will find a lot of problems following that path. A window can appear in any moment, eg: What if you start surf in a term but just in that moment a pop-up (surf) window appears on the screen? How do you know which is the one you launched? You can probably hack it to work as expected with some application(s), but it will be extremely painful to turn this into a general behavior. -- - yiyus || JGL . 4l77.com
Re: [dev] GSoC 2010
I'm still a student (PhD student, but that's fine for Google), so I will probably apply to participate as a student. Since Go was released I have been playing with it. Is there any interest in the Go port of dwm? This would probably include the improvement of the xgb go package (which I don't know if it is fine, since Google's projects like Go cannot take part in GSoC). Other part of the project could be writing a widget toolkit, at least for the status bar and, eventually, dmenu, but could include more widgets to be a full toolkit (as Kurt suggested), or use the Go draw pkg (which should be inproved too). I have some vague ideas about a layout interface which could be shared between dwm and the widget toolkit. I'm also interesting in porting dio to Go, if you think that would make a nice project or could be included with the dwm port. That said... I think what Google meant about lack of focus is that writing software that sucks less is what everybody is trying, but not a concrete objective. You could call dwm/dmenu/surf and the rest of suckless projects part of a "desktop environment" (I know, I also hate that name) or, even better, a "development environment" (the first one not including an editor!). IOW, I think a goal clearer than "suckless software" is needed. -- - yiyus || JGL . 4l77.com
Re: [dev] GSoC 2010
2010/3/3 Anders Andersson : > On Wed, Mar 3, 2010 at 5:38 PM, yy wrote: >> Since Go was released I have been playing with it. Is there any >> interest in the Go port of dwm? > > What would be the benefits of porting dwm to a new language? From my > point of view, dwm is already functional and mature, porting it over > to Go doesn't sound very constructive. > > // pipe > > I agree there are no inmediate benefits, but there is an incomplete port in the repo (almost nothing) and I was asking if there was any interest in finishing it. Anselm said, when Go was released, that he was considering using Go for future suckless project. Although later he decided he would wait until the language was more mature (which I think was a right decission) I would consider porting dwm as a first (experimental, if you want) step in that direction, not a final goal. Anyway, if there is no interest in the idea, that is perfectly fine, and I won't arguee any more. There are many interesting projects. I just thought I'd let it drop. @pancake: I would use xgb, which implements the X protocol, not C bindings. In any way, I doubt you could notice the speed difference between a Go and a C version of dwm (at least, not running it in normal conditions; of course you could launch thousands of windows to see which one is faster, but that would be even more stupid than porting dwm to Go). @Anselm: I agree a MTA would be a good fit for Go. I would not apply for that one, but it could be included in the ideas list. A werc port would be interesting, I'd like to know uriel's opinion. -- - yiyus || JGL . 4l77.com
Re: [dev] terminal that accepts any size
2010/3/23 Jacob Todd : > You could see if Iosrv[1] works in 9term. > > [1]http://www.9gridchan.org/iosrv/ It does not, but I was talking with mycroftiv about a port to p9p some months ago and it would be not only feasible, but also very interesting. And I'm sure he will be willing to give some help if you ask in #plan9chan (at freenode). -- - yiyus || JGL . 4l77.com
Re: [dev] goblin (9base in Go)
2010/3/29 Jeff Shipley : > The primary reason I went with the optparse library instead of using > flag is that flag doesn't support multiple values for the same flag. > grep -e expression1 -e expression2 -e expression3 > would be completely broken when using the flag package. You can always parse the flags from your program. Gonga reads input files with the -w flag using a 'with' bool var [1]. But anyway, it looks like you can at least read custom flag variables now (eg: []string) [2]. [1] http://www.anarchyinthetubes.com/hg/hgwebdir.cgi/gonga/file/b55a7ea14cd5/gonga.go#l49 [2] http://codereview.appspot.com/842041 -- - yiyus || JGL . 4l77.com
Re: [dev] stderr: unnecessary?
2010/6/11 Matthew Bauer : > Couldn't you just print your error to stdout? Yes, you could: 2>&1 Now look for a real problem and stop trolling. -- - yiyus || JGL . 4l77.com
Re: [dev] plumb 1.0
Maybe you want to have a look at iosrv and hubfs by mycroftiv (see http://www.9gridchan.org/). They offer a similar functionality to your project (what's the new name?), the biggest difference is that they run on plan9 and, therefore, the ends of the pipe are served as a 9p fs. -- - yiyus || JGL . 4l77.com
Re: [dev] How about sta.li ? - libc tangent
2010/8/1 Ethan Grammatikidis : > > Along with support servers this could > ultimately give a very complete Plan 9 experience without any of the > performance issues of virtualisation or the other issues of 9vx. Do you know what would give a more complete Plan 9 experience? Plan 9. I can see the beauty of a GNU-free staticly linked system, it is indeed an interesting project, but it woulld not be too useful for me. The reason I use p9p/9vx on top of unix is because of all the shit I cannot run on a native Plan 9 system, and all that shit (X and web browsers included) is from my pov the real challenge of the project. But why running Plan 9 tools on top of a crippled Unix? I'd really like to know a real use-case where neither a native system neither glibc are feasible solutions. That said, it would probably be easier to fix the issues with 9vx than what you are proposing. Performance is not a real problem, and it can be improved. Bugs can be fixed (let me know if you find any issues). And if 9vx does not fullfill your expectations, just use the real thing. -- - yiyus || JGL . 4l77.com
Re: [dev] [dwm] number of tag limited?
2010/8/5 thuban : > Just a question about dwm, is it possible to have more than 9 tag? You can define as many tags as you want in your config.h file. > My question is, could you create tags only if they are needed (a window > moved in, on drawn in), just like in wmii. I already had written this > question, but no one semmed to know if it was possible to code. Yes, it is possible. Just check that the window is not being used (you can use occ) in drawbar to not draw them. You will also want to modify buttonpress. -- - yiyus || JGL . 4l77.com
Re: [dev] Suckless Way to Learn How To Program
You may want to have a look at the zillions of threads asking this question in reddit.com/r/programming. My personal advice: "Starting Forth" by Leo Brodie. Once he knows some basics, he should learn some more modern language and try to solve problems: his problems. Programming is just a tool, not a goal. -- - yiyus || JGL . 4l77.com
Re: [dev] flo - a command line program for organizing events, to-dos, and deadlines
You could also be interested in http://todotxt.com/ (although I don't really know it, neither have I taken a look at flo) -- - yiyus || JGL . 4l77.com
[dev] Re: [dev] Re: [dev] [dev] Usage, -h, --help, help, s ynopsis, …
2010/8/19 Suraj Kurapati : > On Tue, Aug 17, 2010 at 7:54 PM, 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. :-) > > Alternatively, in simple shell scripts (for which writing a manpage > would be overkill), I simply print the script file's comment header > using sed(1): > > #!/bin/sh > # your program description & usage documentation here > # nicely formatted and beautified to fit 80 columns > # NOTE: the blank line below is the end of the file comment header > > # check command-line usage > if test "$#" -lt 3; then > sed -n '2,/^$/s/^# \?//p' "$0" # show this file's comment header > exit 1 > fi I find this solution really convoluted. Why not using echo? You can use an USAGE variable, or even a here-document and cat<< if you feel like it. And btw, it would probably be a good idea to redirect the help message to stderr. -- - yiyus || JGL . 4l77.com
[dev] Re: [dev] Re: [dev] Re: [dev] Re: [dev] [dev] Usage, -h, --help, help, synopsis, …
2010/8/21 Suraj Kurapati : > I like to put documentation at the head of a file because that's only > part anyone will read before deciding if it's worth spending their > time to delve into the rest of the shell script. Also, I don't like > messing up my program's indentation because I have to emit a big block > of text in it: #!/bin/sh USAGE="\ Usage: $0 -flags args Explain the options here. You even can even use use shell variables! " if [ $# -lt 1]; then echo -n "$USAGE" 1>&2 exit 1 fi Is this really so ugly? -- - yiyus || JGL . 4l77.com
Re: [dev] Usable typesetting system?
I'm using a Markdown-like language to write my phd thesis in LaTeX (I have already used it for my master thesis and several scientific papers). Some day I should probably clean all my stuff and release something, but at this moment is a very ad-hoc thing. Basicly an awk script (find attached) processes titles, emphasis and lists like markdown. Images are included with a tag at the begining of the line. It also supports footnotes, tables (in the same or different files), equations with LaTeX notation, an graphs (processed with gnuplot and the epslatex terminal). Bibliographic references, as well as references to figures and tables, can be included too. In the same way that Markdown can include raw html you can include raw LaTeX here. Makefiles and a series of scripts take care of building everything for me. If anybody is interested maybe I can privately send some of the material, but it won't be very useful without a full example and I'm not allowed to put that in the tubes. Anyway, I suggest to write your own toolset if you are taking this route. -- - yiyus || JGL . 4l77.com md2tex.awk Description: Binary data
Re: [dev] A language similar to Markdown that sucks less
2010/8/22 Alexander Teinum : > I think the > parser should be implemented in Go. Why? It looks like something much easier to do with lisp. -- - yiyus || JGL . 4l77.com
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
It is difficult to form an opinion about a language if there is no documentation or any examples, and it is difficult to form an opinion about the implementation without understanding the language. What features does it have? How does it look like? How does it compare to other stack-based languages like toka or raven? -- - yiyus || JGL . 4l77.com
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
2010/8/25 Kris Maglione : > On Wed, Aug 25, 2010 at 01:54:37PM +0200, pancake wrote: >> * 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. The fact that shells normally use single quotes for literal text strings is an argument in favor of double quotes in a scripting language. It makes much easier to embed it in shell scripts (see awk, for example). >> * 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. Conditionals are not really a part of Forth (actually, it is considered good style to avoid them), neither are code blocks. The most common implementation would use IF ... THEN, in the example: 3 3 == IF 'Is equal duppy\n' print THEN I find this construction really confusing. FWIW, I prefer laforth style. However, one idea that has been around my head for some time now is a language with different stacks for each type. Then, you would have a blocks stack and a booleans stack. If would take the top value from the bool stack and, if true, would execute the top value of the block stack. This way, it would not matter if you use 3 3 == { 'Is equal duppy\n' print } if or { 'Is equal duppy\n' print } 3 3 == if I have many other ideas for a stack based scripting language (probably many of them are bad ideas). I was planning to play with some of these ideas myself without even bringing them to discussion, but it looks like, surprisingly, there is some interest in the suckless community... (although I still have the feeling we should move this discussion somewhere else). -- - yiyus || JGL . 4l77.com
Re: [dev] nscript - a little stack-based scripting language interpretter I 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. -- - yiyus || JGL . 4l77.com
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
2010/8/26 Kris Maglione : > 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). 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? 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). This is not what you are proposing. In postscript, toka, raven, even factor, all of them stack based languages with quotations, the condition goes before the true/false blocks. -- - yiyus || JGL . 4l77.com
Re: [dev] nscript - a little stack-based scripting language interpretter I wrote
2010/8/26 Kris Maglione : >> 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? Sorry, of course it is a branch. Yes, Forth has branches. I was thinking about quotations. I will shut up now, I don't think this discussion is going anywhere. However, feel free to point me to a stack based language which uses the '{ quotation } condition if' construction, I have never heard of any. -- - yiyus || JGL . 4l77.com
Re: [dev] libdraw development
2010/9/3 Connor Lane Smith : >> Oh, wait, you are creating a new library that uses those libraries! So >> I guess that makes it all OK. Not. > > You are aware P9P's libdraw depends on Xlib? It doesn't. libdraw uses a custom protocol to speak with devdraw, which is a separate program and the only one in p9p which really depends on xlib. It is so to avoid having to write multithreaded applications for every graphical program, as it would happen if 9p was used, as it is in Plan 9. There is no reason you cannot rewrite devdraw using any other backend, and the p9p applications which use it would not need even a recompile. This model works well enough in p9p, but would be stupid in a tool like, for example, dmenu. I understand what's the idea behind yours libdraw, and I agree it is a fair goal but, please, change the name. By the way, why a file per function? I think that's crazy, and don't fit very well with the rest of everything-in-a-big-file suckless projects. -- - yiyus || JGL . 4l77.com
Re: [dev] [dwm] tagging interface
2010/9/21 Wolf Tivy : > I would like to change the way tag selection works in my dwm. > The way I think it should work is if you press two (or more) tag > select keysbefore you release one of them, dwm would select both > tags. Likewise for tagging windows. I think this would make the > tagging stuff much more usable and intuitive. I'm not sure I'm understanding what you mean but I think you can achieve that only changing your config: #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, toggleview, {.ui = 1 << TAG} }, \ (n.b. toggleview instead of view) You don't need to release modkey to toggle more tags, so there is no much difference with what you are suggesting. The only "problem" I see is that your previous tags won't be remembered, I don't know if that is important for you. Maybe what you want is to always set tags and not toggle them (how do you deactivate tags then?), for that you will need to write your own function, but it is a simple matter of using another boolean operator. -- - yiyus || JGL . 4l77.com
Re: [dev] [dwm] tagging interface
2010/9/22 Wolf Tivy : > Sorry for being unclear. Not quite like toggle. I mean when you press a > tag key it does the normal thing (tags = newtag or whatever), but then > if you press more tag keys before you release any of them it adds them > to the selection (like tags |= newtag). So if you mash a key combo like > MOD-1-2 and then release, it selects 1 and 2. Likewise with tagging > clients. Ok. Thanks for the explanation. I get it now: the first one pressed is like view() and the next ones without releasing are like toggleview(). > Whats this about previous tags? I found something fitting that description > in the source but I can't figure out why it's done like that or where it gets > used. > Is there some 'previous selection' function somewhere? If not, why is that > ugliness in there? By the previous tags I mean the other tagset. It can be toggled with view(0), MODKEY+Tab by default. If you want to add that functionality to your patch add selmon->seltags ^= 1; /* toggle sel tagset */ before selmon->tagset[selmon->seltags] = newtags; It will probably be useful to you if you normally work with several selected tags. -- - yiyus || JGL . 4l77.com
Re: [dev] [dwm] tagging interface
2010/9/23 Wolf Tivy : > If someone can elaborate on the motivation and use-cases for the toggle, > I might be better able to give it the right semantics with the combo stuff. > From my understanding it's no longer necessary as it was simply a > mechanism to cache your tagset which was microtedious to generate > using toggle. Can someone confirm? I guess everybody uses dwm in different ways. Mine includes having what we could call a "main view" which most of the time is only one tag but, quite often, includes some more. For me is very convenient to have the toggle so I can temporally select only one of those tags, or can change to another one for a second to check or set something. In fact, viewing a tag for a second and come back to what I was doing is something I do so often that I use a vieworprev(arg) which toggles the tagset if is equal to arg (this is somewhere in the wiki). On the other hand, I have never felt the need to set more than one tag at a time (which seems to be what your patch does). Instead, I prefer to set tags one by one, as I need them. The only exception is when I want to go back to a previous state, and I prefer that dwm takes care of remembering and setting them instead of saving 9 lines of code. Different people, different work flows, different config.h files. -- - yiyus || JGL . 4l77.com
Re: [dev] xmessage replacement similar to dmenu
You could have a look at dio: http://code.google.com/p/dynamic-io/ It does much more things than what you want, the code has not been updated in a while and anyway some of its features were simply wrong ideas (I always treated dio as a toy to experiment more than a final product). However, you could probably reuse some code. I don't think trying to fit every text based application into dmenu is a good idea. -- - yiyus || JGL . 4l77.com
Re: [dev] [ANNOUNCE] abduco-0.3
I have attached two patches for discussion: - abduco_default.diff: run a default action when no flag is given ('A', but configurable in config.h) - abduco_force.diff: remove -C mode, in favour of a -f flag that works with -c, -n or -A, which forces the creation of a new session when there is an existing but already terminated session of the same name. So, the "old": abduco -C session command is replaced by: abduco -f -c session command To always connect to a session, creating it if it does not exist or was terminated, you can do: abduco -f session command Both features are independent. I think the force flag is a real improvement over -C, but the default action is just a convenience. It can be argued that an alias solves the same problem better. At the end, it is mostly a style decision and I don't have a strong opinion. -- - yiyus || JGL . diff --git a/abduco.1 b/abduco.1 index e9a7448..b2d2a59 100644 --- a/abduco.1 +++ b/abduco.1 @@ -6,6 +6,13 @@ abduco - terminal session manager .B abduco .RB [ \-e .IR detachkey ] +.RB name +.RB command +.RI [ args \ ... "" ] +.br +.B abduco +.RB [ \-e +.IR detachkey ] .RB \-c .RB name .RB command @@ -106,6 +113,7 @@ Create a new session but do not attach to it. .TP .BI \-A Try to connect to an existing session, upon failure create said session and attach immediately to it. +This is the default action when no flags are specified. .TP .BI \-a Attach to an existing session. diff --git a/abduco.c b/abduco.c index 84fa382..ed1e139 100644 --- a/abduco.c +++ b/abduco.c @@ -477,7 +477,7 @@ static int list_session(void) { } int main(int argc, char *argv[]) { - char **cmd = NULL, action = '\0'; + char **cmd = NULL, action = ACTION_DEFAULT; server.name = basename(argv[0]); gethostname(server.host+1, sizeof(server.host) - 1); if (argc == 1) @@ -527,7 +527,7 @@ int main(int argc, char *argv[]) { cmd[0] = "dvtm"; } - if (!action || !server.session_name || + if (!server.session_name || ((action == 'c' || action == 'C' || action == 'A') && client.readonly)) usage(); diff --git a/config.def.h b/config.def.h index b52452e..7e67cbe 100644 --- a/config.def.h +++ b/config.def.h @@ -1,2 +1,3 @@ static char KEY_DETACH = CTRL('\\'); static char KEY_REDRAW = 0; +static char ACTION_DEFAULT = 'A'; diff --git a/abduco.1 b/abduco.1 index b2d2a59..026ef77 100644 --- a/abduco.1 +++ b/abduco.1 @@ -19,14 +19,6 @@ abduco - terminal session manager .RI [ args \ ... "" ] .br .B abduco -.RB [ \-e -.IR detachkey ] -.RB \-C -.RB name -.RB command -.RI [ args \ ... "" ] -.br -.B abduco .RB [ \-r ] .RB [ \-e .IR detachkey ] @@ -100,13 +92,12 @@ Readonly session, i.e. user input is ignored. .BI \-e \ detachkey Set the key to detach which by default is set to CTRL+\\ i.e. ^\\ to detachkey. .TP -.BI \-c -Create a new session and attach immediately to it. +.BI \-f +Force creation of session when there is an already terminated session of the same name, +after showing its exit status. .TP -.BI \-C -Show the exit status of an already terminated session, and create a new session under the same name. -If the session does not exist, it acts like .BI \-c +Create a new session and attach immediately to it. .TP .BI \-n Create a new session but do not attach to it. diff --git a/abduco.c b/abduco.c index ed1e139..1d97fd4 100644 --- a/abduco.c +++ b/abduco.c @@ -431,7 +431,7 @@ static bool attach_session(const char *name, const bool terminate) { exit(status); } - return true; + return terminate; } static int session_filter(const struct dirent *d) { @@ -477,6 +477,7 @@ static int list_session(void) { } int main(int argc, char *argv[]) { + bool force = false; char **cmd = NULL, action = ACTION_DEFAULT; server.name = basename(argv[0]); gethostname(server.host+1, sizeof(server.host) - 1); @@ -510,6 +511,9 @@ int main(int argc, char *argv[]) { *esc = CTRL(esc[1]); KEY_DETACH = *esc; break; + case 'f': + force = true; + break; case 'r': client.readonly = true; break; @@ -545,8 +549,9 @@ int main(int argc, char *argv[]) { redo: switch (action) { - case 'C': - if (set_socket_name(&sockaddr, server.session_name)) { + case 'n': + case 'c': + if (force && set_socket_name(&sockaddr, server.session_name)) { struct stat sb; if (stat(sockaddr.sun_path, &sb) == 0 && S_ISSOCK(sb.st_mode)) { if (sb.st_mode & S_IXGRP) { @@ -557,17 +562,17 @@ int main(int argc, char *argv[]) { return 1;
Re: [dev] [ANNOUNCE] abduco-0.3
On 26 February 2015 at 07:18, David Phillips wrote: > Being the author of the initial patch, Marc has reminded me to submit > any feedback I have on the abduco_force patch, which will supersede my > contribution. I did initially think of using a -f option, but didn't > think there would be a need for any other option to be forced. This is > how I ended up using a capital C rather than a -f option. Thank you for the feedback. The reason I find the -f option useful with -A is that now I can run abduco -f -A session, for example when I start a ssh, to always get a running session (either attaching, creating a new one or finishing a terminated one and creating another). A small convenience. > That being said, I have no opposition to the abduco_force patch, as > abduco will still offer the same functionality. I'm not one for > getting precious over changes to command line options. Neither I plan to fight anybody over -f. At the end of the day, I think abduco is mostly called from shell scripts, so all the logic should probably be moved there. I think it was an error to add the -A option to dtach (it should have been achieved by dtach -a || dtach -c), but now that it is there, it is easy to make an argument for -C or -f. -- - yiyus || JGL .
Re: [dev] [ANNOUNCE] abduco-0.3
On 26 February 2015 at 15:59, Marc André Tanner wrote: > > Please provide feedback whether this works as expected. LGTM > Thanks Thanks to you! -- - yiyus || JGL .
Re: [dev] Re: [9base] Failure to link against uClibc: undefined references
2012/2/28 Matthew Farkas-Dyck : > I agree. A quick search yielded this: http://9fans.net/archive/2006/06/463 > Not sure where the patch is, though. > http://groups.google.com/group/comp.os.plan9/browse_thread/thread/f0db71974854590f/ac36ad084329a733#ac36ad084329a733 It won't solve your problem, though. -- - yiyus || JGL .
Re: [dev] l9fb: Linux framebuffer over 9p server
On 26 December 2013 12:59, Jens Staal wrote: > Would it be possible to hook up the "devwsys" to this? I don't understand what you want to "hook up". devwsys gives you a 9P connection to a rio(1)-like window system on top of Xlib. It lets you to use an X window as a Plan 9 terminal. l9fb, as far as I understood, gives you a 9P connection to a Linux framebuffer. It would be nice to have a fb version of libdraw, then we could use devwsys without X. This is probably not so difficult, something that could be done in the framework of a GSoC project, for example. You could maybe build such a thing on top of l9fb, but I don't think this would be such an improvement over directly using the fb device. Regards, -- - yiyus || JGL .