{"id":18439056,"url":"https://github.com/demonstrandum/mimetype-xml","last_synced_at":"2026-05-19T10:38:41.209Z","repository":{"id":56883736,"uuid":"102289670","full_name":"Demonstrandum/mimetype-xml","owner":"Demonstrandum","description":"Custom mimetypes from TOML to XML","archived":false,"fork":false,"pushed_at":"2017-09-23T17:45:12.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T04:47:10.140Z","etag":null,"topics":["config","custom","gnome","icon-pack","icons","linux","mime","mime-types","mimetype","toml","xml"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Demonstrandum.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}},"created_at":"2017-09-03T19:41:57.000Z","updated_at":"2017-09-04T23:14:18.000Z","dependencies_parsed_at":"2022-08-20T23:40:20.038Z","dependency_job_id":null,"html_url":"https://github.com/Demonstrandum/mimetype-xml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fmimetype-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fmimetype-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fmimetype-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Demonstrandum%2Fmimetype-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Demonstrandum","download_url":"https://codeload.github.com/Demonstrandum/mimetype-xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248887262,"owners_count":21177847,"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":["config","custom","gnome","icon-pack","icons","linux","mime","mime-types","mimetype","toml","xml"],"created_at":"2024-11-06T06:23:13.338Z","updated_at":"2026-05-19T10:38:41.145Z","avatar_url":"https://github.com/Demonstrandum.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MimetypeXML\n\u003e Custom mimetype from TOML to XML\n\n## Install\n\n- You need Ruby and Gems (gems comes with ruby)\nInstall this gem with\n```shell\ngem install mimetype-xml \n\n# You might want to run this with sudo,\n# or add the Gem userdir to the beginning of your $PATH variable\n# like so in your bashrc: `PATH=$(ruby -e 'print Gem.user_dir')/bin:$PATH`\n# This depends on your platform.\n```\n\n## Usage\nCreate the TOML config (`./custom-mime.toml`):\n```toml\n## CUSTOM MIMETYPES TOML CONFIG FILE ##\n# Optional variables ard marked with `(opt.)` in a\n# comment at the end of the line\n\n# Add mimetype for elixir files\n[x-application-elixir]\n\ntype    = \"application/x-elixir\"\npattern = [\"*.ex\", \"*.exs\"] # Always in an array\n                            # (even if only one pattern, e.g. [\"*.ext\"])\n\ncomment      = \"Elixir File\" # Default language\ncomment_lang = [ [\"no\", \"Elixir Fil\"], [\"la\", \"Ordo Elixir\"] ] # etc. (opt.)\n\nicon = \"mimetypes/application-x-elixir.svg\"\nsize = 48 # I don't really know\n\nxml_file = \"elixir-file-mimetype.xml\" # (opt.), not useful...\n\n\n# Another for crystal files\n\n[x-application-crystal]\ntype = \"application/x-crystal\"\npattern =  [\"*.cr\"]\ncomment = \"Crystal File\"\nicon = \"mimetypes/application-x-crystal.svg\"\nsize = 48\n\n# That simple to add new mimetypes, just make the icon in the\n# path specified in the `icon` variable. \n# e.g. 'mimetypes/appliaction-x-myfile.svg'\n```\n\nThen generate the xml files and install it through a ruby script (`./generate-mimetypes.rb`):\n```ruby\nrequire 'mimetype_xml'\nrequire 'toml' # `toml` comes with this gem (`mimetype_xml`)\n\nxml = MimetypeXML::Generate.toml_file(\n  :file      =\u003e './custom-mime.toml', # The location of the TOML config\n  :xml_dir   =\u003e '/usr/share/mime/packages/', # Make sure the dir is writable for the user, run `sudo chmod 777 /usr/share/mime/packages/`\n  :icon_pack =\u003e '~/.icons/YOUR_ICON_PACK' # Replace this with the install dir of your iconpack\n)\n\nfiles = xml.write_files\nfiles.install\n```\n\nThen run the script from your shell:\n```shell\nruby ./generate-mimetypes.rb\n```\n\n---\n\nThe binary file doesn't do anything at the moment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonstrandum%2Fmimetype-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemonstrandum%2Fmimetype-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemonstrandum%2Fmimetype-xml/lists"}