mirror of
https://github.com/house-of-vanity/tmux-helper.git
synced 2026-02-04 09:47:59 +00:00
Improve player MPRIS line.
This commit is contained in:
committed by
Alexandr Bogomyakov
parent
5d37a86d09
commit
e9c59a6733
2
.github/workflows/PKGBUILD
vendored
2
.github/workflows/PKGBUILD
vendored
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Alexandr Bogomyakov (ultradesu) <ab@hexor.ru>
|
# Maintainer: Alexandr Bogomyakov (ultradesu) <ab@hexor.ru>
|
||||||
|
|
||||||
pkgname=tmux-helper
|
pkgname=tmux-helper
|
||||||
pkgver=0.3.3
|
pkgver=0.3.4
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Tmux helper"
|
pkgdesc="Tmux helper"
|
||||||
url="https://github.com/house-of-vanity/tmux-helper.git"
|
url="https://github.com/house-of-vanity/tmux-helper.git"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tmux-helper"
|
name = "tmux-helper"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
description = "Utility for printing system info for tmux status line."
|
description = "Utility for printing system info for tmux status line."
|
||||||
authors = ["Ultra Desu <ultradesu@hexor.ru>"]
|
authors = ["Ultra Desu <ultradesu@hexor.ru>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|||||||
46
src/utils.rs
46
src/utils.rs
@@ -200,21 +200,37 @@ fn format_player(track_info: TrackInfo, config: &config::Config) {
|
|||||||
}
|
}
|
||||||
let artist_line = shorten(track_info.artist, max_len, 6);
|
let artist_line = shorten(track_info.artist, max_len, 6);
|
||||||
let title_line = shorten(track_info.title, max_len, 6);
|
let title_line = shorten(track_info.title, max_len, 6);
|
||||||
println!(
|
if track_info.position == "00:00" || track_info.duration == "" {
|
||||||
"#[none]#[bold]{}{}{}#[none]{}{}{}{} {}[{}/{}] {} {}#[default]",
|
println!(
|
||||||
config.color_track_name,
|
"#[none]#[bold]{}{}{}#[none]{}{}{}{} {}{} {}#[default]",
|
||||||
title_line,
|
config.color_track_name,
|
||||||
config.color_end,
|
title_line,
|
||||||
separator,
|
config.color_end,
|
||||||
config.color_track_artist,
|
separator,
|
||||||
artist_line,
|
config.color_track_artist,
|
||||||
config.color_end,
|
artist_line,
|
||||||
config.color_track_time,
|
config.color_end,
|
||||||
track_info.position,
|
config.color_track_time,
|
||||||
track_info.duration,
|
track_info.status,
|
||||||
track_info.status,
|
config.color_end,
|
||||||
config.color_end,
|
);
|
||||||
);
|
} else {
|
||||||
|
println!(
|
||||||
|
"#[none]#[bold]{}{}{}#[none]{}{}{}{} {}[{}/{}] {} {}#[default]",
|
||||||
|
config.color_track_name,
|
||||||
|
title_line,
|
||||||
|
config.color_end,
|
||||||
|
separator,
|
||||||
|
config.color_track_artist,
|
||||||
|
artist_line,
|
||||||
|
config.color_end,
|
||||||
|
config.color_track_time,
|
||||||
|
track_info.position,
|
||||||
|
track_info.duration,
|
||||||
|
track_info.status,
|
||||||
|
config.color_end,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mpris(config: &config::Config) {
|
pub fn mpris(config: &config::Config) {
|
||||||
|
|||||||
Reference in New Issue
Block a user