Skip to content

Commit 6b703a8

Browse files
authored
Add "sus" pipe kind (#104)
1 parent fbced0f commit 6b703a8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ color_mode = "ansi" # ansi, rgb or none
5151
palette = "default" # default, darker, pastel or matrix
5252
delay_ms = 20
5353
inherit_style = false
54-
kinds = ["heavy"] # heavy, light, curved, knobby, emoji, outline, dots, blocks
54+
kinds = ["heavy"] # heavy, light, curved, knobby, emoji, outline, dots, blocks, sus
5555
num_pipes = 1
5656
reset_threshold = 0.5 # 0.0–1.0
5757
turn_chance = 0.15 # 0.0–1.0
@@ -86,6 +86,7 @@ turn_chance = 0.15 # 0.0–1.0
8686
| `outline` | `║ ║ ═ ═ ╔ ╗ ╚ ╝` |
8787
| `dots` | `• • • • • • • •` |
8888
| `blocks` | `█ █ ▀ ▀ █ █ ▀ ▀` |
89+
| `sus` | `ඞ ඞ ඞ ඞ ඞ ඞ ඞ ඞ` |
8990

9091
_Due to emojis having a different character width, using the emoji pipe kind along side another pipe kind can cause spacing issues._
9192

@@ -100,7 +101,7 @@ There are also command line options that can be used to override parts of the co
100101
| `-d` | sets the delay in ms | `-d 15` |
101102
| `-i` | toggles if pipes inherit style when hitting the edge | `-i false` |
102103
| `-k` | sets the kinds of pipes, each kind separated by commas | `-k heavy,curved` |
103-
| `-p` | sets the number of pipes onscreen | `-p 5` |
104+
| `-p` | sets the number of pipes on screen | `-p 5` |
104105
| `-r` | sets the percentage of the screen to be filled before resetting | `-r 0.75` |
105106
| `-t` | chance of a pipe turning each frame | `-t 0.15` |
106107
| `--palette` | sets the color palette, RGB mode only | `--palette pastel` |
@@ -109,7 +110,7 @@ There are also command line options that can be used to override parts of the co
109110

110111
### Contributors
111112

112-
pipes-rs is maintained by [lhvy](https://github.com/lhvy) and [arzg](https://github.com/arzg); any other contributions via PRs are welcome! Forks and modifications are implicitly dual-licensed under Apache 2.0 OR MIT. Please credit the above contributers and pipes.sh when making modifications.
113+
pipes-rs is maintained by [lhvy](https://github.com/lhvy) and [arzg](https://github.com/arzg); any other contributions via PRs are welcome! Forks and modifications are implicitly dual-licensed under Apache 2.0 OR MIT. Please credit the above contributors and pipes.sh when making modifications.
113114

114115
### Inspiration
115116

crates/model/src/pipe/kind.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub enum Kind {
1212
Outline,
1313
Dots,
1414
Blocks,
15+
Sus,
1516
}
1617

1718
impl Kind {
@@ -57,12 +58,13 @@ impl Kind {
5758
Self::Outline => Self::OUTLINE,
5859
Self::Dots => Self::DOTS,
5960
Self::Blocks => Self::BLOCKS,
61+
Self::Sus => Self::SUS,
6062
}
6163
}
6264

6365
fn width(self) -> KindWidth {
6466
match self {
65-
Self::Dots => KindWidth::Custom(NonZeroUsize::new(2).unwrap()),
67+
Self::Dots | Self::Sus => KindWidth::Custom(NonZeroUsize::new(2).unwrap()),
6668
_ => KindWidth::Auto,
6769
}
6870
}
@@ -75,6 +77,7 @@ impl Kind {
7577
const OUTLINE: [char; 8] = ['║', '║', '═', '═', '╔', '╗', '╚', '╝'];
7678
const DOTS: [char; 8] = ['•', '•', '•', '•', '•', '•', '•', '•'];
7779
const BLOCKS: [char; 8] = ['█', '█', '▀', '▀', '█', '█', '▀', '▀'];
80+
const SUS: [char; 8] = ['ඞ', 'ඞ', 'ඞ', 'ඞ', 'ඞ', 'ඞ', 'ඞ', 'ඞ'];
7881
}
7982

8083
#[derive(Clone, Copy)]
@@ -96,8 +99,9 @@ impl FromStr for Kind {
9699
"outline" => Self::Outline,
97100
"dots" => Self::Dots,
98101
"blocks" => Self::Blocks,
102+
"sus" => Self::Sus,
99103
_ => anyhow::bail!(
100-
r#"unknown pipe kind (expected “heavy”, “light”, “curved”, “knobby”, “emoji”, “outline”, “dots” or “blocks”)"#,
104+
r#"unknown pipe kind (expected “heavy”, “light”, “curved”, “knobby”, “emoji”, “outline”, “dots”, “blocks”, or “sus”)"#,
101105
),
102106
})
103107
}

0 commit comments

Comments
 (0)