From 434c9625b1e4da2a67db8cef3be21620b64b418b Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 24 Apr 2024 18:32:14 +0300 Subject: [PATCH] Setting : Add popup timeout setting. --- module/sway/module/Input.nix | 4 ++-- part/Setting.nix | 3 ++- user/common/mako/default.nix | 8 ++++---- user/common/top/btop/default.nix | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/module/sway/module/Input.nix b/module/sway/module/Input.nix index f658c66..b5ce005 100644 --- a/module/sway/module/Input.nix +++ b/module/sway/module/Input.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ setting, ... }: { text = '' ### Input configuration # @@ -38,6 +38,6 @@ } # Hide mouse cursor after a period of inactivity. - seat seat0 hide_cursor 5000 + seat seat0 hide_cursor ${setting.popup.timeout.ms} ''; } diff --git a/part/Setting.nix b/part/Setting.nix index e7ecb07..eebeec8 100644 --- a/part/Setting.nix +++ b/part/Setting.nix @@ -52,7 +52,8 @@ }; }; - top.refresh = "2000"; + top.refresh.ms = "2000"; + popup.timeout.ms = "5000"; brightness.step = "5"; volume.step = "5"; diff --git a/user/common/mako/default.nix b/user/common/mako/default.nix index 6961669..c6361e1 100644 --- a/user/common/mako/default.nix +++ b/user/common/mako/default.nix @@ -1,10 +1,10 @@ -{ style, util, ... }: { +{ style, util, setting, ... }: { config = util.trimTabs '' anchor=top-center - default-timeout=5000 + default-timeout=${setting.popup.timeout.ms} font=${style.font.serif.name} ${toString(style.font.size.popup)} - background-color=#${style.color.bg.regular} - border-color=#${style.color.bg.regular} + background-color=#${style.color.bg.dark} + border-color=#${style.color.bg.dark} text-color=#${style.color.fg.light} height=120 icons=0 diff --git a/user/common/top/btop/default.nix b/user/common/top/btop/default.nix index f89d561..5488104 100644 --- a/user/common/top/btop/default.nix +++ b/user/common/top/btop/default.nix @@ -55,7 +55,7 @@ shown_boxes = "cpu mem net proc" #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. - update_ms = ${setting.top.refresh} + update_ms = ${setting.top.refresh.ms} #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.