<commit_before>xcwd - X current working directory
==================================
xcwd is a simple tool which print the current working directory of the
currently focused window.

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
a new terminal for debugging or compiling purpose.

How it works
------------
Since there is no proper options to get the pid of the currently focused
windows, xcwd first try to read the `_NET_WM_PID` property.
If it fails, it reads the `_NET_WM_CLASS` and compares it to the name of
all the running processes (it's kind of `pidof name`).

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.

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.

Disclaimer
----------
This script can't retrieve the working directory of a shell in tmux, screen
or in an instance of urxvtc.

Requirements
------------
- Linux
- libX11-dev

Running xwcd
------------
Simply invoke the 'xcwd' command.

You probably want to use it this way:
    ``urxvt -cd "`xcwd`" ``<commit_msg>Add i3 configuration example in README<commit_after>xcwd - X current working directory
==================================
xcwd is a simple tool which print the current working directory of the
currently focused window.

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
a new terminal for debugging or compiling purpose.

How it works
------------
Since there is no proper options to get the pid of the currently focused
windows, xcwd first try to read the `_NET_WM_PID` property.
If it fails, it reads the `_NET_WM_CLASS` and compares it to the name of
all the running processes (it's kind of `pidof name`).

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.

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.

Disclaimer
----------
This script can't retrieve the working directory of a shell in tmux, screen
or in an instance of urxvtc.

Requirements
------------
- Linux
- libX11-dev

Running xwcd
------------
Simply invoke the 'xcwd' command.

You probably want to use it this way:
    ``urxvt -cd "`xcwd`" ``

i3 Configuration
----------------

You can add a key binding like this one:

    bindsym $mod+Shift+Return exec xcwd | xargs urxvt -cd

{'fraction_non_alphanumeric': 0.10377358490566038, 'fraction_numerical': 0.0021770682148040637, 'mean_word_length': 3.46839546191248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7070741', 'n_tokens_mistral': 749, 'n_tokens_neox': 717, 'n_words': 419}