{"id":27995544,"url":"https://github.com/b0o/sway-scratch","last_synced_at":"2025-05-08T20:33:23.999Z","repository":{"id":272102453,"uuid":"915534580","full_name":"b0o/sway-scratch","owner":"b0o","description":"Floating scratchpads for Sway","archived":false,"fork":false,"pushed_at":"2025-01-12T05:36:41.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T14:09:39.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/b0o.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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"b0o"}},"created_at":"2025-01-12T05:14:48.000Z","updated_at":"2025-01-12T05:36:44.000Z","dependencies_parsed_at":"2025-01-12T06:31:38.249Z","dependency_job_id":null,"html_url":"https://github.com/b0o/sway-scratch","commit_stats":null,"previous_names":["b0o/sway-scratch"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b0o%2Fsway-scratch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b0o%2Fsway-scratch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b0o%2Fsway-scratch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b0o%2Fsway-scratch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b0o","download_url":"https://codeload.github.com/b0o/sway-scratch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253145259,"owners_count":21861215,"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":"2025-05-08T20:33:12.795Z","updated_at":"2025-05-08T20:33:23.889Z","avatar_url":"https://github.com/b0o.png","language":"Shell","funding_links":["https://github.com/sponsors/b0o"],"categories":[],"sub_categories":[],"readme":"# sway-scratch [![version](https://img.shields.io/github/v/tag/b0o/sway-scratch?style=flat\u0026color=yellow\u0026label=version\u0026sort=semver)](https://github.com/b0o/sway-scratch/releases) [![license: MIT](https://img.shields.io/github/license/b0o/sway-scratch?style=flat\u0026color=green)](https://opensource.org/licenses/MIT)\n\n\u003e Floating scratchpads for Sway\n\n\n## Usage\n\n\u003c!-- USAGE --\u003e\n\n```\n\nsway-scratch v0.1.1 (github.com/b0o/sway-scratch)\n\n(c) 2019-2025 Maddison Hellstrom \u003cgithub.com/b0o\u003e\nMIT License (https://mit-license.org/)\n\nUsage\n  sway-scratch [-q query-type|-i|-x|-t|-f] [-c change-type] [-W width] [-H height] [-T timeout] [-p prefix] [-n num] [-r] [-R] [-P position] mark query command [arg ..]\n  sway-scratch -h\n  sway-scratch -v\n\nDescription\n  sway-scratch creates and manages named scratchpads in Sway.\n\n  Sway's native scratchpad only supports cycling through a collection of windows\n  one-by-one.\n\n  sway-scratch makes it possible to create any number of named scratchpads which can be\n  toggled individually. Named scratchpads are assigned a unique mark which is\n  used to identify and control them.\n\n  Any program that spawns a window can be used as a named scratchpad.\n\n\n  In order for sway-scratch to create the scratchpad, it subscribes to Sway window event\n  notifications and then launches the program. Events are tested against the\n  specified query, based on the query-type and change-type options.\n\n  When a matching window is found, it's converted into a named scratchpad and\n  sway-scratch exits with code 0. If no matching windows are found before the timeout\n  expires, sway-scratch exits with a code of 2.\n\n  If a window with the given mark already exists, its visibility is toggled and\n  the command is not run.\n\nOptions\n  General Options\n    -h               Display usage information\n    -v               Print sway-scratch version.\n    -T               Number of seconds to wait for the target window to appear.\n                     Default: 30\n\n  Mark options\n    -p               The string to prepend to the mark. This string is used to\n                     indentify other scratchpads that have been created by sway-scratch\n                     when using the -r option.\n                     Default: \"sc-\"\n\n  Query Options\n    -q \u003cquery-type\u003e  Set the type of query to use when looking for the\n                     application window.\n\n                     Supported query types are:\n                       app_id   Match against the app_id property of the window.\n                                Applicable to wayland windows only.\n\n                       class    Match against the class property of the window.\n                                Applicable to xwayland windows only.\n\n                       title    Match against the window title.\n\n                       focus    Match the focused window.\n\n                     Default: \"app_id\".\n\n    -i               Shorthand for '-q app_id'\n    -x               Shorthand for '-q class'\n    -t               Shorthand for '-q title'\n    -f               Shorthand for '-q focus'\n\n    -R               Treat the query as a regular expression\n\n    -c \u003cchange-type\u003e Window change type to listen for. See the WINDOW subsection\n                     under EVENTS in sway-ipc(7) for all valid change types.\n                     Default: \"new\".\n\n    -n \u003cnum\u003e         The event number to listen for. If 0, the first event\n                     matching the query will be used. Otherwise, the nth event\n                     matching the query will be used.\n                     Default: 0.\n\n\n  Scratchpad Options\n    -W \u003cwidth\u003e       Width of the scratchpad window. Default: 75 ppt.\n    -H \u003cheight\u003e      Height of the scratchpad window. Default: 75 ppt.\n                     Width and height can be followed by a unit type of \"px\" or \"ppt\".\n                     If no unit is specified, \"ppt\" is assumed.\n\n    -P \u003cposition\u003e    Position of the scratchpad window. Valid values are:\n                       center    Center the window on the screen.\n                       mouse     Place the window under the mouse cursor.\n                       \u003cx\u003e,\u003cy\u003e   Place the window at the specified coordinates.\n                     Default: \"center\"\n\n    -r               If another scratchpad is currently focused, it will be hidden\n                     before showing the new scratchpad. Other scratchpads are\n                     identified based on the presence of the prefix specified\n                     with the -p option.\n\nArguments\n  mark               The mark assigned to this scratchpad. The mark will be\n                     prepended with the prefix specified by the -p option.\n                     If a window with the mark is found, its visibility will be\n                     toggled. Otherwise, the 'command' will be run to spawn the\n                     target application. If this option is an empty string, an\n                     unnamed scratchpad will be created and no mark will be\n                     assigned.\n\n  query              The query to test for when waiting for the target\n                     application's window to appear. See Query Options above for\n                     more information about query types.\n\n  command [arg ..]   The command used to spawn the target application if a\n                     matching mark is not found. This command will be executed\n                     as 'swaymsg exec \u003ccommand [arg ..]\u003e'.\n\n\nExample Sway Configuration\n\nbindsym {\n  #                         Options      Mark  Query      Command\n  #--------------------------------------------------------------------------------\n  Mod4+t exec sway-scratch               term  Alacritty  alacritty\n  Mod4+b exec sway-scratch  -W 85 -H 85  ff-p  firefox    firefox -P personal\n  Mod4+B exec sway-scratch  -W 85 -H 85  ff-w  firefox    firefox -P work\n  Mod4+e exec sway-scratch  -x           eq    qpaeq      QT_QPA_PLATFORM=xcb qpaeq\n  Mod4+s exec sway-scratch  -tc title    spot  Spotify    gtk-launch spotify\n}\n\n```\n\n\u003c!-- /USAGE --\u003e\n\n## License\n\n\u003c!-- LICENSE --\u003e\n\n\u0026copy; 2019-2025 Maddison Hellstrom\n\nReleased under the MIT License.\n\n\u003c!-- /LICENSE --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb0o%2Fsway-scratch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb0o%2Fsway-scratch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb0o%2Fsway-scratch/lists"}