greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

Aur block idea #385

Closed stoope closed 4 years ago

stoope commented 5 years ago

I have an idea of create a block which displays updates count from AUR. Like pacman block. It'll have source parameter (yay, trizen, pikaur, ...). What do you think? Or may be it is better to extend existing pacman block? I can try to implement it.

atheriel commented 5 years ago

Not strongly opposed to this, but we have avoided including AUR updates in the past because of churn in AUR tools.

It's pretty easy to make a Custom block for this, if you need it now.

rsteube commented 5 years ago

Needed AUR updates as well and adjusted the pacman block for pamac which is the default package manager on Manjaro.

https://github.com/rsteube/i3status-rust/commit/876f3f66bf58217632ac6939b63a6b0f17f9b848

ammgws commented 4 years ago

Perhaps the pacman block could be extended with support for checking the output of a command supplied in the i3status-rust's config file.

ammgws commented 4 years ago

@PicoJr Not a release blocker, but perhaps you might like to work on this? I was thinking something like:

PicoJr commented 4 years ago

Add an optional aur_command to the config

Ok, the supplied command should output available updates to stdout. Then we can process the output the same way we do with pacman.

I guess it should work: I don't use an AUR helper for now ^^'

Add a formatter to the pacman block with qualifiers {pacman}, {aur}, {both}

I am not sure I understand what it means.

Does it mean:

Do we keep {count} or do we replace it with {pacman}? (breaking change)

# config for a pacman user
format = "{pacman} updates available"
format_singular = "{pacman} update available"
format_up_to_date = "system up to date"
# config for an AUR helper user
format = "{aur} updates available"
format_singular = "{aur} update available"
format_up_to_date = "system up to date"
# config for a pacman + AUR helper user who wants to aggregate both
format = "{both} updates available"
format_singular = "{both} update available"
format_up_to_date = "system up to date"
# config for a pacman + AUR helper user who wants both AR and AUR update counts displayed
format = "{pacman} and {aur} (AUR) updates available"
# format_singular does not really makes sense here
format_singular = "{pacman} and {aur} (AUR) update available"
format_up_to_date = "system up to date"

Edit: I forgot to mention critical_updates_regex, I suppose it should be checked against both pacman and aur_command outputs.

ammgws commented 4 years ago

I guess it should work: I don't use an AUR helper for now ^^'

I'm using pikaur and this is the output of pikaur -Qua:

Reading local package database...
Reading repository package databases...
Reading AUR packages info...
 aur/downgrade                      6.3.0-1           -> 7.0.0-1

where as fakeroot pacman -Qu --dbpath /tmp/checkup-db-ammgws/ gives:

acl 2.2.53-2 -> 2.2.53-3
argon2 20190702-2 -> 20190702-3
...

So it will be up to the user to write a wrapper script so that their AUR command is in the same format as the pacman output.

I am not sure I understand what it means.

Ah, I was going off the top of my head. Could change pacman to count, or just have both for now and deprecate count in the future.

ammgws commented 4 years ago

Implemented via #385 thanks to @PicoJr