[dev][dwm] Floating window center position fix

2011-07-20 Thread lolilolicon
I have a rule in config.h for MPlayer to always float. The bug was observed when I played a 720p video whose window was 1280 pixels so it filled the width of my laptop screen. The MPlayer window was supposed to be centered, but a border line on the left was clearly visible. For further confirmation

[dev][dmenu] loadfont() segmentation fault patch

2011-07-22 Thread lolilolicon
To reproduce the segmentation fault: dmenu -fn "-windows-montecarlo-medium-r-normal--11-110-72-72-c-60-microsoft-cp1252" <<< hello The culprit is loadfont(). This font[1] triggers XLoadQueryFont(), and loadfont() fails in the for loop. At least that's what my quick debug indicated. I did a diff

[dev] [dmenu] dmenu_run improvements

2011-07-23 Thread lolilolicon
dmenu_run doesn't really run the user input as a shell command line. For instance, run dmenu_run from a terminal, then in the menu type: echo hello\ world The terminal output is "hello\ world" instead of "hello world". `eval' solves the problem, but when it comes to eval, I can't really be sur

Re: [dev] [dmenu] dmenu_run improvements

2011-07-23 Thread lolilolicon
On 07/24/11 at 01:34am, Dave Reisner wrote: > #!/bin/sh > > CACHE=${XDG_CACHE_HOME:-"$HOME/.cache"}/dmenu_run > IFS=: > LC_COLLLATE=C You got a typo here: LC_COLLATE > > gencache() { > lsx $PATH | sort -u >"$CACHE" > } Since LC_COLLATE is only used for sort, we might as well just use: LC_CO

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On 07/24/11 at 11:38am, anonymous wrote: > On Sun, Jul 24, 2011 at 02:34:22PM +0800, lolilolicon wrote: > > > unset IFS > > > > > > cmd=$(dmenu "$@" < "$CACHE") && eval exec "$cmd" > > Yeah, I see you

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 4:40 PM, Anselm R Garbe wrote: > On 24 July 2011 08:38, anonymous wrote: >> On Sun, Jul 24, 2011 at 02:34:22PM +0800, lolilolicon wrote: >>> > unset IFS >>> > >>> > cmd=$(dmenu "$@" < "$CACHE") &&

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 4:39 PM, Anselm R Garbe wrote: > On 24 July 2011 06:34, Dave Reisner wrote: >> On Sun, Jul 24, 2011 at 12:35:19PM +0800, lolilolicon wrote: >>> dmenu_run doesn't really run the user input as a shell command line. >>> For instance, run dm

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 5:06 PM, Anselm R Garbe wrote: > Nevertheless, I can see that script should be improved (not using the > ls -dt invocation), but I prefer the back ticks (even if $(..) is > POSIX, there were a couple of issues in the past that I barely > remember) and I want explicit test c

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 6:41 PM, lolilolicon wrote: > cmd=`dmenu "$@" < "$CACHE"` && eval exec "$cmd" > > NOTE: > The (subshell) is used so the declarations won't get inherented, but > the user still has access to the $CACHE and $cmd

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 9:09 PM, Connor Lane Smith wrote: > On 24 July 2011 06:34, Dave Reisner wrote: >> if [ "$path" -nt "$CACHE" ]; then > > 'test -nt' is non-portable. I think you've just discovered why we use > the 'ls -dt' hack. > > I agree that dmenu_run isn't the nicest script in existenc

Re: [dev] Re: [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 10:08 PM, Christian Neukirchen wrote: > anonymous writes: > >> On Sun, Jul 24, 2011 at 02:34:22PM +0800, lolilolicon wrote: >>> > unset IFS >>> > >>> > cmd=$(dmenu "$@" < "$CACHE") && e

Re: [dev] [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 10:09 PM, Dave Reisner wrote: > On Sun, Jul 24, 2011 at 10:00:09PM +0800, lolilolicon wrote: >> Sorry, but can you give an example where `test -nt' is not available? >> Or can you point out what do you refer to to determine the portability >>

Re: [dev] Re: [dmenu] dmenu_run improvements

2011-07-24 Thread lolilolicon
On Sun, Jul 24, 2011 at 10:30 PM, lolilolicon wrote: > On Sun, Jul 24, 2011 at 10:08 PM, Christian Neukirchen > wrote: >> anonymous writes: >> >>> On Sun, Jul 24, 2011 at 02:34:22PM +0800, lolilolicon wrote: >>>> > unset IFS >>>> &g

Re: [dev] Ranger, a textbased filemanager

2011-10-23 Thread lolilolicon
On Mon, Oct 24, 2011 at 6:01 AM, Bjartur Thorlacius wrote: >> if the task is 'waste a bunch of screen real estate' then no, ranger >> is a far better choice >> > The current combination of a shell and a terminal emulator is > horrible. I've found myself doing stuff like: > > exec /dev/tty2 2>/dev/

[dev] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
The idea of having more than one master windows is brilliant. The `tile' layout in current hg tip basically splits the master and slave areas vertically, and tiles windows in each of the two areas using a vertical stacking algorithm. The `ncol' layout does it slightly differently by tilling the m

[dev] [dwm] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
The idea of having more than one master window is brilliant. The `tile' layout in current hg tip basically splits the master and slave areas vertically, and tiles windows in each of the two areas using a vertical stacking algorithm. The `ncol' layout does it slightly differently by tilling the ma

[dev] Re: [dwm] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
On Mon, Oct 31, 2011 at 9:49 PM, lolilolicon wrote: > > The code is in the attachment. > *huge facepalm* Forgot to attach the fixed code. Attached here. typedef struct { int x, y, w, h; } Booth; static void apply_lt(Monitor *m, void (*ltf)(Client **, Booth *, unsigned int)); st

Re: [dev] Re: [dwm] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
On Mon, Oct 31, 2011 at 10:19 PM, Thomas Dahms wrote: > > That looks interesting. I have one suggestion for a simplification: > I guess you can get rid of the functions combining the master and > slave layouts by modifying setlayout() to take three arguments (the > two layouts and the direction of

Re: [dev] Re: [dwm] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
On Tue, Nov 1, 2011 at 12:11 AM, lolilolicon wrote: > > Actually, `apply_lt` can be removed, since `apply_mslts` does the same > thing when nmaster == 0.  I'm thinking of making nmaster a member of > the Layout structure, instead of the current Monitor.  This way, we can > mak

Re: [dev] Re: [dwm] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
On Tue, Nov 1, 2011 at 7:36 AM, Rob wrote: > > I don't have much time today, or possibly tomorrow, but I'm interested > in this patch, it sounds almost like it recurses on each sub-section of > the total area, applying a different layout function each time, except > it's limited to two calls, one

Re: [dev] A general approach to master-slave layouts

2011-10-31 Thread lolilolicon
On Tue, Nov 1, 2011 at 8:41 AM, Connor Lane Smith wrote: > Hey, > > On 31/10/2011, lolilolicon wrote: >> The idea of having more than one master windows is brilliant.  The `tile' >> layout in current hg tip basically splits the master and slave areas >> vertical

Re: [dev] Re: [dwm] A general approach to master-slave layouts

2011-11-01 Thread lolilolicon
On Tue, Nov 1, 2011 at 6:20 PM, Anselm R Garbe wrote: > On 1 November 2011 00:07, lolilolicon wrote: >> Indeed mfact and nmaster being members of Layout does make more sense, and >> I made a patch which includes this change. >> >> Note that this may seem to add

Re: [dev] Re: [dwm] A general approach to master-slave layouts

2011-11-01 Thread lolilolicon
On Tue, Nov 1, 2011 at 11:38 PM, Anselm R Garbe wrote: > On 1 November 2011 16:27, lolilolicon wrote: >> But now I realize another problem with moving mfact/nmaster to Layout. >> The issue is two monitors should be able to use different mfact/nmaster >> values for the s

Re: [dev] Re: [dwm] A general approach to master-slave layouts

2011-11-02 Thread lolilolicon
I believe every master-slave layout, i.e., layouts where mfact/nmaster make sense, should own its own mfact/nmaster value, not to be disturbed by other layouts. As said before, `col' and `tile' for example just can't share the same mfact and still both look good. Consequently, I decided to update

Re: [dev] A general approach to master-slave layouts

2011-11-06 Thread lolilolicon
On Mon, Nov 7, 2011 at 3:28 AM, Connor Lane Smith wrote: > Hey, > > I've been thinking about this patch for a while, and I've knocked > together a patch which takes an alternative approach, which seems to > result in a simpler diff. > > In my patch each layout has three arrangement functions, one

Re: [dev] A general approach to master-slave layouts

2011-11-06 Thread lolilolicon
On Mon, Nov 7, 2011 at 11:15 AM, lolilolicon wrote: > >  * Port my original spiral layout to play with this patch. I've simplified the spiral layout by rusing tile{h,v}. Nice. void spiral(Client *c, float fact, XRectangle *r, XRectangle *rp) { if(fact == 0) { rp->width =