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;
|
default = true;
|
||||||
type = with types; bool;
|
type = with types; bool;
|
||||||
};
|
};
|
||||||
|
userHighlight = mkOption {
|
||||||
|
default = [ config.users.users.mainUser.name ];
|
||||||
|
type = with types; listOf str;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -31,6 +35,7 @@ in {
|
||||||
timeZones = cfg.timeZones;
|
timeZones = cfg.timeZones;
|
||||||
enableIntelBacklight = cfg.enableIntelBacklight;
|
enableIntelBacklight = cfg.enableIntelBacklight;
|
||||||
enableBattery = cfg.enableBattery;
|
enableBattery = cfg.enableBattery;
|
||||||
|
userHighlight = cfg.userHighlight;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# tzselect is your frind do find timezones
|
# tzselect is your frind do find timezones
|
||||||
, timeZones ? [ ], timeColor ? 9, timeZoneColor ? 10, calBackgroundColor ? 10
|
, timeZones ? [ ], timeColor ? 9, timeZoneColor ? 10, calBackgroundColor ? 10
|
||||||
, calWeekColor ? 13, calDayColor ? 9, enableIntelBacklight ? true
|
, calWeekColor ? 13, calDayColor ? 9, enableIntelBacklight ? true
|
||||||
, enableBattery ? true, ... }:
|
, userHighlight ? [ "palo" ], enableBattery ? true, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -296,11 +296,13 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
q-show-users = ''
|
q-show-users = ''
|
||||||
${pkgs.procps}/bin/ps aux \
|
${pkgs.procps}/bin/ps -eo user \
|
||||||
| ${pkgs.gawk}/bin/awk '{ print $1 }' \
|
|
||||||
| ${pkgs.gnused}/bin/sed '1 d' \
|
| ${pkgs.gnused}/bin/sed '1 d' \
|
||||||
| ${pkgs.coreutils}/bin/sort \
|
| ${pkgs.coreutils}/bin/sort \
|
||||||
| ${pkgs.coreutils}/bin/uniq \
|
| ${pkgs.coreutils}/bin/uniq \
|
||||||
|
| ${pkgs.gnugrep}/bin/egrep --color=always '(${
|
||||||
|
lib.concatStringsSep "|" userHighlight
|
||||||
|
})|$' \
|
||||||
| ${pkgs.utillinux}/bin/column
|
| ${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