{"id":16898757,"url":"https://github.com/chrischdi/xrandr-gotoggle","last_synced_at":"2025-03-20T11:47:09.086Z","repository":{"id":54161874,"uuid":"344389123","full_name":"chrischdi/xrandr-gotoggle","owner":"chrischdi","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-06T12:54:41.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-18T04:41:16.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/chrischdi.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}},"created_at":"2021-03-04T07:36:25.000Z","updated_at":"2021-03-06T12:54:43.000Z","dependencies_parsed_at":"2022-08-13T08:00:45.908Z","dependency_job_id":null,"html_url":"https://github.com/chrischdi/xrandr-gotoggle","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/chrischdi%2Fxrandr-gotoggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrischdi%2Fxrandr-gotoggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrischdi%2Fxrandr-gotoggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrischdi%2Fxrandr-gotoggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrischdi","download_url":"https://codeload.github.com/chrischdi/xrandr-gotoggle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244609426,"owners_count":20480781,"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-10-13T17:45:18.448Z","updated_at":"2025-03-20T11:47:09.063Z","avatar_url":"https://github.com/chrischdi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xrandr-gotoggle\n\n`xrandr-gotoggle` is a small tool for saving and loading xrandr configurations.\n\nThe tool saves xrandr configurations in a configuration file and references them\nby calculating a sha256 sum over the ID's of all connected monitors, by using \nthe following format:\n```\n\u003ccalculated sha256 from connected monitors\u003e: [\"\u003cxrandr commandline args\u003e\"]\n5a11328e98459635a78587a4f8b39dbe5f6618932f5247634fce60fe60a19921: [\"--screen\", \"0\", \"--output\", \"eDP-1\", \"--mode\", \"1920x1080\", \"--pos\", \"0x0\", \"--primary\"\n```\n\n## Usage\n\nThe tool provides the following commands:\n\n| Command                                       | Function                                                                                                                |\n|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|\n| `xrandr-gotoggle apply`                       | Tries to apply the saved configuration if available.                                                                    |\n| `xrandr-gotoggle config view`                 | Prints the current configuration from the configuration file.                                                           |\n| `xrandr-gotoggle config print-current-config` | Prints the current configuration, which could be added to the configuration file, and the corresponding xrandr command. |\n| `xrandr-gotoggle config set-current-config`   | Adds or overwrites the current configuration to the configuration file.                                                 |\n| `xrandr-gotoggle print-checksum`              | Calculates and prints the screen checksum.                                                                              |\n\n## Build\n\nTo build the binary you need [go](https://golang.org/) installed on your system and run the following command.\n\n```\ngo build .\n```\n\n## Integration\n\nTo automatically apply a configuration on boot the tool should get run once after\nstarting the window manager.\n\nE.g. for i3 the following line could be added to the configuration at `~/.config/i3/config`:\n```\nexec --no-startup-id /usr/local/bin/xrandr-gotoggle apply\n```\n\nTo automatically apply a configuration on changes to the currently connected displays,\nan udev-rule could get added (make sure to set the appropriate `DISPLAY` und `user`):\n```\nSUBSYSTEM==\"drm\", ACTION==\"change\", ENV{DISPLAY}=\":1\", RUN+=\"/bin/su - user -c '/usr/local/bin/xrandr-gotoggle apply'\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrischdi%2Fxrandr-gotoggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrischdi%2Fxrandr-gotoggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrischdi%2Fxrandr-gotoggle/lists"}