package obus
Pure Ocaml implementation of the D-Bus protocol
Install
Dune Dependency
Authors
Maintainers
Sources
obus-1.2.5.tar.gz
md5=81eb1034c6ef4421a2368a9b352199de
sha512=4b540497188a7d78f4f14f94c6b7fdff47dd06436a34e650ff378dd77bb3e2acb7afd45cd72daf4ddba06e732e9944d560c2882dc37862f1b1f1bb6df37e6205
doc/src/obus.upower/uPower_wakeups.ml.html
Source file uPower_wakeups.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
(* * uPower_wakeups.ml * ----------------- * Copyright : (c) 2010, Jeremie Dimino <jeremie@dimino.org> * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) open Lwt type data = { data_is_userspace : bool; data_id : int; data_value : float; data_cmdline : string option; data_details : string; } open UPower_interfaces.Org_freedesktop_UPower_Wakeups let proxy daemon = OBus_proxy.make (UPower.to_peer daemon) ["org"; "freedesktop"; "UPower"; "Wakeups"] let has_capability daemon = OBus_property.make p_HasCapability (proxy daemon) let get_total daemon = let%lwt value = OBus_method.call m_GetTotal (proxy daemon) () in let value = Int32.to_int value in return value let total_changed daemon = OBus_signal.map (fun value -> let value = Int32.to_int value in value) (OBus_signal.make s_TotalChanged (proxy daemon)) let get_data daemon = let%lwt data = OBus_method.call m_GetData (proxy daemon) () in return (List.map (fun (is_userspace, id, value, cmdline, details) -> { data_is_userspace = is_userspace; data_id = Int32.to_int id; data_value = value; data_cmdline = if cmdline = "" then None else Some cmdline; data_details = details; }) data) let data_changed daemon = OBus_signal.make s_DataChanged (proxy daemon)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>