diff options
-rw-r--r-- | pm-suspend.c | 15 |
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); +} |