Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add open source category #5

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hasecilu
Copy link

@hasecilu hasecilu commented Apr 21, 2024

With these 2 patches users will be able to run:

rusty-rain -c open-source

All icons are available via Nerd Fonts, most of the icons are from font-logos but there are a lot of open source icons on other glyph packs.

I'm still tracking some missing icons, so anyone knows tell me to add it.

Glyphs outside font-logos:   󰊢 󰕼   

image


Compile rusty-rain yourself

You need git and cargo installed.

  • Get patched ezemoji locally
git clone https://github.com/hasecilu/ezemoji.git && cd ezemoji
git checkout feat/open_source
  • Get rusty-rain locally
git clone https://github.com/cowboy8625/rusty-rain.git
  • Copy next patch to a file, apply it and compile. Note: Check in Cargo.toml that path to ezemoji crate points to the location you cloned the repo
git apply foss.diff
cargo build
./target/debug/rusty-rain -c open-source

foss.diff

diff --git a/Cargo.toml b/Cargo.toml
index 9ebcf67..c44bc97 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,8 @@ clap = { version = "3.1.18", features = ["cargo"] }
 crossterm = "0.23.2"
 rand = "0.8.5"
 itertools = "0.10.3"
-ezemoji = "0.2.0"
+# ezemoji = "0.2.0"
+ezemoji = { path = "/home/user/git/github/ezemoji" }
 
 [profile.release]
 debug = true
diff --git a/src/arguments.rs b/src/arguments.rs
index 2987648..77c6b0a 100644
--- a/src/arguments.rs
+++ b/src/arguments.rs
@@ -80,6 +80,7 @@ OPTIONS:
     num            - Good ol fashion Numbers
     numbered-balls - These are like pool balls
     numbered-cubes - These are like the pool balls but just cubes
+    open-source    - FOSS logos
     plants         - Plants of sorts
     smile          - 😃
     shapes         - Squares and Circles of a few colors
@@ -140,6 +141,7 @@ OPTIONS:
         "num" => Numbers.into(),
         "numbered-balls" => NumberedBalls.into(),
         "numbered-cubes" => NumberedCubes.into(),
+        "open-source" => OpenSource.into(),
         "plants" => Plant.into(),
         "smile" => Smile.into(),
         "shapes" => Shape.into(),
diff --git a/src/characters.rs b/src/characters.rs
index 82e5def..4564d24 100644
--- a/src/characters.rs
+++ b/src/characters.rs
@@ -35,6 +35,7 @@ pub enum Characters {
     Num(Numbers),
     NumberedBalls(NumberedBalls),
     NumberedCubes(NumberedCubes),
+    OpenSource(OpenSource),
     Plants(Plant),
     Smile(Smile),
     Shapes(Shape),
@@ -61,6 +62,7 @@ impl Characters {
             Self::Num(_) => CharWidth::Single.width(),
             Self::NumberedBalls(_) => CharWidth::Double.width(),
             Self::NumberedCubes(_) => CharWidth::Double.width(),
+            Self::OpenSource(_) => CharWidth::Double.width(),
             Self::Plants(_) => CharWidth::Double.width(),
             Self::Smile(_) => CharWidth::Double.width(),
             Self::Shapes(_) => CharWidth::Double.width(),
@@ -87,6 +89,7 @@ impl Characters {
             Self::Num(c) => c.as_vec_u32(),
             Self::NumberedBalls(c) => c.as_vec_u32(),
             Self::NumberedCubes(c) => c.as_vec_u32(),
+            Self::OpenSource(c) => c.as_vec_u32(),
             Self::Plants(c) => c.as_vec_u32(),
             Self::Smile(c) => c.as_vec_u32(),
             Self::Shapes(c) => c.as_vec_u32(),
@@ -202,6 +205,12 @@ impl From<ezemoji::NumberedCubes> for Characters {
     }
 }
 
+impl From<ezemoji::OpenSource> for Characters {
+    fn from(e: ezemoji::OpenSource) -> Self {
+        Self::OpenSource(e)
+    }
+}
+
 impl From<ezemoji::Plant> for Characters {
     fn from(e: ezemoji::Plant) -> Self {
         Self::Plants(e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant