{"id":13572120,"url":"https://github.com/rtoshiro/hammerspoon-init","last_synced_at":"2026-04-04T08:30:19.369Z","repository":{"id":79768527,"uuid":"41687140","full_name":"rtoshiro/hammerspoon-init","owner":"rtoshiro","description":"Hammerspoon init.lua file.","archived":false,"fork":false,"pushed_at":"2021-03-12T12:51:45.000Z","size":10,"stargazers_count":40,"open_issues_count":2,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-05T05:33:52.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtoshiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-08-31T16:26:23.000Z","updated_at":"2024-08-20T09:43:00.000Z","dependencies_parsed_at":"2023-06-02T07:45:42.783Z","dependency_job_id":null,"html_url":"https://github.com/rtoshiro/hammerspoon-init","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtoshiro%2Fhammerspoon-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtoshiro%2Fhammerspoon-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtoshiro%2Fhammerspoon-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtoshiro%2Fhammerspoon-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtoshiro","download_url":"https://codeload.github.com/rtoshiro/hammerspoon-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247153450,"owners_count":20892669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:13.935Z","updated_at":"2026-04-04T08:30:19.301Z","avatar_url":"https://github.com/rtoshiro.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Hammerspoon \n\nI'm not going to explain what is **Hammerspoon** or teach you Lua.\n\nI'll just explain how to use my \"init.lua\" file, if you don't want spending time on it.\n\n# Download\n\nThe init.lua is [here](https://github.com/rtoshiro/hammerspoon-init/blob/master/init.lua). Please share with me if you improve it :)\n\n# Configuration\n\nOpen ```init.lua``` file and edit lines 12 and 13 with the name of your first and second monitor. You can get the name openning MacOS display settings.\n\n```\n12\t\tlocal main_monitor = \"Color LCD\"\n13\t\tlocal second_monitor = \"DELL E2310H\"\n```\n\n# Shortcuts\n\n\tcmd + alt + right key\n\tcmd + alt + left key\n\tcmd + alt + up key\n\tcmd + alt + down key\n\tctrl + cmd + alt + right key\n\tctrl + cmd + alt + left key\n\tctrl + cmd + alt + up key\n\tctrl + cmd + alt + down key\n\tcmd + alt + c\n\tctrl + cmd + alt + c\n\tcmd + alt + f\n\tctrl + cmd + alt + f\n\n\tctrl + cmd + alt + r (reloads init.lua file)\n\tctrl + cmd + alt + 1 (moves focused window to second_monitor)\n\tctrl + cmd + alt + 2 (moves focused window to main_monitor)\n\tctrl + cmd + alt + 3 (applies all layouts)\n\tctrl + cmd + alt + 4 (applies only one layout (focused one))\n\n\tctrl + cmd + alt + P (closes all applications defined by closeAll variable at line 205)\n\tctrl + cmd + alt + P (open all applications defined by openAll variable at line 222)\n\n# Layouts:\n\nYou can configure the variable \"layouts\" (line 32) according your monitor configuration.\n\n### The sintax is:\n\n```\n  {\n    name = \"App name\" ou { \"App name\", \"App name\" }\n    func = function(index, win)\n      COMMANDS\n    end\n  },\n```\n\n### Example\n\n```\n  {\n    name = {\"Firefox\", \"iTunes\"},\n    func = function(index, win)\n      win:moveToScreen(hs.screen.get(\"Color LCD\"))\n      win:maximize()\n    end\n  },\n```\n\nIf you call \"ctrl + cmd + alt + 3\", it will apply all layouts you defined.\n\nIf you call \"ctrl + cmd + alt + 4\", the layout will be applied only on the focused application.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtoshiro%2Fhammerspoon-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtoshiro%2Fhammerspoon-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtoshiro%2Fhammerspoon-init/lists"}