diff --git a/home/default.nix b/home/default.nix index f903685..672b651 100644 --- a/home/default.nix +++ b/home/default.nix @@ -9,6 +9,7 @@ in ./cads.nix ./cmd_tools.nix ./i3.nix + ./i3status.nix ./media.nix ./picom.nix ./tmux.nix diff --git a/home/i3.nix b/home/i3.nix index fdc3999..adf2346 100644 --- a/home/i3.nix +++ b/home/i3.nix @@ -10,73 +10,6 @@ let EXIT = "i3-nagbar -t warning -m 'Exit i3?' -B 'Yes' 'i3-msg exit'"; in { - programs.i3status = { - enable = true; - enableDefault = false; - general = { - output_format = "i3bar"; - interval = 1; - colors = true; - color_separator = "#FFFFFF"; - color_good = "#00FF00"; - color_degraded = "#00FFFF"; - color_bad = "#FF0000"; - separator = "]["; - }; - modules = { - "time" = { - position = 1; - settings = { - format = "%Y %m/%d %a | %H:%M:%S"; - }; - }; - "load" = { - position = 2; - settings = { - format = "LD %1min:%5min:%15min"; - format_above_threshold = "LD H (%1min:%5min)"; - max_threshold = "4.9"; - }; - }; - "memory" = { - position = 3; - settings = { - memory_used_method = "classical"; - decimals = "1"; - unit = "Mi"; - format = "%available (%used) / %total"; - format_degraded = "Mem LOW (%available)"; - threshold_degraded = "10%"; - threshold_critical = "6.25%"; - }; - }; - "disk /" = { - position = 4; - settings = { - prefix_type = "decimal"; - format = "/ %percentage_used"; - }; - }; - "volume master" = { - position = 5; - settings = { - format = "Vol: %volume"; - format_muted = "Vol: Muted (%volume)"; - device = "pulse:1"; - }; - }; - "wireless _first_" = { - position = 6; - settings = { - format_up = "W: (%quality @ %essid w/ %bitrate) %ip"; - format_down = "W: down"; - format_bitrate = "%g %cb/s"; - format_quality = "%03d%s"; - }; - }; - }; - }; - xsession.windowManager.i3 = { enable = true; config = { diff --git a/home/i3status.nix b/home/i3status.nix new file mode 100644 index 0000000..3e423a1 --- /dev/null +++ b/home/i3status.nix @@ -0,0 +1,87 @@ +{ config, pkgs, lib, ... }: +let + inherit (builtins) map genList listToAttrs; + inherit (lib.lists) length imap0 forEach reverseList elemAt; + modules = [ + { + name = "time"; + settings = { + format = "%Y %m/%d %a | %H:%M:%S"; + }; + } + { + name = "load"; + settings = { + format = "LD %1min:%5min:%15min"; + format_above_threshold = "LD H (%1min:%5min)"; + max_threshold = "4.9"; + }; + } + { + name = "memory"; + settings = { + memory_used_method = "classical"; + decimals = "1"; + unit = "Mi"; + format = "%available (%used) / %total"; + format_degraded = "Mem LOW (%available)"; + threshold_degraded = "10%"; + threshold_critical = "6.25%"; + }; + } + { + name = "disk /"; + settings = { + prefix_type = "decimal"; + format = "/ %percentage_used"; + }; + } + { + name = "volume master"; + settings = { + format = "Vol: %volume"; + format_muted = "Vol: Muted (%volume)"; + }; + } + { + name = "wireless _first_"; + settings = { + format_up = "W: (%quality @ %essid w/ %bitrate) %ip"; + format_down = "W: down"; + format_bitrate = "%g %cb/s"; + format_quality = "%03d%s"; + }; + } + ]; + modulesLength = length modules; + modPositions = map (x: + { position = x; } + ) (reverseList (genList (x: x+1) modulesLength)); + numberedModulesList = imap0 (i: v: + (elemAt modules i) // v + ) modPositions; + modNameValList = forEach numberedModulesList (x: { + name = x.name; + value = { + inherit (x) settings position; + }; + }); + modAttr = listToAttrs modNameValList; +in +{ + programs.i3status = { + enable = true; + enableDefault = false; + general = { + output_format = "i3bar"; + interval = 1; + colors = true; + color_separator = "#FFFFFF"; + color_good = "#00FF00"; + color_degraded = "#00FFFF"; + color_bad = "#FF0000"; + separator = "]["; + }; + modules = modAttr; + }; +} diff --git a/home/picom.nix b/home/picom.nix index 2e669e9..d06ea0e 100644 --- a/home/picom.nix +++ b/home/picom.nix @@ -2,8 +2,9 @@ { services.picom = { enable = true; - backend = "glx"; + backend = "egl"; fade = true; + fadeDelta = 5; fadeExclude = [ "window_type *= 'menu'" "focused = 1"