<commit_before># Mjolnir

<img src="https://raw.githubusercontent.com/mjolnir-io/mjolnir/master/Mjolnir/Images.xcassets/AppIcon.appiconset/icon_128x128.png" alt="Mjolnir logo" title="Mjolnir logo" align="right"/>

*Lightweight automation and productivity power-tool for OS X*

* Current version:  Mjolnir **0.4.2**
* Requires:         OS X 10.8 or higher

## What is Mjolnir?

Mjolnir is an OS X app that lets you automate common tasks using the
language Lua. At its core, it doesn't actually do anything besides
load up a Lua environment; the real power lies in all the useful
modules that you can install.

### Powerful

Apple has a bunch of APIs that let you do super cool things. But you
usually need to know C and pointers and stuff to use them. But not
anymore! Now we can just write some Lua and do cool things like
get/set the mouse position, move windows, whatever! Anyway, this is
useful because you get to write a short script that will make you
crazy-productive in the long-term.

### Lightweight

I'm just so tired of certain programs making my laptop sound like it's
gonna take off in flight. So I made a point of it to make Hydra use as
little system resources as possible. And I'm actually even kinda
surprised at how small it is! It sure does help that Lua has the same
idea in mind. There are some principles about this in the readme on
the github page, you should totally check it out.

### Superfun

The other day, I was on my laptop, and my wife was using the desktop
(OS X of course), and I ssh'd into it and used a CLI module to like,
move her mouse by a few pixels and stuff, and made her windows a
little smaller. Oh and I unmuted it and turned the volume up a bit and
made the computer talk to her using the "say" utility. Don't worry,
she found it pretty funny :)

### such api. so possibilities. wow.

There's really no limit to what you can do with Mjolnir. Like I said
before, the heart of the app is actually just a Lua environment. You
can install more Mjolnir modules from LuaRocks or wherever. There's
one that let's you get and set window positions for any OS X window,
one that lets you bind global hotkeys, one that lets you move windows
along a grid, open or quit applications, and more.

We're working on creating some new ones, including a module to run
AppleScripts or shell scripts, one to get/set volume on your audio
devices, one to get/set your screen brightness, one to execute Mjolnir
code from the command line or from other shell scripts, one to listen
to window/application/screen events (i.e. window opened, application
quit, application launched, etc.)

## See it in action

| Description                                                                                                              | Animated Screenshot                                                                           |
|--------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Using hotkeys to move and resize a window along a grid (using `mjolnir.sd.grid`)                                         | ![grid.gif](https://raw.githubusercontent.com/mjolnir-io/mjolnir/master/screenshots/grid.gif) |
| Using a hotkey to open Dictionary.app and show an alert (using `mjolnir.application.launchorfocus` and `mjolnir.alert`)  | ![dict.gif](https://raw.githubusercontent.com/mjolnir-io/mjolnir/master/screenshots/dict.gif) |

dict.gif
  -rw-r--r--   1 sdegutis  staff  890581 Sep  4 13:19 grid.gif
  -rw-r--r--   1 sdegutis  staff   82421 Sep  4 13:19 ipc.gif
  -rw-r--r--   1 sdegutis  staff  368952 Sep  4 13:19 repl.gif


## How do you actually use Mjolnir?

You write a "config", which just means `~/.mjolnir/init.lua`. This
file, along with whatever modules it requires, have full access to the
built-in `mjolnir` module, and all Lua modules that you have installed
(e.g. from LuaRocks or any way you want to install them).

## Try it out

1. Download [the latest release](https://github.com/mjolnir-io/mjolnir/releases/latest), unzip, right-click `Mjolnir.app`, choose "Open"<commit_msg>Oops that was a typo :)<commit_after># Mjolnir

<img src="https://raw.githubusercontent.com/mjolnir-io/mjolnir/master/Mjolnir/Images.xcassets/AppIcon.appiconset/icon_128x128.png" alt="Mjolnir logo" title="Mjolnir logo" align="right"/>

*Lightweight automation and productivity power-tool for OS X*

* Current version:  Mjolnir **0.4.2**
* Requires:         OS X 10.8 or higher

## What is Mjolnir?

Mjolnir is an OS X app that lets you automate common tasks using the
language Lua. At its core, it doesn't actually do anything besides
load up a Lua environment; the real power lies in all the useful
modules that you can install.

### Powerful

Apple has a bunch of APIs that let you do super cool things. But you
usually need to know C and pointers and stuff to use them. But not
anymore! Now we can just write some Lua and do cool things like
get/set the mouse position, move windows, whatever! Anyway, this is
useful because you get to write a short script that will make you
crazy-productive in the long-term.

### Lightweight

I'm just so tired of certain programs making my laptop sound like it's
gonna take off in flight. So I made a point of it to make Hydra use as
little system resources as possible. And I'm actually even kinda
surprised at how small it is! It sure does help that Lua has the same
idea in mind. There are some principles about this in the readme on
the github page, you should totally check it out.

### Superfun

The other day, I was on my laptop, and my wife was using the desktop
(OS X of course), and I ssh'd into it and used a CLI module to like,
move her mouse by a few pixels and stuff, and made her windows a
little smaller. Oh and I unmuted it and turned the volume up a bit and
made the computer talk to her using the "say" utility. Don't worry,
she found it pretty funny :)

### such api. so possibilities. wow.

There's really no limit to what you can do with Mjolnir. Like I said
before, the heart of the app is actually just a Lua environment. You
can install more Mjolnir modules from LuaRocks or wherever. There's
one that let's you get and set window positions for any OS X window,
one that lets you bind global hotkeys, one that lets you move windows
along a grid, open or quit applications, and more.

We're working on creating some new ones, including a module to run
AppleScripts or shell scripts, one to get/set volume on your audio
devices, one to get/set your screen brightness, one to execute Mjolnir
code from the command line or from other shell scripts, one to listen
to window/application/screen events (i.e. window opened, application
quit, application launched, etc.)

## See it in action

| Description                                                                                                              | Animated Screenshot                                                                           |
|--------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Using hotkeys to move and resize a window along a grid (using `mjolnir.sd.grid`)                                         | ![grid.gif](https://raw.githubusercontent.com/mjolnir-io/mjolnir/master/screenshots/grid.gif) |
| Using a hotkey to open Dictionary.app and show an alert (using `mjolnir.application.launchorfocus` and `mjolnir.alert`)  | ![dict.gif](https://raw.githubusercontent.com/mjolnir-io/mjolnir/master/screenshots/dict.gif) |

## How do you actually use Mjolnir?

You write a "config", which just means `~/.mjolnir/init.lua`. This
file, along with whatever modules it requires, have full access to the
built-in `mjolnir` module, and all Lua modules that you have installed
(e.g. from LuaRocks or any way you want to install them).

## Try it out

1. Download [the latest release](https://github.com/mjolnir-io/mjolnir/releases/latest), unzip, right-click `Mjolnir.app`, choose "Open"
{'fraction_non_alphanumeric': 0.11861917003305178, 'fraction_numerical': 0.007467254253886645, 'mean_word_length': 2.5185185185185186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6010184', 'n_tokens_mistral': 2322, 'n_tokens_neox': 2138, 'n_words': 1100}