Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added general detection for wayland compositors #164

Merged
merged 4 commits into from
Aug 28, 2023
Merged

Added general detection for wayland compositors #164

merged 4 commits into from
Aug 28, 2023

Conversation

Absolpega
Copy link
Contributor

@Absolpega Absolpega commented Aug 26, 2023

resolves #90

this is my first ever pull request

the code is based on this stack overflow answer https://stackoverflow.com/a/72755046

@grtcdr
Copy link
Member

grtcdr commented Aug 28, 2023

Thanks for the contribution!

I have a minor nitpick regarding the readout's output. It seems that /proc/<pid>/comm could end in a newline, which we will want to remove, otherwise the output may appear as shown in this next picture.

2023-08-28T15:20:35,385591814+01:00

@Absolpega
Copy link
Contributor Author

oh yea
i didn't notice that because my fetch removes any new lines when printing

@grtcdr
Copy link
Member

grtcdr commented Aug 28, 2023

We have extra::pop_newline that'll do this for you :)

@Absolpega
Copy link
Contributor Author

Absolpega commented Aug 28, 2023

i think a cleaner option would be String::trim()

@Absolpega
Copy link
Contributor Author

on second thought
String::trim returns &str

@Absolpega
Copy link
Contributor Author

@grtcdr made the change

Copy link
Contributor

@Gobidev Gobidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Owner of pfetch-rs here.
The PR looks good to me! @Absolpega thank's a lot for implementing this and contributing to this project, this helps a lot! ❤️

Works as expected on Gnome on Wayland.

@grtcdr
Copy link
Member

grtcdr commented Aug 28, 2023

Thanks again, @Absolpega.

A future step should be to stylize (according to conventions) the different compositor names, this pull request doesn't need to implement that, but it'd be nice to have.

@grtcdr grtcdr merged commit f4ea9be into Macchina-CLI:main Aug 28, 2023
8 checks passed
grtcdr added a commit that referenced this pull request Sep 28, 2024
* Fix Armv7 build (#158)

* Add armv7 build target

* Fix mismatched types for pointer width 32

* Use `sh` instead of `python` for `which` assertion

* Replace mach with mach2 (#157)

* feat: add support for RPM `ndb` databases (#159)

* feat: add support for RPM `ndb` databases

* chore: always try sqlite before librpm

* chore: remove `rpm` feature

* fix: librpm call not lazily evaluated

* Add `librpm` dependency note to README (#160)

* Update the changelog

* Bump version to 7.1.0

* Fix i686 build (#162)

closes #161

* Add Sonoma to macos_version_to_name (#163)

* BREAKING CHANGE: Change BatteryReadout::health return value to u8

There's no particular reason why one should allocate 64 bits for a
value that can only be <= 100.

As a bonus, ceil() the return value before finally casting to u8.

* Update BatteryReadout::health function signature

for other operating systems besides Linux.

* Added general detection for wayland compositors (#164)

* Upgrade dependencies to their latest versions

* Update changelog

Make some formatting changes as well.

* Add missing generic argument

sqlite's changed a bit between releases.

* Bump version to 7.2.0

* Add missing second generic argument to sqlite read() call

* Remove unneeded argument to unistd::gethostname function call

* Remove unused variable

* Refactor obsolete find_ifa function

* Bump version to 7.2.1

* Bump vergen version

* Use gitcl feature of vergen

This depends on the git binary, more ubiquituous than the libgit2 bindings, so
it should technically work on every platform we support.

* Refactor the old vergen interface

* Add new entry to the changelog

* Update version to 7.2.2

* Replace flatten() calls with map_while(Result::ok)

* Fix Readouts struct's network field type

Closes: #168

* Improve CI workflow (#169)

* Replace discontinued actions-rs

* Split cargo fmt and clippy into their own CI job

* Faster package count on Alpine Linux (#170)

* Bump version to 7.2.3

* added macos 15 version name (#171)

https://www.apple.com/newsroom/2024/06/macos-sequoia-takes-productivity-and-intelligence-on-mac-to-new-heights/

* Removed panic if local gpu db is not able to be read (#173)

* Add support for the Nix package manager (#172)

Added support for the Nix package manager using Nix' SQLite database.

* Bump version and update changelog

* linux: Safely exit when homebrew is not installed

* Improve linuxbrew keepme safeguard

* Remove unused import

* Bump version to 7.3.1

* Allow disk_space function to accept a path argument (#156)

BREAKING CHANGE: allow disk_space function to accept a path argument
- Bump version and update changelog
- Change disk_space path argument to be of type &Path and check path exists in shared::disk_space
- Add missing import for openwrt

---------

Co-authored-by: Adrian Groh <50576978+Gobidev@users.noreply.github.com>
Co-authored-by: Silas Groh <silas.groh@t-online.de>
Co-authored-by: grtcdr <tahaaziz.benali@esprit.tn>
Co-authored-by: Rex Ng <rex.ky.ng@gmail.com>
Co-authored-by: Absolpega <106615943+Absolpega@users.noreply.github.com>
Co-authored-by: grtcdr <ba.tahaaziz@gmail.com>
Co-authored-by: Matthias Baer <matthiasbaer@bluewin.ch>
Co-authored-by: Rex Ng <timescam@duck.com>
Co-authored-by: coolGi <57488297+coolGi2007@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Wayland users, how does your window manager identify itself?
3 participants