{"id":28002443,"url":"https://github.com/drarig29/auto-paste-emoji","last_synced_at":"2025-08-30T09:15:22.054Z","repository":{"id":93371593,"uuid":"379656659","full_name":"Drarig29/auto-paste-emoji","owner":"Drarig29","description":"A script which automatically pastes an emoji if you just selected it from KDE Plasma's emoji picker","archived":false,"fork":false,"pushed_at":"2021-11-04T21:10:12.000Z","size":5,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T19:41:10.855Z","etag":null,"topics":["automation","bash-script","clipboard","emoji","emoji-picker","kde-plasma","xdotool"],"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/Drarig29.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-23T15:54:23.000Z","updated_at":"2025-04-07T10:23:59.000Z","dependencies_parsed_at":"2023-03-10T15:01:23.985Z","dependency_job_id":null,"html_url":"https://github.com/Drarig29/auto-paste-emoji","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Drarig29/auto-paste-emoji","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fauto-paste-emoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fauto-paste-emoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fauto-paste-emoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fauto-paste-emoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Drarig29","download_url":"https://codeload.github.com/Drarig29/auto-paste-emoji/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Drarig29%2Fauto-paste-emoji/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272828810,"owners_count":25000091,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","bash-script","clipboard","emoji","emoji-picker","kde-plasma","xdotool"],"created_at":"2025-05-09T00:19:33.688Z","updated_at":"2025-08-30T09:15:22.046Z","avatar_url":"https://github.com/Drarig29.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auto-paste-emoji\n\nA script which automatically pastes an emoji if you just selected it from KDE Plasma's emoji picker.\n\nYou can tweak it to meet your needs.\n\nDependencies:\n\n- [xdotool](https://www.semicomplete.com/projects/xdotool/)\n- [clipnotify](https://github.com/cdown/clipnotify)\n- [is-emoji](https://github.com/Drarig29/is-emoji)\n\n## Usage\n\nDownload this script or clone the repository.\n\nThen, symlink it somewhere like `/usr/bin/auto-paste-emoji`:\n\n```bash\nln -s ~/path/to/auto-paste-emoji.sh /usr/bin/auto-paste-emoji\n```\n\nTo run this script at startup, you need to put it somewhere [which is loaded after X server starts](https://unix.stackexchange.com/questions/360537/cant-run-application-that-depends-on-x-as-a-systemd-service), so forget systemd.\nOtherwise you'll get a `Unable to connect to X server` error.\n\nYou can use files like `.xinitrc`, `.xsession` or `.xprofile`. Keep in mind that by default, `.xinitrc` is only loaded when we use the `startx` command.\nSo this file won't be loaded if you use a desktop environment.\n\n**Warning:** this file contains an infinite loop, so you need to run the command in the background with `\u0026`, otherwise your desktop environment is likely to freeze when you log in.\n\nI personally used `~/.xprofile`, here is its content:\n\n```bash\n#!/bin/bash\nexec /usr/bin/auto-paste-emoji \u0026\n```\n\n## How it works?\n\n- It uses [clipnotify](https://github.com/cdown/clipnotify), so no polling is involved\n- Any existing instance of the script is killed\n- All errors are ignored so that the program doesn't stop unexpectedly\n- When the selection changes, it checks if the emoji picker is open and a single emoji is in the clipboard\n- If it's the case, we assume the emoji was just selected: so the picker is closed and the emoji is pasted\n- A small delay is added between closing the picker and pasting the emoji to let the emoji picker's window disappear and let the focus change\n- To close the window we don't use `xdotool windowclose` but we simulate pressing \u003ckbd\u003eEsc\u003c/kbd\u003e\u003ckbd\u003eEsc\u003c/kbd\u003e instead\n  - For some reason, closing the window kills the whole process and the shortcut to open the picker won't respond afterwards\n  - We simulate pressing \u003ckbd\u003eEsc\u003c/kbd\u003e twice because if you used the search feature in the picker, pressing \u003ckbd\u003eEsc\u003c/kbd\u003e will clear the search string, so we need a second key stroke\n\nYou can view the logs using `journalctl`: \n\n```bash\njournalctl -b | grep -E \"\\[$(pidof -x /usr/bin/auto-paste-emoji)\\]\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrarig29%2Fauto-paste-emoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrarig29%2Fauto-paste-emoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrarig29%2Fauto-paste-emoji/lists"}