Files
dotfiles/config/hypr/hyprland/binds/device.lua
T

51 lines
1.6 KiB
Lua

return function(is_laptop)
local function exit_submap()
hl.dispatch(hl.dsp.submap("reset"))
end
hl.define_submap("device", function()
hl.bind("m", function()
hl.dispatch(hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"))
exit_submap()
end)
if is_laptop then
hl.bind("d", function()
hl.dispatch(hl.dsp.exec_cmd("notify-send 'Set to mirror internal display' --app-name'Hyprctl'"))
hl.monitor({
output = "HDMI-A-1",
mirror = "eDP-1",
})
exit_submap()
end)
hl.bind("e", function()
hl.dispatch(hl.dsp.exec_cmd("notify-send 'Set to expand internal display' --app-name'Hyprctl'"))
hl.monitor({
output = "HDMI-A-1",
mirror = "",
})
exit_submap()
end)
end
hl.bind("Shift + T", function ()
hl.device({
name = "pnp0c50:00-093a:0255-touchpad",
enabled = false
})
hl.dispatch(hl.dsp.exec_cmd("notify-send 'Disabled Trackpad' --app-name='Hyprctl'"))
end)
hl.bind("T", function ()
hl.device({
name = "pnp0c50:00-093a:0255-touchpad",
enabled = true
})
hl.dispatch(hl.dsp.exec_cmd("notify-send 'Enabled Trackpad' --app-name='Hyprctl'"))
end)
hl.bind("Escape", function()
exit_submap()
end)
end)
end