{"id":13683533,"url":"https://github.com/Ventto/xpub","last_synced_at":"2025-04-30T13:31:05.549Z","repository":{"id":78621666,"uuid":"79065125","full_name":"Ventto/xpub","owner":"Ventto","description":"POSIX Shell script to get user's display environment variables of any TTY from anywhere.","archived":false,"fork":false,"pushed_at":"2018-07-06T09:38:25.000Z","size":32,"stargazers_count":41,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-12T03:34:59.966Z","etag":null,"topics":["dbus","display","rules","run","udev","udev-rules","x","xauthority"],"latest_commit_sha":null,"homepage":"","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/Ventto.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}},"created_at":"2017-01-15T22:57:41.000Z","updated_at":"2024-11-01T18:07:55.000Z","dependencies_parsed_at":"2024-01-14T16:10:27.302Z","dependency_job_id":null,"html_url":"https://github.com/Ventto/xpub","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ventto%2Fxpub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ventto%2Fxpub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ventto%2Fxpub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ventto%2Fxpub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ventto","download_url":"https://codeload.github.com/Ventto/xpub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251712896,"owners_count":21631461,"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":["dbus","display","rules","run","udev","udev-rules","x","xauthority"],"created_at":"2024-08-02T13:02:14.668Z","updated_at":"2025-04-30T13:31:05.258Z","avatar_url":"https://github.com/Ventto.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"Xpub\n====\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/Ventto/xpub/blob/master/LICENSE)\n[![Vote for xpub](https://img.shields.io/badge/AUR-Vote_for-yellow.svg)](https://aur.archlinux.org/packages/xpub/)\n\n*\"Xpub is a Shell script to get user's display environment variables of any X graphical session from anywhere.\"*\n\n## Perks\n\n* [x] **No requirement**: POSIX-compliant.\n* [x] **Omniscient**: Provides X environment variables of any session from any user.\n* [x] **Usefull**: Run graphical commands from udevrules (see below).\n* [x] **Extra**: Display graphical command on a specific session.\n* [x] **Support**: XWayland users, keep calm.\n\n# Installation\n\n* Package (AUR)\n\n```bash\n$ yaourt -S xpub\n```\n\n* Manually\n\n```bash\n$ git clone https://github.com/Ventto/xpub.git\n$ cd xpub\n$ chmod +x src/xpub.sh\n```\n\n# Usage\n\n```\nUsage: xpub [-t TTY]\n\nWithout option, prints the X session information of the current user.\n\n  -h:   Prints this help and exits.\n  -v:   Prints the version and exits.\n  -t:   prints the current TTY's user X session information.\n```\n\n# Examples\n\n\n### From terminal\n\n*sudo* is required.\n\n* Get information of your current session:\n\n```bash\n$ xpub\nTTY=tty2\nXUSER=alice\nXAUTHORITY=/home/alice/.Xauthority\nDISPLAY=:0\nDBUS_SESSION_BUS_ADDRESS=/path\n```\n\n* Get information of a specific session:\n\n```bash\n$ xpub -t tty2\nXUSER=alice\nXAUTHORITY=/home/alice/.Xauthority\nDISPLAY=:0\nDBUS_SESSION_BUS_ADDRESS=/path\n```\n\n### Udev rules\n\n```python\nIMPORT{program}=\"/usr/bin/xpub\", \\\nRUN+=\"/bin/su $env{XUSER} -c '/usr/bin/notify-send Hello'\"\n```\n\nAfter editing your rules, you may need to run `udevadm control --reload-rules`.\n\n### For *root* \n\n```bash\n$ export $(xpub) ; su \"${XUSER}\" -c '/usr/bin/notify-send Hello'\n```\n\n### Shell scripts\n\n```bash\nxenv=$(xpub 2\u003e/tmp/xpub.log)\n\nif [ $# -ne 0 ]; then\n    exit 1\nelse\n    export ${xenv}\nfi\n\nsu \"${XUSER}\" -c \"/usr/bin/notify-send Hello\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVentto%2Fxpub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVentto%2Fxpub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVentto%2Fxpub/lists"}