<commit_before>local hotkey = require "mjolnir.hotkey"
local grid = require "mjolnir.sd.grid"
local window = require "mjolnir.window"

grid.GRIDWIDTH = 2
grid.GRIDHEIGHT = 1

local function pushwindow(d)
  if window.focusedwindow() ~= nil then
    local x = 0
    if d == 'left' then x = 0
    elseif d == 'right' then x = grid.GRIDWIDTH-1
    end

    grid.adjust_focused_window(function(f)
      f.x = x
      f.y = 0
      f.w = grid.GRIDWIDTH/2
      f.h = grid.GRIDHEIGHT+1
    end)
  end
end

mash = {"cmd", "ctrl"}
hotkey.bind(mash, 'H', function() pushwindow('left') end)
hotkey.bind(mash, 'L', function() pushwindow('right') end)
<commit_msg>add minimize and maximize<commit_after>local hotkey = require "mjolnir.hotkey"
local grid = require "mjolnir.sd.grid"
local window = require "mjolnir.window"

grid.GRIDWIDTH = 2
grid.GRIDHEIGHT = 1

local function push_window(d)
  if window.focusedwindow() ~= nil then
    local x = 0
    if d == 'left' then x = 0
    elseif d == 'right' then x = grid.GRIDWIDTH-1
    end

    grid.adjust_focused_window(function(f)
      f.x = x
      f.y = 0
      f.w = grid.GRIDWIDTH/2
      f.h = grid.GRIDHEIGHT+1
    end)
  end
end

local function size_window(d)
  local win = window.focusedwindow()
  if win ~= nil then
    if d == 'min' then win:minimize()
    elseif d == 'max' then grid.maximize_window()
    end
  end
end

mash = {"cmd", "ctrl"}
hotkey.bind(mash, 'H', function() push_window('left') end)
hotkey.bind(mash, 'J', function() size_window('min') end)
hotkey.bind(mash, 'K', function() size_window('max') end)
hotkey.bind(mash, 'L', function() push_window('right') end)

{'fraction_non_alphanumeric': 0.14127764127764128, 'fraction_numerical': 0.009828009828009828, 'mean_word_length': 3.355614973262032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1307055', 'n_tokens_mistral': 632, 'n_tokens_neox': 606, 'n_words': 164}