{"id":13961517,"url":"https://github.com/kkharji/yctrl","last_synced_at":"2025-06-22T11:35:47.799Z","repository":{"id":42201053,"uuid":"461121652","full_name":"kkharji/yctrl","owner":"kkharji","description":"Thin wrapper around yabai that adds convenient and intuitive fixes","archived":false,"fork":false,"pushed_at":"2022-11-21T22:41:59.000Z","size":195,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-20T01:43:41.241Z","etag":null,"topics":["macos","rust","window-manager","yabai"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/kkharji.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-19T07:42:25.000Z","updated_at":"2025-05-22T06:08:38.000Z","dependencies_parsed_at":"2022-07-10T17:30:46.835Z","dependency_job_id":null,"html_url":"https://github.com/kkharji/yctrl","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kkharji/yctrl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkharji%2Fyctrl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkharji%2Fyctrl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkharji%2Fyctrl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkharji%2Fyctrl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkharji","download_url":"https://codeload.github.com/kkharji/yctrl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkharji%2Fyctrl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261288735,"owners_count":23136041,"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":["macos","rust","window-manager","yabai"],"created_at":"2024-08-08T17:01:12.892Z","updated_at":"2025-06-22T11:35:42.781Z","avatar_url":"https://github.com/kkharji.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# YCtrl\n\nThin wrapper around [yabai] that adds convenient and intuitive fixes.\n\nBy thin wrapper we mean that you could just replace `yabai` with\n`yctrl` and expect everting to work as is. Though, you need to get\nride of `-m` and `--` before actions/commands. e.g.\n\nSame as `yabai -m` cli, it communicate with yabai socket directly.\n\n```bash\nyabai -m window --focus next\nyctrl window focus next\n```\n\n## Enhancements\n\n- `inc` enhance resize that just accept either `right` or `left`. (works as you would expect)\n- `next/prev`: cycles with spaces and windows on all commands.\n- `focus next/prev`: accounts for floating windows (isn't that the default?).\n- `focus next/prev`: If current space has only one window then window next would go to next/prev space window\n- `event`: Auto close empty spaces.\n- `event`: keep focus in current space last window. (space change, new window in different space, window destroy)\n- `scratchpad`: toggle (hide/unhide) a pre-defeined scratchpad (configured by grid\n '\\\u003crows\\\u003e:\\\u003ccols\\\u003e:\\\u003cstart-x\\\u003e:\\\u003cstart-y\\\u003e:\\\u003cwidth\\\u003e:\\\u003cheight\\\u003e'\n- Auto-switch focus to last window on window destory/minimize/hide\n\n## Someday\n\n- Ergonomics\n  - [ ] Move to next/prev space should auto created space if it doesn't exists\n  - [ ] Auto create space by id if it doesn't exists.\n- Control and Access\n  - [ ] Maintain internal state of yabai objects\n- Scratchpad\n  - [ ] Moving mouse from scratchpad automatically hides it.\n  - [ ] Have scratchpad window appear in all spaces (now switches to space where it has the\n    scratchpad)\n  - [ ] toggle last\n- Bugs\n  - [ ] Fix installation by nix overlay\n  - [ ] Only switch focus to last window if current isn't hover\n\n## Setup\n\nIn yabairc:\n\n```bash\nyctrl \u0026\n\n# Setup event listeners\nsend() {; echo \"echo event $@ | nc -U -w 1 /tmp/yctrl.socket\"; }\n\nyabai -m signal --add event='space_changed' action=$(send 'space_changed $YABAI_SPACE_ID $YABAI_RECENT_SPACE_ID')\nyabai -m signal --add event='window_destroyed' action=$(send 'window_destroyed $YABAI_WINDOW_ID')\nyabai -m signal --add event='application_hidden' action=$(send 'application_hidden $YABAI_WINDOW_ID')\n\nyctrl config yctrl_auto_close_empty_spaces false # Disable auto close of empty spaces\nyctrl config window_topmost on # redirect to yabai socket\n\n# Scratchpad (definition are written json5) (special thanks to @arpandaze)\nyctrl config yctrl_scratchpad_grid \"6:4:1:1:2:4\"\nyctrl config yctrl_scratchpads '[\n  {\n    tag: \"alacritty\",\n    kind: \"title\",\n    target: \"TermScratchpad\",\n    command: [\"open\", \"-a\", \"Alacritty.app\", \"--title\", \"TermScratchpad\"]\n  },\n  {\n    tag: \"discord\",\n    kind: \"app\",\n    target: \"Discord\",\n    command: [\"open\", \"-a\", \"Discord.app\"]\n  },\n]'\n```\n\n## Installation\n\n### Cargo\n\n```bash\ncargo install --git https://github.com/kkharji/yctrl\n```\n\n### Flakes\n\n```nix\n{\n  inputs = {\n    yctrl.url = \"github:kkharji/yctrl\";\n    yctrl.inputs.nixpkgs.follows = \"nixpkgs\";\n  };\n  output = { self, ... }@inputs {\n    /// ......\n    {\n      nixpkgs.overlays = [ inputs.yctrl.overlay ];\n    };\n  };\n}\n```\n\n### Legacy\n\n```nix\n{\n  nixpkgs.overlays = [\n    (import (builtins.fetchTarball {\n      url = https://github.com/kkharji/yctrl/archive/master.tar.gz;\n    }))\n  ];\n}\n```\n\n\n## Inspirations\n\n- [slam/yabaictl](https://github.com/slam/yabaictl)\n- [thenoim/yabai-extended-cli](https://github.com/TheNoim/yabai-extended-cli/tree/main/YabiExtendedCli)\n\n[yabai]: https://github.com/koekeishiya/yabai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkharji%2Fyctrl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkharji%2Fyctrl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkharji%2Fyctrl/lists"}