aboutsummaryrefslogtreecommitdiff
path: root/src/deviceinfo-flashlight.c
diff options
context:
space:
mode:
authorMuhammad <muhammad23012009@hotmail.com>2023-05-12 17:49:30 +0500
committerMuhammad <muhammad23012009@hotmail.com>2023-06-05 23:01:18 +0500
commitdd3dccb5b3ece993ea648f76ff0cc9aa08527061 (patch)
tree1af9ef4b73a3657774bc161a05a5d3bb1a11ca4a /src/deviceinfo-flashlight.c
parent08039f0bfcd35efca2a075bbf49fe3e45d89d5bf (diff)
downloadayatana-indicator-power-dd3dccb5b3ece993ea648f76ff0cc9aa08527061.tar.gz
ayatana-indicator-power-dd3dccb5b3ece993ea648f76ff0cc9aa08527061.tar.bz2
ayatana-indicator-power-dd3dccb5b3ece993ea648f76ff0cc9aa08527061.zip
src: add support for getting flashlight paths through deviceinfo
Signed-off-by: Muhammad <muhammad23012009@hotmail.com>
Diffstat (limited to 'src/deviceinfo-flashlight.c')
-rw-r--r--src/deviceinfo-flashlight.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/deviceinfo-flashlight.c b/src/deviceinfo-flashlight.c
new file mode 100644
index 0000000..e31c1ff
--- /dev/null
+++ b/src/deviceinfo-flashlight.c
@@ -0,0 +1,13 @@
+#include <deviceinfo_c_api.h>
+
+char* flashlight_path()
+{
+ struct DeviceInfo* di = deviceinfo_new();
+ return deviceinfo_get(di, "FlashlightSysfsPath", "");
+}
+
+char* flashlight_switch_path()
+{
+ struct DeviceInfo* di = deviceinfo_new();
+ return deviceinfo_get(di, "FlashlightSwitchPath", "");
+}