一组用于获取系统信息,天气,播放器控制的命令工具。
主要用于在 wayland 系统下提供数据给 waybar
, eww
。
功能开发中
wayinfo
- system
- cpu
- gpu
- memory
- network
- disk
- unmount
- weather 使用高德天气API
- player
- player Player Identity
- next next song
- previous previous song
- toggle toggle play or pause
- play play
- stop stop
- status Playback status (Playing|Paused|Stopped)
- status-icon Playing , other
- title title of song
- artist artist of song
- album album of song
- cover cover of song
- track-number Track Number of
- position Position time at playing
- positions Position second at playing
- length Length of song
- lengths Length second of song
- shuffle
- loop 循环模式
- lyrics lyrics
- waybar waybar format
天气使用高德天气API,需要 key.
wayinfo weather --waybar --city 上海 --key-file $HOME/.config/apikeys/gaode.txt
播放器控制使用 playerctld
支持 MPRIS
协议播放器。
如果使用
mpd
可以安装mpd-mpris
服务以获得支持。
{
"custom/weather": {
"format": "{}",
"format-alt": "{alt}",
"return-type": "json",
"exec": "wayinfo weather --waybar --city 上海 --key-file $HOME/.config/apikeys/gaode.txt 2> /dev/null",
"exec-if": "which wayinfo",
"on-click-right": "gnome-weather"
},
"custom/media": {
"format": "{}",
"return-type": "json",
"max-length": 85,
"interval": 5,
"exec": "wayinfo player waybar",
"on-click": "wayinfo player toggle",
"on-click-right": "wayinfo player next",
"on-click-middle": "niri msg spawn -- eww open --toggle music"
}
}