feat(case-convert): add Case Convert launcher plugin - #510
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin
kjvdven/case-convertplugin.toml)What it does
Converts text between naming conventions from the launcher: 18 of them, across
camelCase,PascalCase,kebab-case,snake_case,CONSTANT_CASE,dot.case,path/case,Pascal_Snake_Case,KEBAB-UPPER-CASE,Header-Case,Title Case,Capital Case,Sentence case,no case,lower case,UPPER CASE,sWAP cASEandAlTeRnAtInG cAsE. Every row showsthe converted text with its convention as the subtitle; Enter copies it.
Type the text after the prefix (
/case parse http response), or leave the queryempty and it converts the current primary selection, falling back to the
clipboard — select text anywhere, open the launcher,
/case, Enter. A querystarting with
>filters the conversion list by name while still using theselection as input.
The three manifest categories (Programming, Text, Fun) drive the launcher's
filter bar. It scratches the itch of having a label in one shape and needing it
in another: a heading that has to become a file name, a database column that has
to become a JSON key.
External dependencies
wl-paste(wl-clipboard), and only to read the primary selection when the queryis empty. It is invoked as
wl-paste --primary --no-newline. The plugin checksnoctalia.commandExists("wl-paste")first and falls back tonoctalia.clipboardText(), so it degrades gracefully when it is absent. Listedin
dependenciesinplugin.tomland under Requirements in the README.No other process is spawned, no file is written or read outside the plugin
directory, and there is no network access at all. The only clipboard write is
the copy the user asks for by activating a row.
Testing
Ran it from the launcher against typed queries, the primary selection and the
clipboard; walked the category filter bar; toggled all three settings
(
input_sourceacross its three values,preserve_casing,notify_on_copy);exercised the
>name filter; and checked edge cases: multi-line input,accented text (
café-au-lait), acronyms (HTTPServerURL), an empty selectionand a separators-only input.
The conversion logic lives in
cases.luauand touches no noctalia API, so italso runs standalone under the
luauCLI; the repository linked below carries 52unit checks over it, including the tokenizer equivalence between
parse HTTP response,parse-http-responseandparseHttpResponse.noctalia plugins lint case-convertreports 0 errors, 0 warnings, and.github/workflows/scripts/validate-plugins.pypasses locally.Screenshots / Videos
Notes
Rows carry a blank badge on purpose. Leaving
glyphunset falls back toapp-window, and a text badge renders at icon size, so a blank badge is whatkeeps the rows about the converted text while staying aligned with the rest of
the launcher.
Casing is UTF-8 aware for ASCII and the Latin-1 Supplement block (
café→CAFÉ). Letters past that block pass through uncased rather than corrupted, andthe decoder walks bytes instead of calling the
utf8library, so the invalidUTF-8 a raw selection can contain cannot throw.
Development happens at https://github.com/kjvdven/noctalia-case-convert.
Checklist
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows theREADME template, documents
every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
thumbnail.webpwith the thumbnail generator.versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
catalog.toml; CI generates it.Code review attestation
licensedeclared inplugin.toml.