diff --git a/modules/programs/q.nix b/modules/programs/q.nix index 5a76db1..59717b9 100644 --- a/modules/programs/q.nix +++ b/modules/programs/q.nix @@ -23,6 +23,10 @@ in { default = true; type = with types; bool; }; + userHighlight = mkOption { + default = [ config.users.users.mainUser.name ]; + type = with types; listOf str; + }; }; config = mkIf cfg.enable { @@ -31,6 +35,7 @@ in { timeZones = cfg.timeZones; enableIntelBacklight = cfg.enableIntelBacklight; enableBattery = cfg.enableBattery; + userHighlight = cfg.userHighlight; }) ]; }; diff --git a/pkgs/q/default.nix b/pkgs/q/default.nix index 3dfbcab..3e16b66 100644 --- a/pkgs/q/default.nix +++ b/pkgs/q/default.nix @@ -2,7 +2,7 @@ # tzselect is your frind do find timezones , timeZones ? [ ], timeColor ? 9, timeZoneColor ? 10, calBackgroundColor ? 10 , calWeekColor ? 13, calDayColor ? 9, enableIntelBacklight ? true -, enableBattery ? true, ... }: +, userHighlight ? [ "palo" ], enableBattery ? true, ... }: let @@ -296,11 +296,13 @@ let ''; q-show-users = '' - ${pkgs.procps}/bin/ps aux \ - | ${pkgs.gawk}/bin/awk '{ print $1 }' \ + ${pkgs.procps}/bin/ps -eo user \ | ${pkgs.gnused}/bin/sed '1 d' \ | ${pkgs.coreutils}/bin/sort \ | ${pkgs.coreutils}/bin/uniq \ + | ${pkgs.gnugrep}/bin/egrep --color=always '(${ + lib.concatStringsSep "|" userHighlight + })|$' \ | ${pkgs.utillinux}/bin/column ''; diff --git a/system/desktop/browser.nix b/system/desktop/browser.nix index 11f41fe..11e5d09 100644 --- a/system/desktop/browser.nix +++ b/system/desktop/browser.nix @@ -57,4 +57,9 @@ in { }; }; + + # highlight browser users in q command + programs.custom.q.userHighlight = map ({ user, ... }: user) + (builtins.attrValues config.programs.custom.browser.configList); + }