|
|
@ -44,6 +44,9 @@ wide no
|
|
|
|
# Program to use to open media files.
|
|
|
|
# Program to use to open media files.
|
|
|
|
media mpv
|
|
|
|
media mpv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Whether to auto play media
|
|
|
|
|
|
|
|
autoplay no
|
|
|
|
|
|
|
|
|
|
|
|
# Use emoji indicators for TLS & Tor. (--emoji)
|
|
|
|
# Use emoji indicators for TLS & Tor. (--emoji)
|
|
|
|
emoji no
|
|
|
|
emoji no
|
|
|
|
|
|
|
|
|
|
|
@ -71,6 +74,8 @@ pub struct Config {
|
|
|
|
pub emoji: bool,
|
|
|
|
pub emoji: bool,
|
|
|
|
/// Media player to use.
|
|
|
|
/// Media player to use.
|
|
|
|
pub media: Option<String>,
|
|
|
|
pub media: Option<String>,
|
|
|
|
|
|
|
|
/// Whether to automatically play media
|
|
|
|
|
|
|
|
pub autoplay: bool,
|
|
|
|
/// Default encoding
|
|
|
|
/// Default encoding
|
|
|
|
pub encoding: Encoding,
|
|
|
|
pub encoding: Encoding,
|
|
|
|
/// UI mode. Can't be set in conf file.
|
|
|
|
/// UI mode. Can't be set in conf file.
|
|
|
@ -88,6 +93,7 @@ impl Default for Config {
|
|
|
|
wide: false,
|
|
|
|
wide: false,
|
|
|
|
emoji: false,
|
|
|
|
emoji: false,
|
|
|
|
media: Some(DEFAULT_MEDIA_PLAYER.into()),
|
|
|
|
media: Some(DEFAULT_MEDIA_PLAYER.into()),
|
|
|
|
|
|
|
|
autoplay: false,
|
|
|
|
encoding: Encoding::default(),
|
|
|
|
encoding: Encoding::default(),
|
|
|
|
mode: ui::Mode::default(),
|
|
|
|
mode: ui::Mode::default(),
|
|
|
|
wrap: 0,
|
|
|
|
wrap: 0,
|
|
|
@ -173,6 +179,9 @@ fn parse(text: &str) -> Result<Config> {
|
|
|
|
_ => Some(val.into()),
|
|
|
|
_ => Some(val.into()),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
"autoplay" => {
|
|
|
|
|
|
|
|
cfg.autoplay = to_bool(val)?
|
|
|
|
|
|
|
|
}
|
|
|
|
"encoding" => {
|
|
|
|
"encoding" => {
|
|
|
|
cfg.encoding = Encoding::from_str(val)
|
|
|
|
cfg.encoding = Encoding::from_str(val)
|
|
|
|
.map_err(|e| error!("{} on line {}: {:?}", e, linenum, line))?;
|
|
|
|
.map_err(|e| error!("{} on line {}: {:?}", e, linenum, line))?;
|
|
|
|