Add monitor input toggle keybindings

This commit is contained in:
2026-04-26 18:42:07 -07:00
parent b596c38cb9
commit 9c2f244309
2 changed files with 14 additions and 0 deletions

View File

@@ -1097,6 +1097,7 @@ addKeys conf@XConfig { modMask = modm } =
, ((hyper, xK_r), spawn "rofi-systemd") , ((hyper, xK_r), spawn "rofi-systemd")
, ((hyper, xK_9), spawn "start_synergy.sh") , ((hyper, xK_9), spawn "start_synergy.sh")
, ((hyper, xK_slash), spawn "toggle_taffybar") , ((hyper, xK_slash), spawn "toggle_taffybar")
, ((hyper, xK_backslash), spawn "$HOME/dotfiles/dotfiles/lib/functions/mpg341cx_input toggle")
, ((hyper, xK_space), spawn "skippy-xd") , ((hyper, xK_space), spawn "skippy-xd")
, ((hyper, xK_i), spawn "rofi_select_input.hs") , ((hyper, xK_i), spawn "rofi_select_input.hs")
, ((hyper, xK_o), spawn "rofi_paswitch") , ((hyper, xK_o), spawn "rofi_paswitch")

View File

@@ -240,6 +240,17 @@ local function toggleAutoColumns()
end end
end end
local function toggleMonitorInput()
hs.task.new("/bin/zsh", function(exitCode)
if exitCode ~= 0 then
notify("Monitor input toggle failed")
end
end, {
"-lc",
"export PATH=\"$HOME/.nix-profile/bin:/run/current-system/sw/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH\"; \"$HOME/dotfiles/dotfiles/lib/functions/mpg341cx_input\" toggle",
}):start()
end
wf:subscribe({ wf:subscribe({
hs.window.filter.windowCreated, hs.window.filter.windowCreated,
hs.window.filter.windowDestroyed, hs.window.filter.windowDestroyed,
@@ -252,6 +263,7 @@ wf:subscribe({
hs.hotkey.bind(hyper, "c", tileFocusedScreen) hs.hotkey.bind(hyper, "c", tileFocusedScreen)
hs.hotkey.bind(hyper, "v", toggleAutoColumns) hs.hotkey.bind(hyper, "v", toggleAutoColumns)
hs.hotkey.bind(hyper, "\\", toggleMonitorInput)
hs.hotkey.bind(hyper, "a", function() hs.hotkey.bind(hyper, "a", function()
focusWindow("left") focusWindow("left")
@@ -358,6 +370,7 @@ end)
bindRgui("c", tileFocusedScreen) bindRgui("c", tileFocusedScreen)
bindRgui("v", toggleAutoColumns) bindRgui("v", toggleAutoColumns)
bindRgui("\\", toggleMonitorInput)
bindRgui("m", function() bindRgui("m", function()
placeFocused(1, 1, 1) placeFocused(1, 1, 1)