{"id":28883171,"url":"https://github.com/dcsunset/rofi-snippets","last_synced_at":"2026-02-28T07:36:37.857Z","repository":{"id":298201515,"uuid":"998031279","full_name":"DCsunset/rofi-snippets","owner":"DCsunset","description":"A Rofi plugin to select snippets and simulate keyboard input of snippet content.","archived":false,"fork":false,"pushed_at":"2025-06-10T21:45:21.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-20T21:50:20.631Z","etag":null,"topics":["linux","rofi","rofi-mode","snippets","wayland","x11"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCsunset.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-07T18:08:34.000Z","updated_at":"2025-06-10T21:45:25.000Z","dependencies_parsed_at":"2025-06-20T21:38:31.631Z","dependency_job_id":"c6f64c55-c179-4b77-8f2c-533f950afb69","html_url":"https://github.com/DCsunset/rofi-snippets","commit_stats":null,"previous_names":["dcsunset/rofi-snippets"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DCsunset/rofi-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Frofi-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Frofi-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Frofi-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Frofi-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCsunset","download_url":"https://codeload.github.com/DCsunset/rofi-snippets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Frofi-snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29927623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["linux","rofi","rofi-mode","snippets","wayland","x11"],"created_at":"2025-06-20T21:38:24.599Z","updated_at":"2026-02-28T07:36:37.851Z","avatar_url":"https://github.com/DCsunset.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rofi-snippets\n\nA Rofi plugin to select snippets and simulate keyboard input of snippet content.\nIt supports both Wayland and X11.\n\n\n## Installation\n\n### Nix\n\nThis package is available as an [NUR](https://nur.nix-community.org/documentation/) package `nur.repos.dcsunset.rofi-snippets`.\nIt is also available from the flake output of the [NUR repo](https://github.com/DCsunset/nur-packages), where a NixOS overlay is provided as well.\n\nTo use it with NixOS:\n```nix\nenvironment.systemPackages = [\n  (pkgs.rofi.override (old: {\n    plugins = old.plugins ++ [nur.repos.dcsunset.rofi-snippets];\n  }))\n];\n```\n\nOr you can also use it with home-manager:\n```nix\nprograms.rofi = {\n  enable = true;\n  plugins = [nur.repos.dcsunset.rofi-snippets];\n}\n```\n\nThe NUR repo also provides a home-manager module via flake:\n``` nix\n{\n  imports = [ inputs.nur-dcsunset.homeManagerModules.rofi-snippets ];\n\n  # rofi should be enabled as well\n  programs.rofi.enable = true;\n\n  programs.rofi-snippets = {\n    enable = true;\n    settings = {\n      entries = [\n        {\n          key = \"date\";\n          snippet = {\n            type = \"command\";\n            value = [ \"date\" \"--iso-8601\" ];\n            trim = true;\n          };\n        }\n      ];\n    };\n  };\n}\n```\n\n\n### Pre-built Binaries\n\nPre-built binaries can be downloaded from GitHub release.\nPut the downloaded `.so` file in Rofi lib dir depending on your Rofi installation (e.g. `/lib/rofi`) or add the plugin's dir to `ROFI_PLUGIN_PATH` environment variable.\n\nNote that runtime dependencies (including glib, cairo, pango) must be installed before using the pre-built binaries.\nIf the pre-built binaries don't work for your system, try other installation methods.\n\n### Manually\n\n1. Clone this repo\n2. Install dependencies based on your environment\n   - Common: rust, pkg-config, glib, cairo, pango, libxkbcommon\n   - X11: xdotool\n3. Build the plugin\n   - Wayland only: `cargo build --release --features=wayland --no-default-features`\n   - X11 only: `cargo build --release --features=x11 --no-default-features`\n   - Both: `cargo build --release`\n4. Move the built plugin (`target/release/librofi_snippets.so`) to Rofi lib dir or add the plugin's dir to `ROFI_PLUGIN_PATH` environment variable\n\n\n## Usage\n\nTo start Rofi with rofi-snippets mode:\n`rofi -show rofi-snippets -modes rofi-snippets`\n\n\n## Configuration\n\nRofi-snippets will look for the configuration file in the following order (with environment variables):\n- `$ROFI_SNIPPETS_CONFIG`\n- `$XDG_CONFIG_HOME/rofi-snippets/config.json`\n- `$HOME/.config/rofi-snippets/config.json`\n\nThe config file is in JSON format and follows the following structure (shown in Rust):\n```rust\n// Type for the whole config file\nstruct Config {\n  // shell command to use for shell snippet (default: sh)\n  shell: Option\u003cString\u003e,\n  // snippet entries\n  entries: Vec\u003cEntry\u003e,\n  // Delay time before sending input event to ensure rofi window closes (in ms)\n  delay: Option\u003cu64\u003e,\n}\n\nstruct Entry {\n  // string to match in Rofi\n  key: String,\n  // Snippet will be used for simulating keyboard input\n  snippet: Snippet,\n  // (optionaL) extra description for this entry\n  description: Option\u003cString\u003e,\n}\n\n// Snippet is a tagged union\n#[serde(tag = \"type\", rename_all = \"camelCase\")]\nenum Snippet {\n  // Use the text as is\n  Text { value: String },\n  // Run a command and use the output\n  // (the first elem is the command and the rest are arguments)\n  Command { value: Vec\u003cString\u003e, trim: Option\u003cbool\u003e },\n  // Run a shell command and use the output\n  Shell { value: String, trim: Option\u003cbool\u003e },\n  // Evaluate a sequence of snippets and concatenate the outputs\n  Sequence { value: Vec\u003cSnippet\u003e },\n}\n\n// Use the text as is\ntype Text = {\n  type: \"text\",\n  value: string,\n}\n\n// Run a command and use the output\n// (the first elem is the command and the rest are arguments)\ntype Command = {\n  type: \"command\",\n  value: string[],\n  trim?: boolean,  // Trim whitespaces at the beginning and the end\n}\n\n// Run a shell command and use the output\ntype Shell = {\n  type: \"shell\",\n  value: string,\n  trim?: boolean,  // Trim whitespaces at the beginning and the end\n}\n\n// Evaluate a sequence of snippets and concatenate the outputs\ntype Sequence = {\n  type: \"sequence\",\n  value: Snippet[],\n}\n```\n\nExample:\n\n```json\n{\n  \"shell\": \"bash\",\n  \"delay\": 100,\n  \"entries\": [\n    {\n      \"key\": \"hello\",\n      \"description\": \"Hello Test\",\n      \"snippet\": {\n        \"type\": \"text\",\n        \"value\": \"Hello world ❤️\"\n      }\n    },\n    {\n      \"key\": \"date\",\n      \"snippet\": {\n        \"type\": \"command\",\n        \"value\": [\"date\", \"--iso-8601\"],\n        \"trim\": true\n      }\n    },\n    {\n      \"key\": \"datetime\",\n      \"snippet\": {\n        \"type\": \"sequence\",\n        \"value\": [\n          { \"type\": \"shell\", \"value\": \"date +%F\", \"trim\": true },\n          { \"type\": \"text\", \"value\": \" \" },\n          { \"type\": \"shell\", \"value\": \"date +%T\", \"trim\": true }\n        ]\n      }\n    }\n  ]\n}\n```\n\n\n## Licence\n\nAGPL-3.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Frofi-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcsunset%2Frofi-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Frofi-snippets/lists"}