From 2864edcf8b02711fdb465fe2df5d5480d7cc68cb Mon Sep 17 00:00:00 2001 From: Junko Date: Thu, 23 Nov 2023 18:20:33 +0100 Subject: [PATCH] readme --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- README.org | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 README.org diff --git a/Cargo.lock b/Cargo.lock index 8e4fc2c..dc32a09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -598,8 +598,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] -name = "pluralshit" -version = "0.1.0" +name = "pluralsync" +version = "1.0.0" dependencies = [ "dirs", "reqwest", diff --git a/Cargo.toml b/Cargo.toml index c5d9e7f..fd0ff99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "pluralshit" -version = "0.1.0" +name = "pluralsync" +version = "1.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.org b/README.org new file mode 100644 index 0000000..75687f2 --- /dev/null +++ b/README.org @@ -0,0 +1,43 @@ +#+title: PluralSync +#+author: Jvnko @ lavenderfield + +PluralSync is a small CLI application written in rust to syncronize and centralize the control over the front on SimplyPlural and PluralKit. It's my first project in rust, so the code is +probably+ a mess and I'm most likely not making use of some rust features that would benefit the project. + +Suggestions on how to improve the code are very welcome. After all, the objective with this project was learning more about the language. + +* Usage +** Configuration +On the first run, if it does not exist, PluralSync will create a configuration directory and populate with a json file with the following structure: + +#+begin_src js +{ + "pk_key": "// Pluralkit token", + "sp_key": "// Simplplural token" +} +#+end_src + +Just fill it with PluralKit and SimplyPlural tokens associated to your account. + +** Commands +*** Sync +Once the configuration is ready, you can start by calling the =sync= command, which will get the list of members of the system and place their data in a =system.json= file inside the configuration folder. Running commands like =set= or =add= without a present =system.json= will automatically fetch the data for you. + +*Remember to sync whenever you change the information of the system! i.e. adding a new member, rename...* + +*** Set +Takes multiple arguments. Sets the current front to the selected list of members. + +*** Add +Takes multiple arguments. Adds the selected members to an already existing front. + +*** Get +Displays the current front. The result is displayed in console but also stored in a plain text file named =.front= in the configuration directory, for use with other applications (Polybar, OBS...). + +*** Memberlist +Writes the known list of members based on the =system.json= file. + +* Future +Given the nature of the project as a learning exercise, there are currently a set of features and improvements I'd like to add eventually. +- [ ] Proper error handling (What I have currently is simply a mess) +- [ ] Rofi and zenity support +- [ ] Proper way to handle front conflicts between PluralKit and SimplyPlural