kobo-core 0.4.0

Kobo e-reader device SDK: device database, sysfs/ioctl, rendering, audio pipeline, trait surface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Nayeem Bin Ahsan
//! Wall-clock time for the on-screen clock (shells out to `date` for the
//! locale-correct 12-hour format).

use std::process::Command;

pub fn current_clock() -> String {
    Command::new("date")
        .args(["+%-I:%M %p"])
        .output()
        .ok()
        .and_then(|o| String::from_utf8(o.stdout).ok())
        .map(|s| s.trim().to_string())
        .unwrap_or_else(|| "--:--".to_string())
}