{"id":15148976,"url":"https://github.com/troglobit/xplugd","last_synced_at":"2025-10-24T05:30:38.261Z","repository":{"id":42676398,"uuid":"54966354","full_name":"troglobit/xplugd","owner":"troglobit","description":"Monitor, keyboard, and mouse plug/unplug helper for X","archived":false,"fork":false,"pushed_at":"2023-01-29T08:00:00.000Z","size":178,"stargazers_count":64,"open_issues_count":5,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-30T23:41:24.040Z","etag":null,"topics":["awesomewm","i3wm","x","x-server","xrandr"],"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/troglobit.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":"2016-03-29T10:16:13.000Z","updated_at":"2024-02-14T05:57:38.000Z","dependencies_parsed_at":"2023-02-15T21:31:07.308Z","dependency_job_id":null,"html_url":"https://github.com/troglobit/xplugd","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fxplugd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fxplugd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fxplugd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fxplugd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troglobit","download_url":"https://codeload.github.com/troglobit/xplugd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237915421,"owners_count":19386724,"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":["awesomewm","i3wm","x","x-server","xrandr"],"created_at":"2024-09-26T13:40:54.268Z","updated_at":"2025-10-24T05:30:37.884Z","avatar_url":"https://github.com/troglobit.png","language":"C","funding_links":[],"categories":["Environment and System Related"],"sub_categories":["Laptop Specific"],"readme":"xplugd - X plug daemon\n======================\n[![Travis Status][]][Travis] [![Coverity Status]][Coverity Scan]\n\n`xplugd` is a UNIX daemon that executes a script on X input and RandR\nchanges, i.e., when a, keyboard, mouse. or a monitor is plugged in or\nunplugged.  Useful in combination with lightweight setups, e.g. when\nrunning an X window manager like [Awesome][1], Fluxbox, or similar to\ndetect when docking or undocking a laptop.\n\n\nUsage\n-----\n\n    xplugd [-hnpsv] [-l LEVEL] [FILE]\n    \n    -h        Show help text and exit\n    -l LEVEL  Set log level: none, err, info, notice*, debug\n    -n        Run in foreground, do not fork to background\n    -p        Probe currently connected outputs and output EDID info.\n    -s        Use syslog, even if running in foreground, default w/o -n\n    -v        Show version info and exit\n    \n    FILE       Optional script argument, default $XDG_CONFIG_HOME/xplugrc\n               Fallback also checks for ~/.config/xplugrc and ~/.xplugrc\n\nWhen `FILE` is omitted `xplugd` uses `$XDG_CONFIG_HOME/xplugrc`, if that\ncannot be found `~/.config/xplugrc` is tried, and finally `~/.xplugrc`.\nThe file is called as a shell script on plug events as follows:\n\n    xplugrc TYPE DEVICE STATUS [\"Optional Description\"]\n             |    |      |\n             |    |       `---- connected or disconnected\n             |     `----------- HDMI3, LVDS1, VGA1, etc.\n              `---------------- keyboard, pointer, display\n\nThe script may be called like this, notice how the description is not\nincluded for displays:\n\n    xplugrc display HDMI3 disconnected\n    xplugrc keyboard 3 connected \"Topre Corporation Realforce 87\"\n\nThe keyboard or pointer is always the X slave keyboard or pointer, and\nthe status encoding for `XIStatusEnabled` and `XIStatusDisabled` is\nforwarded to the script as connected and disconnected, respectively.\n\nIf EDID data is available from a connected display, the monitor model is\npassed in as fourth argument (\"Optional Description\") to the script.\n\n\n### Example ~/.config/xplugrc\n\n```sh\n#!/bin/sh\nLAPTOP=LVDS1\nDOCK=HDMI3\nDESKPOS=--left-of\nPRESPOS=--right-of\n\nif [ \"$1\" != \"display\" ]; then\n    case \"$1,$3,$4\" in\n        pointer,conntected,\"SynPS/2 Synaptics TouchPad\")\n            xinput set-prop $2 'Synaptics Off' 1\n            ;;\n        keyboard,connected,*)\n            setxkbmap -option ctrl:nocaps\n            ;;\n    esac\n    exit 0\nfi\n\nif [ \"$3\" = \"disconnected\" ]; then\n    xrandr --output $2 --off\n    exit 0\nfi\n\nif [ \"$2\" = \"${DOCK}\" ]; then\n    xrandr --output $2 --auto --primary ${DESKPOS} ${LAPTOP}\nelif  [ \"$1\" != \"${LAPTOP}\" ]; then\n    xrandr --output $2 --auto ${PRESPOS} ${LAPTOP} --primary\nelse\n    xrandr --auto\nfi\n```\n\n\nBuild \u0026 Install\n---------------\n\nTo build `xplugd` you need the standard libraries and header files for\nX11, X11 input, and Xrandr.  On a Debian/Ubuntu system these files can\nbe installed with:\n\n    sudo apt install libx11-dev libxi-dev libxrandr-dev\n\nThen run the configure script and make:\n\n    ./configure \u0026\u0026 make\n\nUnless building from the GIT sources, in which case `./autogen.sh` first\nmust be called to create the configure script.  With relased tarballs this\nis not necessary.\n\nTo change the default installation prefix from `/usr/local`, use the\n\n    ./configure --prefix=/some/other/path\n\nFollowed by\n\n    make all \u0026\u0026 sudo make install-strip\n\n\nOrigin \u0026 References\n-------------------\n\n[`xplugd`][2] is composed from pieces of Stefan Bolte's [`srandrd`][3]\nand Andrew Shadura's [`inputplug`][4].  Please report bugs and problems\nto the `xplugd` project.\n\n[1]: https://awesome.naquadah.org\n[2]: https://github.com/troglobit/xplugd\n[3]: https://bitbucket.org/portix/srandrd\n[4]: https://bitbucket.org/andrew_shadura/inputplug\n[Travis]:        https://travis-ci.org/troglobit/xplugd\n[Travis Status]: https://travis-ci.org/troglobit/xplugd.png?branch=master\n[Coverity Scan]:   https://scan.coverity.com/projects/10739\n[Coverity Status]: https://scan.coverity.com/projects/10739/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fxplugd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroglobit%2Fxplugd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fxplugd/lists"}