This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| fan_speed_path="/sys/bus/platform/devices/aorus_laptop/fan_custom_speed" | |
| fan_mode_path="/sys/bus/platform/devices/aorus_laptop/fan_mode" | |
| current_speed=$(cat $fan_speed_path) | |
| if [[ $1 == "perms" ]]; then | |
| chmod o+w $fan_mode_path | |
| chmod o+w $fan_speed_path | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define List(type) struct List_##type {\ | |
| type *data;\ | |
| size_t cap;\ | |
| size_t size;\ | |
| } | |
| // inspired by Tsoding | |
| #define da_append(arr, obj) do {\ | |
| if ((arr).cap == 0) {\ | |
| (arr).cap = 256;\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define List(type) struct { \ | |
| int len; \ | |
| int cap; \ | |
| typeof(type) contents; \ | |
| } | |
| // struct List; |