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

Add local and config #123

Merged
merged 9 commits into from
Jan 15, 2022
Merged

Add local and config #123

merged 9 commits into from
Jan 15, 2022

Conversation

JakeRoggenbuck
Copy link
Owner

@JakeRoggenbuck JakeRoggenbuck commented Jan 10, 2022

fixes #83

TODO

  • Check config directory
  • Make config directory
  • Make config file
  • Use default config if file not found

@@ -73,13 +71,11 @@ pub fn read_battery_charge() -> Result<i8, Error> {
let battery_charge_path: Vec<&str> = vec![
"/sys/class/power_supply/BAT/capacity",
"/sys/class/power_supply/BAT0/capacity",
"/sys/class/power_supply/BAT1/capacity"
"/sys/class/power_supply/BAT1/capacity",
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a BAT2 as well just in case? ( i do have a BAT2 in my system but its empty so idk what happened there)

Copy link
Owner Author

Choose a reason for hiding this comment

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

yea

@Camerooooon
Copy link
Collaborator

Panicked thread 'main' panicked at 'No such file or directory (os error 2)', src/config.rs:24:19 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@JakeRoggenbuck
Copy link
Owner Author

Oh yea, thanks for catching that, i forgot to make something to check if the file exists. It check directory, just not file. I'll add that, thanks!

@JakeRoggenbuck
Copy link
Owner Author

@Camerooooon I think I fixed it

@JakeRoggenbuck
Copy link
Owner Author

image

Copy link
Collaborator

@Shuzhengz Shuzhengz left a comment

Choose a reason for hiding this comment

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

lgtm

@JakeRoggenbuck JakeRoggenbuck merged commit bab4217 into main Jan 15, 2022
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

Successfully merging this pull request may close these issues.

Make a config file
3 participants