os/overlays/pub-solar/wcwd.nix

6 lines
231 B
Nix
Raw Normal View History

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