autocommit 2022-04-10 18:26:13 CEST
This commit is contained in:
parent
af152f7f3e
commit
6b3316e920
26 changed files with 514 additions and 82 deletions
|
|
@ -1,25 +1,31 @@
|
|||
use jay_config::{
|
||||
config,
|
||||
drm::{get_connector, on_connector_connected, on_new_connector},
|
||||
embedded::grab_input_device,
|
||||
get_workspace,
|
||||
input::{
|
||||
capability::{CAP_KEYBOARD, CAP_POINTER},
|
||||
create_seat, input_devices, on_new_input_device, InputDevice, Seat,
|
||||
},
|
||||
keyboard::{
|
||||
mods::{Modifiers, ALT, CTRL, SHIFT},
|
||||
syms::{
|
||||
SYM_Super_L, SYM_b, SYM_c, SYM_d, SYM_f, SYM_h, SYM_j, SYM_k, SYM_l, SYM_m, SYM_p,
|
||||
SYM_q, SYM_t, SYM_v, SYM_y, SYM_F1, SYM_F10, SYM_F11, SYM_F12, SYM_F13, SYM_F14,
|
||||
SYM_F15, SYM_F16, SYM_F17, SYM_F18, SYM_F19, SYM_F2, SYM_F20, SYM_F21, SYM_F22,
|
||||
SYM_F23, SYM_F24, SYM_F25, SYM_F3, SYM_F4, SYM_F5, SYM_F6, SYM_F7, SYM_F8, SYM_F9,
|
||||
use {
|
||||
chrono::{format::StrftimeItems, Local, Timelike},
|
||||
jay_config::{
|
||||
config,
|
||||
drm::{get_connector, on_connector_connected, on_new_connector},
|
||||
embedded::grab_input_device,
|
||||
get_timer, get_workspace,
|
||||
input::{
|
||||
capability::{CAP_KEYBOARD, CAP_POINTER},
|
||||
create_seat, input_devices, on_new_input_device, InputDevice, Seat,
|
||||
},
|
||||
keyboard::{
|
||||
mods::{Modifiers, ALT, CTRL, SHIFT},
|
||||
syms::{
|
||||
SYM_Super_L, SYM_b, SYM_c, SYM_d, SYM_f, SYM_h, SYM_j, SYM_k, SYM_l, SYM_m, SYM_p,
|
||||
SYM_q, SYM_t, SYM_v, SYM_y, SYM_F1, SYM_F10, SYM_F11, SYM_F12, SYM_F13, SYM_F14,
|
||||
SYM_F15, SYM_F16, SYM_F17, SYM_F18, SYM_F19, SYM_F2, SYM_F20, SYM_F21, SYM_F22,
|
||||
SYM_F23, SYM_F24, SYM_F25, SYM_F3, SYM_F4, SYM_F5, SYM_F6, SYM_F7, SYM_F8, SYM_F9,
|
||||
},
|
||||
},
|
||||
quit,
|
||||
status::set_status,
|
||||
switch_to_vt,
|
||||
Axis::{Horizontal, Vertical},
|
||||
Command,
|
||||
Direction::{Down, Left, Right, Up},
|
||||
},
|
||||
quit, switch_to_vt,
|
||||
Axis::{Horizontal, Vertical},
|
||||
Command,
|
||||
Direction::{Down, Left, Right, Up},
|
||||
std::time::Duration,
|
||||
};
|
||||
|
||||
const MOD: Modifiers = ALT;
|
||||
|
|
@ -117,6 +123,28 @@ pub fn configure() {
|
|||
on_new_connector(move |_| handle_connectors_changed());
|
||||
on_connector_connected(move |_| handle_connectors_changed());
|
||||
handle_connectors_changed();
|
||||
|
||||
{
|
||||
let time_format: Vec<_> = StrftimeItems::new("%Y-%m-%d %H:%M:%S").collect();
|
||||
let update_status = move || {
|
||||
let status = format!(
|
||||
"{}",
|
||||
Local::now().format_with_items(time_format.iter()),
|
||||
);
|
||||
set_status(&status);
|
||||
};
|
||||
update_status();
|
||||
let initial = {
|
||||
let now = Local::now();
|
||||
5000 - (now.second() * 1000 + now.timestamp_subsec_millis()) % 5000
|
||||
};
|
||||
let timer = get_timer("status_timer");
|
||||
timer.program(
|
||||
Duration::from_millis(initial as u64),
|
||||
Some(Duration::from_secs(5)),
|
||||
);
|
||||
timer.on_tick(update_status);
|
||||
}
|
||||
}
|
||||
|
||||
config!(configure);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue