fix(hyprland): pinch to zoom

This commit is contained in:
Barrett Ruth 2026-02-17 00:19:29 -05:00
parent 24ec763546
commit 5e5ba5a5da
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 23 additions and 2 deletions

View file

@ -60,8 +60,8 @@ animations {
}
gestures {
gesture = 2, pinchin, cursorZoom, 1.75
gesture = 2, pinchout, cursorZoom, -1.75
gesture = 2, pinchin, cursorZoom, 1.5, mult
gesture = 2, pinchout, cursorZoom, 0.667, mult
gesture = 3, horizontal, workspace
gesture = 3, down, dispatcher, exec, ctl wallpaper lock && hyprlock
}

View file

@ -0,0 +1,21 @@
vim.keymap.set('n', '<leader>t', function()
if vim.fn.executable('sioyek') ~= 1 then
return vim.notify('sioyek not found', vim.log.levels.ERROR)
end
if vim.fn.executable('hyprctl') ~= 1 then
return vim.notify('hyprctl not found', vim.log.levels.ERROR)
end
local pdf = vim.fn.expand('%:p:r') .. '.pdf'
local basename = vim.fn.fnamemodify(pdf, ':t')
local ret = vim.system({ 'hyprctl', 'clients', '-j' }):wait()
if ret.code == 0 then
for _, c in ipairs(vim.json.decode(ret.stdout)) do
if (c.class or ''):lower():find('sioyek')
and (c.title or ''):find(basename, 1, true) then
vim.system({ 'hyprctl', 'dispatch', 'closewindow', 'address:' .. c.address })
return
end
end
end
vim.system({ 'sioyek', pdf })
end, { buffer = true })