Comments (5)
Hello! Exciting to get it it working on MacBook!
To clarify, you changed this config line, and you get the crash, is that right?
Line 2 in 191e984
Could you show me the contents of the folder?
ls -al /sys/devices/platform/applesmc.768/light
Thanks
from wluma.
Hello! Exciting to get it it working on MacBook!
To clarify, you changed this config line, and you get the crash, is that right?
Line 2 in 191e984
Could you show me the contents of the folder?
ls -al /sys/devices/platform/applesmc.768/light
Thanks
Hi, only just realised there was a config.toml, I pulled it from the AUR and didn't manually build it.
/sys/devices/platform/applesmc.768/light
is a file, it reads (x,0)
(x is the light level).
I don't know rust but I made a fork and I'm trying to see if I can get it to work.
from wluma.
Lovely! Allow me to give you some general pointers, and feel free to ask for clarification 🙂
In this project, the architecture is already prepared to be plug-and-play for different hardware. iio
is just one of many light sensors, and you are the first person to desire to have applesmc
type.
First, create a file next to iio.rs
and call it applesmc.rs
. Inside you will implement the logic that is responsible for letting the rest of the app know about this particular driver.
At the very minimum, your file must contain the implementation for this trait:
Lines 11 to 13 in 191e984
In iio.rs
, this looks like so:
Lines 72 to 80 in 191e984
and in time.rs
, it looks like so:
Lines 15 to 23 in 191e984
Most likely, you can have exactly the same function, with substituted "raw" value read from your sensor.
What are those "thresholds": your sensor will give some integer values, and we need to convert them to some logical groups. I recommend trying to have the same groups as here ("night", "dark", "dim", etc) - and the numbers are the values from your /sys/devices/platform/applesmc.768/light
file under these conditions:
Line 3 in 191e984
Don't worry too much about getting the perfect values, it's just a default config. But it would be nice for them to be reasonable for most people 😉 How you find them is an art... Go in a dark room, see what value your sensor shows, go in a sunny day outside and see the values, etc...
Once you do this, just fill out the rest of the glue code, like defining config like so:
Lines 10 to 14 in 191e984
Extending config.toml
with your example commented out, etc, whatever is needed to make the app run 🙂
And good luck, enjoy this exploration!
from wluma.
Have kind of the same issue as well.
I'm using MacBook Pro (early 2011) and trying to get wluma working properly but it halts with error:
thread 'als' panicked at 'Unable to initialize ALS IIO sensor: "No iio device found"', src/main.rs:112:26
I have
iio:device0
trigger0
under /sys/bus/iio/devices
directory which are symlinks somewhere into the Linux deeps.
I tried to set [als.iio]
path both to /sys/bus/iio/devices/
and /sys/bus/iio/devices/iio:device0
but had no success.
from wluma.
Judging by what you shared, your laptop might not have iio
type of ambient light sensor - you could check inside the iio:device0
folder, there will be a file called name
, and it will tell you what this sensor is - wluma will only use sensors whose name is als
(and it gets the sensor values from another file in the same directory called in_illuminance_raw
.
This thread is about a different kind of sensor that wluma currently doesn't support, called applesmc
, you can check if you have this folder on your laptop /sys/devices/platform/applesmc.768/
, if yes - implementing this new sensor type this issue will indeed solve the issue for you; if you don't have it, it might be better to open another issue if you would like to continue this investigation 🙂
from wluma.
Related Issues (20)
- [Bug]: ALS data not parsed/calculated correctly HOT 2
- [Bug]: Can't find display, but shows up in ddcutil detect HOT 8
- [Bug]: Cargo failling to compile v4l-sys HOT 5
- [Bug]: Unable to start wluma from the command line HOT 3
- [Feature request]: gracefully disable capture when not wlroots HOT 2
- [Feature request]: be lenient with config file and assume defaults HOT 1
- [Feature request]: print more debug info HOT 3
- [Feature request]: Add timeout for keyboard backlight HOT 3
- How do I adjust the brightness HOT 2
- [Feature request]: Support Hyprland screen capturing (after its transition away from wlroots) HOT 26
- [Feature request]: disable screen contents brightness HOT 2
- [Bug]: Prediction stays at 242 HOT 1
- [Feature request]: Support monitor disconnect HOT 6
- [Bug]: Unable to initialize Vulkan: ERROR_EXTENSION_NOT_PRESENT HOT 4
- [Bug]: wluma refuses to read my config file HOT 2
- configuration question HOT 6
- [Feature request]: Add gamma control HOT 9
- [Bug]: `Backlight::new` returns early instead of using dbus
- [Bug]: No binary in Github artifacts HOT 3
- [Feature request]: Support custom external sources for luminance value HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wluma.