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

Make master compatible with Linux #33

Closed
psibi opened this issue Feb 6, 2021 · 4 comments
Closed

Make master compatible with Linux #33

psibi opened this issue Feb 6, 2021 · 4 comments

Comments

@psibi
Copy link
Collaborator

psibi commented Feb 6, 2021

I see that a related issue was open already but it has been closed: #32

I'm planning to try out cnx and possibly make it as my status bar. But unfortunately it seem the master doesn't seem to be working with Linux.

From looking further it seems to be because of sioctl which is introduced in the volume widget. Would you be willing it to make it behind an optional feature instead: https://doc.rust-lang.org/cargo/reference/features.html

I can also volunteer to send a PR for the same. :-)

@psibi
Copy link
Collaborator Author

psibi commented Feb 7, 2021

I have created a PR which makes it compile under Linux system: #34

I also noted that the volume and the sensors plugin in master doesn't seem to be working under Linux system. Looking at the code, it seems to be tailored for BSD operating systems. I would be interested to add add support for Linux too. Is the upstream interested in such changes ?

@mjkillough
Copy link
Owner

mjkillough commented Feb 8, 2021

I also noted that the volume and the sensors plugin in master doesn't seem to be working under Linux system. Looking at the code, it seems to be tailored for BSD operating systems. I would be interested to add add support for Linux too. Is the upstream interested in such changes ?

If this would be useful for you, you'd be very welcome to make the change!

There are a couple of places in the code where I have placed type Widget = OpenBsd; (e.g. in volume.rs and I think in the battery/sensors widgets too). I'd imagined that there would be both OpenBsd and Linux types which implement the same methods but generate informatation using platform specific methods. The OpenBsd type would be #[cfg(target_os ="openbsd")] and the Linux type would be #[cfg(target_os = "linux")]. That way the bulk of the widget's rendering would be shared between platform, but the platform specific bits won't interfere with each other.

There is some code for all three widgets in the v0.2.0 tag which could be the basis for this work, but they'll need updating as they were written for Tokio 0.1.0.

Unfortunately I'm not going to be able to help beyond merging PRs, and I may be quite slow to do that. Please don't let that put you off though! I wrote Cnx because I wanted to write something that I could use (and I do, everyday!), so I'd encourage you to do the same. :-)

@psibi
Copy link
Collaborator Author

psibi commented Feb 9, 2021

Thanks for the reply! I would be slowly sending PR's as I make things work on my machine (and as I find time!). Thanks for creating cnx. :-)

@psibi
Copy link
Collaborator Author

psibi commented May 15, 2021

Closing this as master is compatible with Linux now.

@psibi psibi closed this as completed May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants