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

Auto-detect device #59

Open
Eeems opened this issue Feb 8, 2024 · 1 comment
Open

Auto-detect device #59

Eeems opened this issue Feb 8, 2024 · 1 comment
Labels
enhancement New feature or request rewrite

Comments

@Eeems
Copy link
Collaborator

Eeems commented Feb 8, 2024

Instead of requiring the user to pass the --rm1 flag, it would be preferable to auto-detect the device where possible.

@Eeems
Copy link
Collaborator Author

Eeems commented Feb 8, 2024

def is_rm():
if not os.path.exists("/sys/devices/soc0/machine"):
return False
with open("/sys/devices/soc0/machine") as f:
return f.read().strip().startswith("reMarkable")

This is most of the way to detecting which device. /sys/devices/soc0/machine will contain reMarkable 2.0 on a rM2, and either reMarkable 1.0 or reMarkable Prototype 1, depending on how old the OS version is.

@Jayy001 Jayy001 added enhancement New feature or request rewrite labels Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rewrite
Projects
None yet
Development

No branches or pull requests

2 participants