mrmekon / circadian

Suspend-On-Idle Daemon for GNU/Linux Power Management
GNU General Public License v3.0
254 stars 16 forks source link

`w` command default parameters #12

Closed bbx0 closed 2 years ago

bbx0 commented 3 years ago

Thanks for creating this daemon, it works pretty well! :)

The current implementation relies on default parameters for the w command, which are not configured by upstream in this way. This causes issues when running on "non debian-based" distros. I run into the problem on Arch (and also created a package + patch for it https://aur.archlinux.org/packages/circadian/ )

-f, --from Toggle printing the from (remote hostname) field. The default as released is for the from field to not be printed, although your system administrator or distribution maintainer may have compiled a version in which the from field is shown by default.

Please can you change the parameters for the w command from -hus to -husf. This does not break any existing usage and follows the upstream configuration allowing easier consumption by other distros.

mrmekon commented 2 years ago

Thanks for reporting this, and for making the AUR package!

It's a bit stupid, the -f flag toggles the FROM field instead of enabling it, so adding it fixes Arch and breaks Debian. I added a new function to count the number of fields and always use the second-to-last one. Should be good enough.

This is now merged and released as v0.7.0.

bbx0 commented 2 years ago

Cool, thanks a lot! Works fine on Arch for me.

That this flag toggles is indeed quite odd and unexpected. Thanks for working around!

AUR is updated as well.