os/pkgs/wcwd.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
255 B
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
self:
with self; ''
2023-10-07 15:18:53 +00:00
pid=$(${sway}/bin/swaymsg -t get_tree | ${jq}/bin/jq '.. | select(.type?) | select(.type=="con") | select(.focused==true).pid')
ppid=$(${procps}/bin/pgrep --newest --parent ''${pid})
2021-05-30 19:10:28 +00:00
readlink /proc/''${ppid}/cwd || echo $HOME
''