update Readme
This commit is contained in:
parent
54c82ee7f7
commit
610fd1e7a2
16
README.md
16
README.md
@ -2,30 +2,32 @@ xcwd - X current working directory
|
|||||||
==================================
|
==================================
|
||||||
xcwd is a simple tool which print the current working directory of the
|
xcwd is a simple tool which print the current working directory of the
|
||||||
currently focused window.
|
currently focused window.
|
||||||
|
|
||||||
The main goal is to launch applications directly into the same directory
|
The main goal is to launch applications directly into the same directory
|
||||||
as the focused applications. This is especially useful if you want to open
|
as the focused applications. This is especially useful if you want to open
|
||||||
a new terminal for debugging or compiling purpose.
|
a new terminal for debugging or compiling purpose.
|
||||||
|
|
||||||
How does it works
|
How it works
|
||||||
-----------------
|
------------
|
||||||
Since there is no proper options to get the pid of the currently focused
|
Since there is no proper options to get the pid of the currently focused
|
||||||
windows,
|
windows, xcwd first try to read the `_NET_WM_PID` property.
|
||||||
xcwd first try to read the \_NET\_WM\_PID property. If it fails, it reads the
|
If it fails, it reads the `_NET_WM_CLASS` and compares it to the name of
|
||||||
\_NET\_WM\_CLASS and compares it to the name of all the processes (it's kind of
|
all the running processes (it's kind of `pidof name`).
|
||||||
`pidof name`).
|
|
||||||
|
|
||||||
When xcwd has got the PID, it search the deepest child he has, thus avoiding
|
When xcwd has got the PID, it search the deepest child he has, thus avoiding
|
||||||
getting the working directory of the terminal emulator instead of the shell.
|
getting the working directory of the terminal emulator instead of the shell.
|
||||||
|
|
||||||
Finally it prints the content of `/proc/pid/cwd` on the standard output. If
|
Finally it prints the content of `/proc/pid/cwd` on the standard output. If
|
||||||
xcwd was unable to find the PID, it prints the content of the HOME variable.
|
xcwd was unable to find the PID, it prints the content of the `HOME` variable.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
- Linux
|
||||||
- libX11-dev
|
- libX11-dev
|
||||||
|
|
||||||
Running xwcd
|
Running xwcd
|
||||||
------------
|
------------
|
||||||
Simply invoke the 'xcwd' command.
|
Simply invoke the 'xcwd' command.
|
||||||
|
|
||||||
You probably want to use it this way:
|
You probably want to use it this way:
|
||||||
``urxvt -cd `xcwd` ``
|
``urxvt -cd `xcwd` ``
|
||||||
|
Loading…
Reference in New Issue
Block a user