pub struct Settings {
pub persistent: bool,
pub show_track_cover: bool,
pub notification_static_cover: Option<String>,
pub cover_path_template: Option<String>,
pub app_name: Option<String>,
pub cmus_socket_address: Option<String>,
pub cmus_socket_password: Option<String>,
pub link: bool,
pub force_use_external_cover: bool,
pub no_use_external_cover: bool,
pub show_player_notifications: bool,
/* private fields */
}Fields§
§persistent: boolMake the notification persistent, i.e. not disappear after a timeout (you can dismiss it manually)
show_track_cover: boolShow the track cover in the notification, if available
notification_static_cover: Option<String>The static icon to use for the notification, it not effective if the track cover is shown, but if the cover is not available or you disabled it, this icon will be used.
you can give it the full path to an image file or a name of an icon from the current icon theme (e.g. “audio-x-generic” or “spotify-client”)
cover_path_template: Option<String>The path to look for the cover image, if not given, the cover will be searched in the track’s directory for an image file with the name “cover”.
You can use the placeholder “{artist}” and “{album}” and “{title}” and “{track_number}” and
“{disc_number}” and “{year}” and “{genre}” in the path, they will be replaced with the corresponding metadata.
but if the metadata is not available, the placeholder will be replaced with an empty string.
And you can use the simple glob pattern * to match any character.
e.g. “covers/{artist}/{album}/cover.”, “covers/{artist}/{album}/”,
If you not specify the full path, the cover will be started from the track’s directory.
app_name: Option<String>The name of the app to use for the notification.
cmus_socket_address: Option<String>The cmus socket address, if not given, the program will use the default socket address, which is “$XDG_RUNTIME_DIR/cmus-socket”.
cmus_socket_password: Option<String>The cmus socket password, if any.
link: boolLink the program with cmus, if the cmus are not running, the program will exit.
force_use_external_cover: boolForce the program to use the external cover file, if available, and not even try to get the cover from the track’s metadata. this is useful if you have a cover file with a better quality than the cover in the track’s metadata.
no_use_external_cover: boolNo use the external cover file, even if it’s available and the track’s metadata doesn’t have a cover.
show_player_notifications: boolShow the player notifications, like if you change the shuffle mode, or the repeat mode, or the volume.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn load_config_and_parse_args() -> Self
pub fn load_config_and_parse_args() -> Self
Load the config file and parse the args. And combine them together. The args will override the config. If the config file is not found, create a new one, and use the default values. If the config file is found, but the config is invalid, use the default values.
pub fn timeout(&self) -> i32
pub fn app_name(&self) -> String
pub fn interval(&self) -> u64
pub fn depth(&self) -> u8
pub fn remote_bin_path(&self) -> String
pub fn status_notification_summary(&self) -> String
pub fn status_notification_body(&self) -> String
pub fn status_notification_timeout(&self) -> i32
pub fn summary(&self) -> String
pub fn body(&self) -> String
pub fn volume_notification_summary(&self) -> String
pub fn volume_notification_body(&self) -> String
pub fn volume_notification_timeout(&self) -> i32
pub fn shuffle_notification_summary(&self) -> String
pub fn shuffle_notification_body(&self) -> String
pub fn shuffle_notification_timeout(&self) -> i32
pub fn repeat_notification_summary(&self) -> String
pub fn repeat_notification_body(&self) -> String
pub fn repeat_notification_timeout(&self) -> i32
pub fn aaa_mode_notification_summary(&self) -> String
pub fn aaa_mode_notification_body(&self) -> String
pub fn aaa_mode_notification_timeout(&self) -> i32
Trait Implementations§
Source§impl Args for Settings
impl Args for Settings
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Settings
impl CommandFactory for Settings
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromArgMatches for Settings
impl FromArgMatches for Settings
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for Settings
impl Parser for Settings
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().