change test for automap (do not execute lsusb on ssh)

This commit is contained in:
fiplox 2023-01-03 15:18:25 +00:00
parent 3974ab5bb4
commit 1a3744d95e
1 changed files with 8 additions and 5 deletions

View File

@ -86,13 +86,16 @@ function UnMapDHM()
vim.api.nvim_del_keymap('n', 'N') vim.api.nvim_del_keymap('n', 'N')
end end
if os.getenv 'SSH_TTY' then
MapDHM()
else
local handle = io.popen 'lsusb | grep -c Sofle' local handle = io.popen 'lsusb | grep -c Sofle'
local automap = handle:read '*n' local automap = handle:read '*n'
handle:close() handle:close()
if not automap then
if not automap or os.getenv 'SSH_TTY' then
MapDHM() MapDHM()
end end
end
local wk = require 'which-key' local wk = require 'which-key'