Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
Suraj N. Kurapati sun...@gmail.com writes: On Thu 24 Nov 2011 05:12:17 PM PST, Stephen Paul Weber wrote: Somebody signing messages as Suraj N. Kurapati wrote: the ability to open new programs in the currently focused client's workdir. https://github.com/sunaku/.dwm/compare/tip...spawn_cwd Does this patch just work on xterm/rxvt windows that happen to have their CWD path in the title? Not just; it works for *any* window that has a file path in its title. Alternative/additional idea: look for the process indicated by the _NET_WM_PID property, then use the working directory of that process. -- \ Troels /\ Henriksen
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On Fri, Nov 25, 2011 at 09:54:44AM +0100, Troels Henriksen wrote: Suraj N. Kurapati sun...@gmail.com writes: On Thu 24 Nov 2011 05:12:17 PM PST, Stephen Paul Weber wrote: Somebody signing messages as Suraj N. Kurapati wrote: the ability to open new programs in the currently focused client's workdir. https://github.com/sunaku/.dwm/compare/tip...spawn_cwd Does this patch just work on xterm/rxvt windows that happen to have their CWD path in the title? Not just; it works for *any* window that has a file path in its title. Alternative/additional idea: look for the process indicated by the _NET_WM_PID property, then use the working directory of that process. I don't understand the feature. I appears to assume that all clients run on the same host? Kurt
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
Kurt Van Dijck kurt.van.di...@eia.be writes: On Fri, Nov 25, 2011 at 09:54:44AM +0100, Troels Henriksen wrote: Suraj N. Kurapati sun...@gmail.com writes: On Thu 24 Nov 2011 05:12:17 PM PST, Stephen Paul Weber wrote: Somebody signing messages as Suraj N. Kurapati wrote: the ability to open new programs in the currently focused client's workdir. https://github.com/sunaku/.dwm/compare/tip...spawn_cwd Does this patch just work on xterm/rxvt windows that happen to have their CWD path in the title? Not just; it works for *any* window that has a file path in its title. Alternative/additional idea: look for the process indicated by the _NET_WM_PID property, then use the working directory of that process. I don't understand the feature. I appears to assume that all clients run on the same host? Yes, which is not guaranteed, but often the case. -- \ Troels /\ Henriksen
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
Troels Henriksen a écrit : Alternative/additional idea: look for the process indicated by the _NET_WM_PID property, then use the working directory of that process. It seems the value of _NET_WM_PID is not always useful: For urxvtc clients, it is equal to the pid of urxvtd. -- Bastien
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On Fri 25 Nov 2011 01:00:58 PM PST, Bastien Dejean wrote: Troels Henriksen a écrit : look for the process indicated by the _NET_WM_PID property, then use the working directory of that process. It seems the value of _NET_WM_PID is not always useful: For urxvtc clients, it is equal to the pid of urxvtd. Indeed, I already tried that approach[1] and found that it becomes too complex (need to walk process tree) before patching DWM itself. [1]: https://github.com/sunaku/home/blob/master/bin/xcd -- Hackers are just a migratory lifeform with a tropism for computers. signature.asc Description: PGP signature
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On Fri 25 Nov 2011 10:11:35 AM PST, Kurt Van Dijck wrote: Suraj N. Kurapati wrote: the ability to open new programs in the currently focused client's workdir. https://github.com/sunaku/.dwm/compare/tip...spawn_cwd I don't understand the feature. It's all about spatial locality. When I'm editing some code in Vim, I like to launch some new terminals (or file managers) in the same working directory as the file I'm editing to do additional things. Without this feature, I have to *manually* navigate to that working directory in the helper application (terminal or file manager) that I launched. This becomes tiresome and inefficient as time goes on. I appears to assume that all clients run on the same host? Yes, and that's good enough for me. However, in the case that the remote client's title contains a path that also exists on the local machine (perhaps network mounted on both local remote machines) then your newly launched program will start in your local directory. -- On the eighth day, God created FORTRAN. signature.asc Description: PGP signature
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On 25 November 2011 20:39, Suraj N. Kurapati sun...@gmail.com wrote: Yes, and that's good enough for me. However, in the case that the remote client's title contains a path that also exists on the local machine (perhaps network mounted on both local remote machines) then your newly launched program will start in your local directory. There is the WM_CLIENT_MACHINE property, if need be. It would be nice if there were a more definitive way of doing this, but I can't think of one. cls
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
It's all about spatial locality. When I'm editing some code in Vim, I like to launch some new terminals (or file managers) in the same working directory as the file I'm editing to do additional things. Ever tried :!your_terminal in vim? Maybe that's good enough for you if bound to some key.
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On Fri 25 Nov 2011 10:42:31 PM PST, Julian Dammann wrote: It's all about spatial locality. When I'm editing some code in Vim, I like to launch some new terminals (or file managers) in the same working directory as the file I'm editing to do additional things. Ever tried :!your_terminal in vim? Maybe that's good enough for you if bound to some key. Thanks for the suggestion, but it's not as pleasant as being able to press my app launching shortcut keys (for urxvt, thunar, gvim) in DWM on any selected window and have those apps launched in its working dir. This patch affects DWM's program menu (dmenu_run) too, for more power. -- Certainly the game is rigged. Don't let that stop you; if you don't bet, you can't win. -- Robert Heinlein, Time Enough For Love signature.asc Description: PGP signature
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On 2011-11-25 22:42, Julian Dammann wrote: It's all about spatial locality. Ever tried :!your_terminal in vim? Maybe that's good enough for you if bound to some key. autocmd BufEnter * cd %:p:h for when you use multiple buffers in vim.
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
On Sat 26 Nov 2011 08:28:26 AM PST, Patrick Haller wrote: autocmd BufEnter * cd %:p:h for when you use multiple buffers in vim. set autochdir -- Bus error -- please leave by the rear door. signature.asc Description: PGP signature
Re: [dev] [dwm] [PATCH] spawn_cwd - spawn from current client's cwd
Somebody signing messages as Suraj N. Kurapati wrote: one of the things I missed from my previous WMII configuration was the ability to open new programs in the currently focused client's workdir. So I ported this feature to DWM using just 27 SLOC in this[2] patch, [2]: https://github.com/sunaku/.dwm/compare/tip...spawn_cwd Does this patch just work on xterm/rxvt windows that happen to have their CWD path in the title? -- Stephen Paul Weber, @singpolyma See http://singpolyma.net for how I prefer to be contacted edition right joseph signature.asc Description: Digital signature