{"id":13667157,"url":"https://github.com/forscht/xd","last_synced_at":"2025-10-29T21:31:50.246Z","repository":{"id":173147681,"uuid":"650299715","full_name":"forscht/xd","owner":"forscht","description":"Dynamic dmenu generator from yaml config","archived":false,"fork":false,"pushed_at":"2023-06-06T23:20:09.000Z","size":16,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T05:05:14.697Z","etag":null,"topics":["dmenu","dmenu-compilation","dmenu-scripts","dmenu-wrapper","dwm","go","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","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/forscht.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":"2023-06-06T19:20:05.000Z","updated_at":"2023-07-03T06:54:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f2e1f49-c669-40bd-bf47-6ace2b47c67c","html_url":"https://github.com/forscht/xd","commit_stats":null,"previous_names":["forscht/xd"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fxd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fxd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fxd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forscht%2Fxd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forscht","download_url":"https://codeload.github.com/forscht/xd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238900139,"owners_count":19549459,"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":["dmenu","dmenu-compilation","dmenu-scripts","dmenu-wrapper","dwm","go","yaml"],"created_at":"2024-08-02T07:00:32.835Z","updated_at":"2025-10-29T21:31:49.915Z","avatar_url":"https://github.com/forscht.png","language":"Go","readme":"## xd\n`xd` is tiny command line program written in Go that generates dmenu based on provided easily configurable yaml files.\n\nhttps://github.com/forscht/xd/assets/59018146/63e8a5e6-0c23-4a42-9799-229a87cf90e3\n\n#### Installation and Usage\n```shell\n# Build\nmake build\n# Install\nsudo make install\n# Uninstall\nsudo make uninstall\n\n# Usage:\nxd -config=/path/to/config.yaml -command=bluetooth -- -l 10 additional dmenu args...\n# -config - Specifies a particular configuration file to use. \n#           Any config files in the default configuration directory will be ignored.\n# -command - Allows for the direct execution of a top-level command parsed from the configuration file. \n#            This can be useful for binding shortcuts, such as in dwm/config.\n#            For instance: 'ctrl+shift+b' could map to 'xd -command bluetooth'\n```\n\n#### Configuration\nThe xd utility uses configuration files to define the commands it can run. \u003cbr /\u003e\nIf the `-config` flag is not provided when running xd, \nit will look for configuration files in the directory specified by `$XDG_CONFIG_HOME/xd/`. \u003cbr /\u003e\nIf this directory does not contain any configuration files, xd will automatically create a default one.\n\nImportantly, xd supports multiple configuration files.\nWhen loading its configuration,\nxd will read all the `.yaml` files located in the `$XDG_CONFIG_HOME/xd/` directory\nand merge the commands defined in them.\nThis allows you to split your commands across multiple files for better organization, if desired.\n\nHere's an example of a configuration file with detailed explanation:\n```yaml\n# A top-level command\n- name: Mpv               # The name of the command that will be displayed on the dmenu\n  prompt: \"Paste URL... [Ctrl+Shift+Y] \" # The prompt that will be displayed when this command is selected\n  cmd: mpv $selected      # The actual command to run. '$selected' will be replaced by the user's input\n\n# Another top-level command\n- name: WiFi\n  list: \"nmcli device wifi list | sed '1d'\" # The 'list' command generates dynamic options for the dmenu\n  cmd: \"device=$(echo $selected | tr -s ' ' | cut -d ' ' -f1); nmcli device wifi connect $device\" \n  # The actual command to run. '$selected' will be replaced by the user's selection from the options generated by 'list'\n\n# A top-level command containing sub-commands\n- name: System\n  commands:              # A list of sub-commands nested under 'System'\n    - name: Reboot       # The name of the sub-command that will be displayed on the dmenu\n      cmd: reboot        # The actual command to run when this sub-command is selected\n    - name: Shutdown\n      cmd: shutdown now\n    - name: Suspend\n      cmd: systemctl suspend\n\n```\n\nFor additional examples of configuration files, please refer to the [examples](examples) directory in this repository.\n\n#### Pass Args to Dmenu\n\nYou can pass additional arguments to dmenu after specifying the `-config` or `-command` flags.\nIt is crucial to add `--` after your flags to indicate the end of command options\nand ensure subsequent arguments are passed to dmenu correctly.\n\nFor example, to pass the `-l` argument (which controls the number of lines dmenu displays) to dmenu, you would write:\n```shell\nxd -config=/path/to/config.yaml -- -l 15\n```\n\n#### License\n`xd` is released under the [MIT License](LICENSE).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforscht%2Fxd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforscht%2Fxd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforscht%2Fxd/lists"}