| Crates.io | ycwd |
| lib.rs | ycwd |
| version | 0.1.0 |
| created_at | 2025-01-18 21:24:37.422034+00 |
| updated_at | 2025-01-18 21:24:37.422034+00 |
| description | Helps replace xcwd on Wayland compositors |
| homepage | |
| repository | https://github.com/blinry/ycwd |
| max_upload_size | |
| id | 1522137 |
| size | 110,396 |
Given the process ID of a terminal emulator, returns its current working directory. This allows you to quickly open a new terminal in the same directory as the currently focused one.
Example usage:
$ ycwd 323994
/home/blinry/wip/ycwd
Specifically, ycwd returns the deepest child process of the given process that is still attached to a tty. This means that it will work for sub-shells in many scenarios.
cargo install ycwd
You will need to find a way to find the correct process ID, how to do that depends on your compositor:
Add a key binding like this:
Mod+Return { spawn "bash" "-c" "kitty --working-directory=$(ycwd $(niri msg --json focused-window | jq .pid))"; }
I'd be happy about a pull request!