aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHank <hanketsu@egregore.fun>2025-04-06 11:42:35 +0200
committerHank <hanketsu@egregore.fun>2025-04-06 11:45:41 +0200
commitf74e3d8b644e967825c73aeebb141bab7b277b10 (patch)
treeec560594edabfc57ef6766011b58ccdba17d6d43
parent704ede4c3150a7dcaa0a6ebbc119ade55bdebb2b (diff)
feat!: add initial pm-suspend.c
-rw-r--r--pm-suspend.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pm-suspend.c b/pm-suspend.c
new file mode 100644
index 0000000..90eb3aa
--- /dev/null
+++ b/pm-suspend.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv) {
+ FILE *f = fopen("/sys/power/state", "w");
+
+ if(f == NULL) {
+ printf("%s\n", argv[1]);
+ exit(1);
+ }
+
+ fprintf(f, "%s", argv[1]);
+
+ fclose(f);
+}