mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 07:03:05 +00:00
feat(volume): Adding the volume widget in default config
This commit is contained in:
parent
ff7d5bcdf2
commit
00b97ae13f
1 changed files with 98 additions and 61 deletions
159
src/defaults.rs
159
src/defaults.rs
|
@ -189,75 +189,112 @@ pub fn layout() -> Widget {
|
||||||
Box::new(Texts::Text(String::from("⎸"))),
|
Box::new(Texts::Text(String::from("⎸"))),
|
||||||
),
|
),
|
||||||
])),
|
])),
|
||||||
Some(Box::new(Texts::If(
|
Some(Box::new(Texts::Parts(vec![
|
||||||
Condition::Not(Box::new(Condition::Stopped)),
|
Texts::Parts(vec![
|
||||||
Box::new(Texts::Parts(vec![
|
|
||||||
Texts::Styled(
|
Texts::Styled(
|
||||||
vec![AddStyle::Fg(Color::Indexed(113))],
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
Box::new(Texts::Parts(vec![
|
Box::new(Texts::Text(String::from("["))),
|
||||||
Texts::If(
|
|
||||||
Condition::Playing,
|
|
||||||
Box::new(Texts::Text(String::from("[playing: "))),
|
|
||||||
Some(Box::new(Texts::Text(String::from(
|
|
||||||
"[paused: ",
|
|
||||||
)))),
|
|
||||||
),
|
|
||||||
Texts::CurrentElapsed,
|
|
||||||
Texts::Text(String::from("/")),
|
|
||||||
Texts::CurrentDuration,
|
|
||||||
Texts::Text(String::from("] ")),
|
|
||||||
])),
|
|
||||||
),
|
),
|
||||||
Texts::If(
|
Texts::If(
|
||||||
Condition::TitleExist,
|
Condition::VolumeMuted,
|
||||||
Box::new(Texts::Parts(vec![
|
Box::new(Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
|
Box::new(Texts::Text(String::from("muted"))),
|
||||||
|
)),
|
||||||
|
Some(Box::new(Texts::Parts(vec![
|
||||||
Texts::Styled(
|
Texts::Styled(
|
||||||
vec![AddStyle::Fg(Color::Indexed(149))],
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
Box::new(Texts::CurrentTitle),
|
Box::new(Texts::Text(String::from("vol: "))),
|
||||||
),
|
),
|
||||||
Texts::If(
|
Texts::Styled(
|
||||||
Condition::ArtistExist,
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
Box::new(Texts::Parts(vec![
|
Box::new(Texts::CurrentVolume),
|
||||||
Texts::Styled(
|
|
||||||
vec![AddStyle::Fg(Color::Indexed(216))],
|
|
||||||
Box::new(Texts::Text(String::from(" ◆ "))),
|
|
||||||
),
|
|
||||||
Texts::Styled(
|
|
||||||
vec![AddStyle::Fg(Color::Indexed(185))],
|
|
||||||
Box::new(Texts::CurrentArtist),
|
|
||||||
),
|
|
||||||
Texts::If(
|
|
||||||
Condition::AlbumExist,
|
|
||||||
Box::new(Texts::Parts(vec![
|
|
||||||
Texts::Styled(
|
|
||||||
vec![AddStyle::Fg(Color::Indexed(
|
|
||||||
216,
|
|
||||||
))],
|
|
||||||
Box::new(Texts::Text(
|
|
||||||
String::from(" ◆ "),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
Texts::Styled(
|
|
||||||
vec![AddStyle::Fg(Color::Indexed(
|
|
||||||
221,
|
|
||||||
))],
|
|
||||||
Box::new(Texts::CurrentAlbum),
|
|
||||||
),
|
|
||||||
])),
|
|
||||||
None,
|
|
||||||
),
|
|
||||||
])),
|
|
||||||
None,
|
|
||||||
),
|
),
|
||||||
])),
|
Texts::Styled(
|
||||||
Some(Box::new(Texts::Styled(
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
vec![AddStyle::Fg(Color::Indexed(185))],
|
Box::new(Texts::Text(String::from("%"))),
|
||||||
Box::new(Texts::CurrentFile),
|
),
|
||||||
))),
|
]))),
|
||||||
),
|
),
|
||||||
])),
|
Texts::Styled(
|
||||||
None,
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
))),
|
Box::new(Texts::Text(String::from("]"))),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
Texts::If(
|
||||||
|
Condition::Not(Box::new(Condition::Stopped)),
|
||||||
|
Box::new(Texts::Parts(vec![
|
||||||
|
Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(Color::Indexed(113))],
|
||||||
|
Box::new(Texts::Parts(vec![
|
||||||
|
Texts::If(
|
||||||
|
Condition::Playing,
|
||||||
|
Box::new(Texts::Text(String::from(
|
||||||
|
"[playing: ",
|
||||||
|
))),
|
||||||
|
Some(Box::new(Texts::Text(String::from(
|
||||||
|
"[paused: ",
|
||||||
|
)))),
|
||||||
|
),
|
||||||
|
Texts::CurrentElapsed,
|
||||||
|
Texts::Text(String::from("/")),
|
||||||
|
Texts::CurrentDuration,
|
||||||
|
Texts::Text(String::from("] ")),
|
||||||
|
])),
|
||||||
|
),
|
||||||
|
Texts::If(
|
||||||
|
Condition::TitleExist,
|
||||||
|
Box::new(Texts::Parts(vec![
|
||||||
|
Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(Color::Indexed(149))],
|
||||||
|
Box::new(Texts::CurrentTitle),
|
||||||
|
),
|
||||||
|
Texts::If(
|
||||||
|
Condition::ArtistExist,
|
||||||
|
Box::new(Texts::Parts(vec![
|
||||||
|
Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(Color::Indexed(216))],
|
||||||
|
Box::new(Texts::Text(String::from(
|
||||||
|
" ◆ ",
|
||||||
|
))),
|
||||||
|
),
|
||||||
|
Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(Color::Indexed(185))],
|
||||||
|
Box::new(Texts::CurrentArtist),
|
||||||
|
),
|
||||||
|
Texts::If(
|
||||||
|
Condition::AlbumExist,
|
||||||
|
Box::new(Texts::Parts(vec![
|
||||||
|
Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(
|
||||||
|
Color::Indexed(216),
|
||||||
|
)],
|
||||||
|
Box::new(Texts::Text(
|
||||||
|
String::from(" ◆ "),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(
|
||||||
|
Color::Indexed(221),
|
||||||
|
)],
|
||||||
|
Box::new(Texts::CurrentAlbum),
|
||||||
|
),
|
||||||
|
])),
|
||||||
|
None,
|
||||||
|
),
|
||||||
|
])),
|
||||||
|
None,
|
||||||
|
),
|
||||||
|
])),
|
||||||
|
Some(Box::new(Texts::Styled(
|
||||||
|
vec![AddStyle::Fg(Color::Indexed(185))],
|
||||||
|
Box::new(Texts::CurrentFile),
|
||||||
|
))),
|
||||||
|
),
|
||||||
|
])),
|
||||||
|
None,
|
||||||
|
),
|
||||||
|
]))),
|
||||||
)),
|
)),
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue