This workflow is for running scripts using Mjolnir to control your windows. This is just a sample of the things that can be done. Follow this layout and you can do many neat things with Mjolnir.
First off, download Mjolnir from Mjolnir-io. That site also tells how to get started. To install the needed modules and configuration file, you will need to run the “mj:install” command. This will also install the cli program called “mjolnir”.
Once mjolnir and it’s cli program is installed, use the “mj:find mjolnir” command to set the path to the executable. After this step is done, all the following commands are available to use.
mj:install
This will install some modules that is used in the configuration file for this workflow. It will also install a default configuration file for mjolnir. If you already have one, move it to a temporary location, run this command, and then copy your function to the configuration file. This should be the second command you run to get this workflow running.
mj:updateinit
This command just updates the init.lua file to the new one for the workflow. It does not try to update the modules.
mj:reload
This tells mjolnir to reload the configuration file.
mj:open
This brings the Mjolnir console to the front.
mj:nup
This nudges the current window up.
mj:ndown
This nudges the current window down.
mj:nleft
This nudges the current window to the left.
mj:nright
This nudges the current window to the right.
mj:tcaff
This toggles system caffenate.
mj:leftthirds
This moves the current window to the left 1/3 of the screen.
mj:rightthirds
This moves the current window to the right 2/3 of the screen.
mj:lefthalf
This moves the current window to the left half of the screen.
mj:righthalf
This moves the current window to the right half of the screen.
hs:tophalf
This moves the current window to the top half of the screen.
hs:bottomhalf
This moves the current window to the bottom half of the screen.
hs:fullScreen
This moves the window to the maximum size on the screen.
hs:minimize
This minimizes the current window.
hs:tzoom
This toggles the system fullscreen on and off for the current window. This moves the window to it's own space taking up the entire screen.
hs:running
This will list all the running apps. You can then just select one to bring it to the front, select with alt key to hide it, select with ctrl key to unhide it, and select with the fn key to close the application.
mj:snap
This snaps the current window to the closes grid box area.
mj:setgrid
This requires you to put the x, y for a starting position in a 3x3 matrix for the current window. Then you give the width and height. Therefore, to move the current window to the upper left most block in a 3x3 matric, you would do “mj:setgrid 0, 0, 1, 1”. There is also a hotkey set to this value as an example.
mj:command
Type in a command string and it will be sent to Mjolnir directly!
mj:ftmove
This puts every window for FoldingText to the left half of the screen.
mj:fttoday
This focuses the window with the title “today.txt”. That is my todo list for the day.
mj:expose
This function list all running applications and allow the user to select one. It will show every window for that window in a matrix. It will then ask for the coordinates for the window in the expose. It will then put everything back and bring the selected window to the front.
There is a hotkey assignment to expose all FoldingText windows.
If the application only has one window, then it will simply bring that window to the front.
mj:last
This will move the last window moved around to it’s position and size before the movement. This is a single level return.
This workflow is also set up with a Remote page as well. Have fun controlling your windows from your iPad or iPhone.