{"id":24069438,"url":"https://github.com/yehuthi/linuxflip","last_synced_at":"2026-02-09T23:31:52.799Z","repository":{"id":216690788,"uuid":"741959150","full_name":"yehuthi/linuxflip","owner":"yehuthi","description":"Detects and executes commands when the computer switches to and from tablet mode.","archived":false,"fork":false,"pushed_at":"2024-12-03T13:57:34.000Z","size":37,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T06:29:23.165Z","etag":null,"topics":["laptop","libinput","linux","tablet-mode","udev"],"latest_commit_sha":null,"homepage":"","language":"C","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/yehuthi.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}},"created_at":"2024-01-11T13:19:28.000Z","updated_at":"2025-02-11T13:51:53.000Z","dependencies_parsed_at":"2024-01-13T04:17:04.624Z","dependency_job_id":"c50c1511-9f78-4032-a301-eb9db9ffe631","html_url":"https://github.com/yehuthi/linuxflip","commit_stats":null,"previous_names":["yehuthi/linuxflip"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/yehuthi/linuxflip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehuthi%2Flinuxflip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehuthi%2Flinuxflip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehuthi%2Flinuxflip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehuthi%2Flinuxflip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yehuthi","download_url":"https://codeload.github.com/yehuthi/linuxflip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yehuthi%2Flinuxflip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29285815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"ssl_error","status_checked_at":"2026-02-09T21:57:11.537Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["laptop","libinput","linux","tablet-mode","udev"],"created_at":"2025-01-09T14:57:21.873Z","updated_at":"2026-02-09T23:31:52.783Z","avatar_url":"https://github.com/yehuthi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Flip\n\nDetects and executes commands when the computer switches to and from tablet mode.\n\n## Setup\n\n1. Download the [latest release](https://github.com/yehuthi/linuxflip/releases/latest), or if you're on Arch: `yay -S linuxflip-git`\n2. Add your user to the `input` group (unless you want to run it as root -- not recommended).\n\n\u003e [!TIP]\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e⌨ Add yourself to \u003ccode\u003einput\u003c/code\u003e group\u003c/summary\u003e\n\u003e\n\u003e Open the terminal (press \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eT\u003c/kbd\u003e or find it as you would any other program), and enter:\n\u003e    \n\u003e ```sh\n\u003e sudo usermod -aG input $USER\n\u003e ```\n\u003e \u003c/details\u003e\n\nThen you can simply run it or [hook](#appendix-run-automatically) it to a desktop session startup script.\n\n\n## Usage\n\nRun `linuxflip --help` for usage options. The one you're probably interested in is:\n```\nlinuxflip \u003ctablet-cmd\u003e \u003claptop-cmd\u003e\n    Runs \u003ctablet-cmd\u003e in a shell when the mode changes to tablet, and \u003claptop-cmd\u003e when the mode changes to laptop.\n```\n\n- [x] The commands run in a shell, so shell features are supported (such as [tilde expansion](https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html)).\n- [x] The commands run asynchronously.\n\n### Examples\n\n#### Scripts\nA typical example is running script files. You can place them wherever you want and to run them, the command is simply their path. Set up those scripts however you want and make sure they're executable (`chmod +x`), then run:\n\n```bash\nlinuxflip \"~/.config/linuxflip/tablet\" \"~/.config/linuxflip/laptop\"\n```\n\n#### Commands\nYou can pass commands, which can be very handy for trivial setups. For example, if you _just_ want to display an [on-screen keyboard](https://wiki.archlinux.org/title/List_of_applications/Utilities#On-screen_keyboards):\n```bash\nlinuxflip corekeyboard \"killall corekeyboard\"\n```\n\n## Appendix: Disable/Enable Devices\n\nTo disable or enable a device, such as a keyboard, the trackpad, etc. use `xinput`:\n```sh\nxinput disable \"device name\"\nxinput enable \"device name\"\n```\n\nTo find out the device name,  you can run `xinput list` and see if you can definitely spot the device there. If it's not obvious:\n1. Run `libinput debug-events`. You should see some lines for the connected devices.\n2. Send input from the device (press a button on a keyboard, move the cursor on a mouse, etc.). The terminal should react with new lines.\n3. Note the event number on the first column for the new lines.\n4. Scroll up to the first lines about the connected devices and find the event number there. The third column is the device name.\n\nNow we can disable/enable a device called \"device name\" on switch by putting the disable/enable commands in the scripts, or directly like this:\n```\nlinuxflip 'xinput disable \"device name\"' 'xinput enable \"device name\"'\n```\n\n## Appendix: Run Automatically\n\n1. Create a file `~/.xsession` if doesn't exist\n2. Append your `linuxflip` command to it, and remember not to block, e.g.\n   ```sh\n   linuxflip \"~/.config/linuxflip/tablet\" \"~/.config/linuxflip/laptop\" \u0026\n   ```\n   (note the `\u0026` at the end)\n4. Make sure it's executable (`chmod +x ~/.xsession`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyehuthi%2Flinuxflip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyehuthi%2Flinuxflip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyehuthi%2Flinuxflip/lists"}