q: highlight risky users
This commit is contained in:
parent
6bf95c6948
commit
702d85b329
3 changed files with 15 additions and 3 deletions
|
@ -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;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue