keybind.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. local _kw = require('kiwmi')
  2. local _lt = require('layout')
  3. local keybinds = {
  4. -- super -- -- alt -- -- ctrl -- -- shift -- -- -- key -- -- -- action --
  5. { true, false, false, false, 'Return', function() kiwmi:spawn("footclient") end },
  6. { true, false, false, false, 'space', function() kiwmi:spawn("kickoff") end },
  7. { true, false, true, true, 'q', function() kiwmi:quit() end },
  8. { true, false, false, false, 'q', function() local v = kiwmi:focused_view() if v then v:close() end end },
  9. { true, false, false, false, 'Tab', function() _kw:focusViewNext() end },
  10. { true, false, false, true, 'Tab', function() _kw:focusViewPrev() end },
  11. { true, false, false, false, 'm', function() _kw:focusViewLast() end },
  12. { true, false, false, true, 'm', function() _kw:makeViewLast() end },
  13. { true, false, false, false, 'comma', function() _lt:decMasterWidth() end },
  14. { true, false, false, false, 'period', function() _lt:incMasterWidth() end },
  15. { true, false, false, true, 'comma', function() _lt:decMasterCount() end },
  16. { true, false, false, true, 'period', function() _lt:incMasterCount() end },
  17. { true, false, false, true, 'Left', function() _lt:moveView(kiwmi:focused_view(),20,{-1,0}) end },
  18. { true, false, false, true, 'Right', function() _lt:moveView(kiwmi:focused_view(),20,{1,0}) end },
  19. { true, false, false, true, 'Up', function() _lt:moveView(kiwmi:focused_view(),20,{0,-1}) end },
  20. { true, false, false, true, 'Down', function() _lt:moveView(kiwmi:focused_view(),20,{0,1}) end },
  21. { true, false, true, false, 'Left', function() _lt:snapViewToEdge(kiwmi:focused_view(),"left") end },
  22. { true, false, true, false, 'Right', function() _lt:snapViewToEdge(kiwmi:focused_view(),"right") end },
  23. { true, false, true, false, 'Up', function() _lt:snapViewToEdge(kiwmi:focused_view(),"up") end },
  24. { true, false, true, false, 'Down', function() _lt:snapViewToEdge(kiwmi:focused_view(),"down") end },
  25. { true, false, true, false, 'Return', function() _lt:toggleViewMaximize() end },
  26. { true, false, false, true, 'f', function() _lt:toggleViewFullscreen() end },
  27. { true, false, false, false, 't', function() _lt:layout_tile() end },
  28. { true, false, false, true, 't', function() _lt:layout_monocle() end },
  29. { true, false, true, false, 't', function() _lt:layout_null() end },
  30. { true, false, false, true, 'Return', function() _lt:arrange_layout() end },
  31. { true, false, false, false, '1', function() _kw:switchToWorkspace(1) end },
  32. { true, false, false, false, '2', function() _kw:switchToWorkspace(2) end },
  33. { true, false, false, false, '3', function() _kw:switchToWorkspace(3) end },
  34. { true, false, false, true, '1', function() _kw:sendViewToWorkspace(1) end },
  35. { true, false, false, true, '2', function() _kw:sendViewToWorkspace(2) end },
  36. { true, false, false, true, '3', function() _kw:sendViewToWorkspace(3) end },
  37. { true, false, true, false, 'Tab', function() _kw:switchToLastWorkspace() end },
  38. { true, false, false, false, 'h', function() _kw:pushViewToHiddenSpace() end },
  39. { true, false, false, true, 'h', function() _kw:popViewFromHiddenSpace() end },
  40. { true, false, true, false, 'h', function() _kw:toggleHiddenSpace() end },
  41. { false, false, false, false, 'XF86MonBrightnessUp', function() kiwmi:spawn("xbacklight -inc 5") end },
  42. { false, false, false, false, 'XF86MonBrightnessDown', function() kiwmi:spawn("xbacklight -dec 5") end },
  43. { false, false, false, false, 'XF86AudioRaiseVolume', function() kiwmi:spawn("amixer -D pipewire set Master 5%+") end },
  44. { false, false, false, false, 'XF86AudioLowerVolume', function() kiwmi:spawn("amixer -D pipewire set Master 5%-") end },
  45. { false, false, false, false, 'XF86AudioMute', function() kiwmi:spawn("amixer set Master toggle") end },
  46. { false, false, false, false, 'XF86AudioMicMute', function() kiwmi:spawn("amixer set Capture toggle") end },
  47. { false, false, false, false, 'Print', function() kiwmi:spawn("grim -t png "..os.getenv("HOME").."/Pictures/screenshot-$(date +%Y-%m-%d-%H-%M-%S).png") end },
  48. { true, false, false, false, 'Print', function() kiwmi:spawn("grim -t png -g \"$(slurp)\" "..os.getenv("HOME").."/Pictures/screenshot-$(date +%Y-%m-%d-%H-%M-%S).png") end },
  49. }
  50. return keybinds