{"id":19357901,"url":"https://github.com/thexhr/dtoggle","last_synced_at":"2026-05-13T21:31:15.704Z","repository":{"id":9264880,"uuid":"11092277","full_name":"thexhr/dtoggle","owner":"thexhr","description":"Small bash script uses xrandr to configure internal/external displays","archived":false,"fork":false,"pushed_at":"2026-02-07T13:28:07.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-07T22:15:15.857Z","etag":null,"topics":["bash-script","display-manager","projector","xrandr"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thexhr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-01T10:58:11.000Z","updated_at":"2026-02-07T13:28:10.000Z","dependencies_parsed_at":"2022-09-22T15:52:27.061Z","dependency_job_id":null,"html_url":"https://github.com/thexhr/dtoggle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thexhr/dtoggle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thexhr%2Fdtoggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thexhr%2Fdtoggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thexhr%2Fdtoggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thexhr%2Fdtoggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thexhr","download_url":"https://codeload.github.com/thexhr/dtoggle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thexhr%2Fdtoggle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33000700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bash-script","display-manager","projector","xrandr"],"created_at":"2024-11-10T07:09:36.081Z","updated_at":"2026-05-13T21:31:15.676Z","avatar_url":"https://github.com/thexhr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dtoggle\n\nSmall bash script that uses `xrandr` to configure internal/external displays.  I use it here with BSD and Linux and i3 whenever I connect one or more external displays.\n\nI use the toggle option with the `XF86Display` key (Fn + F7) on my Thinkpad:\n\n```\nbindsym XF86Display exec \"~/Documents/bin/dtoggle -t\"\n```\n\n## Usage Scenarios\n\n### Connected to a projector\n\nYou connect your laptop to a projector and you do not have (the time to cerate) a profile. Just use the -t option to switch between all displays options on all connected displays.\n\n```\ndtoggle -t\n```\n\n### Switch between the laptop display and a docking station with connected displays\n\nAdd a profile named *foo* and use -p foo once you dock in or out.\n\n```\ndtoggle -p foo -e\n```\n\n## Config File\n\ndtoggle can read the to be used profile from a config file in `$HOME/.dtoggle.conf`.  If the config file is not present you have to specify the profile using the -p option.  The file looks as follows:\n\n```\n# Set your desired profile here\nPROFILE=home\n```\n\n## Command Line Options\n\n```\ndtoggle [-ceix] [-hmntv] [-lr] -p profile\n\nDisplay Options:\n -c           Clone screen on all displays\n -e           Enable external display(s) and disable internal\n -i           Enable only the internal display\n -x           Extend screen to all displays [default]\n\nGeneral Options:\n -h           Show this help\n -m           Show all available modes\n -n           Dry run. Do not run xrand.  Implies -v\n -t           Toggle different options\"\n -v           Be more verbose\n\nPosition:\n -l           Display n is left of display (n+1)\n -r           Display n is right of display (n+1) [default]\n\nProfile:\n -p profile   Enable the specified profile\n```\n\n## Add a new Profile\n\n1. Clone the repository and copy dtoggle to a location in your `$PATH`\n2. Open the file in a text editor, look for the `choose_profile()` function and change the profiles to your needs or add new ones.  I included my profiles for home, work and projector.  In order to get the names of the displays, connect them and run `dtoggle -m`. Look for the strings that say \"connected\". Add the name of your internal display to `INTERN` and all names of your external displays to `EXTERN[0]` up to `EXTERN[n]`. Note: The order of the entries is important, i.e. entry number n is either left of right (depending on the option) of number (n+1)!\n\n```bash\nfunction choose_profile()\n{\n  [...]\n  case \"$PROFILE\" in\n    # Home profile: Internal on, external extended\n    home)\n      INTERN=\"LVDS1\"\n      EXTERN[0]=\"HDMI1\"\n      ;;\n    [...]\n    # -----------------------------------------------------------------------\n    # Add your own profiles here.\n    # -----------------------------------------------------------------------\n    # name)\n    #   INTERN=\"LVDS1\"\n    #   EXTERN[0]=\"VGA1\"\n    #   ...\n    #   EXTERN[n]=\"VGAn\"\n    #   ;;\n    # -----------------------------------------------------------------------\n```\n\n3. Check the command line options with `dtoggle -h` and enjoy.\n\n## Bugs\n\nNone.  Nevertheless, I you find something annoying, send me an email.\n\n## License\n\nISC\n\n## Author\n\nMatthias Schmidt (xhr giessen.ccc.de)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthexhr%2Fdtoggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthexhr%2Fdtoggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthexhr%2Fdtoggle/lists"}