JakeRoggenbuck / auto-clock-speed

A utility to check stats about your CPU, and auto regulate clock speeds to help with either performance or battery life.
https://autoclockspeed.org
MIT License
33 stars 9 forks source link

Optional Governor Mode Switch Notifications #551

Open JakeRoggenbuck opened 8 months ago

JakeRoggenbuck commented 8 months ago

When the governor mode changes, send a notify-send

Camerooooon commented 6 months ago

I'm curious what the use case would be here, would anyone realistically want to be notified every single time the governor is changed?

Camerooooon commented 6 months ago

An implementation hurdle I just reached was the fact that you cannot send a notification as root. This means auto clock speed would need to have a second, user level daemon or fork a new user level process to send notifications. https://github.com/hoodie/notify-rust/issues/156

The solution I've found is to spawn a user process that is in charge of sending the notification https://stackoverflow.com/questions/28195805/running-notify-send-as-root

Seems like a lot of overhead just to send a notification, happy to implement some code which forks the process in the user space if we want to go through with this feature.

@JakeRoggenbuck @Shuzhengz thoughts?

JakeRoggenbuck commented 6 months ago

Good solution! It's totally up to you if you wanna write the process part. Saw your PR and it looks good!