-
-
Save nvlled/e736fbc17e4416e0ce0c88df85f50271 to your computer and use it in GitHub Desktop.
Awesome (window manager) configuration opening terminal in focused client working directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awful.key({ modkey, }, "Return", | |
function () | |
pid = client.focus.pid | |
cpid = string.gsub(awful.util.pread('pgrep -P ' .. pid), "[\r\n]+$", "") | |
cwd = string.gsub(awful.util.pread('readlink /proc/' .. cpid .. '/cwd'), "[\r\n]+$", "") | |
if string.len(cwd) > 0 then | |
awful.util.spawn(terminal .. ' -cd ' .. cwd) | |
else | |
awful.util.spawn(terminal) | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment