2019-12-24 13:16:23 +03:00
|
|
|
extern crate chrono;
|
2019-11-28 17:59:24 +03:00
|
|
|
extern crate dbus;
|
2020-05-14 21:18:37 +03:00
|
|
|
extern crate mpd;
|
2019-12-24 13:16:23 +03:00
|
|
|
|
2020-05-14 21:18:37 +03:00
|
|
|
mod config;
|
|
|
|
|
mod utils;
|
2019-11-21 01:14:53 +03:00
|
|
|
|
2019-12-17 15:05:24 +03:00
|
|
|
#[derive(Debug, Clone)]
|
2019-11-30 14:10:05 +03:00
|
|
|
struct TrackInfo {
|
|
|
|
|
title: String,
|
|
|
|
|
artist: String,
|
|
|
|
|
position: String,
|
|
|
|
|
duration: String,
|
2019-12-03 09:33:26 +03:00
|
|
|
status: String,
|
2019-11-30 03:14:00 +03:00
|
|
|
}
|
|
|
|
|
|
2019-11-21 01:14:53 +03:00
|
|
|
fn main() {
|
2020-05-14 21:18:37 +03:00
|
|
|
let conf = config::read();
|
|
|
|
|
// cpu - cpu usage bar
|
|
|
|
|
// mem - mem usage bar
|
|
|
|
|
// mpris - player info using MPRIS2 interface
|
|
|
|
|
// mpd - player info using MPD native interface
|
|
|
|
|
// utctime - utc time
|
|
|
|
|
// localtime - local time
|
|
|
|
|
match conf.action {
|
|
|
|
|
config::Action::Cpu => utils::cpu_load_bar(15, &conf),
|
|
|
|
|
config::Action::Mem => utils::mem_load_bar(15, &conf),
|
|
|
|
|
config::Action::Mpris => utils::mpris(&conf),
|
|
|
|
|
config::Action::Utctime => utils::get_time(true, ""),
|
|
|
|
|
config::Action::Localtime => utils::get_time(false, ""),
|
|
|
|
|
config::Action::Mpd => utils::mpd(&conf),
|
2019-11-28 18:00:00 +03:00
|
|
|
}
|
2019-11-21 01:14:53 +03:00
|
|
|
}
|