mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-24 21:21:53 -05:00
waybar: don't assume coreutils in box
This commit is contained in:
parent
e5d6aa6bda
commit
f2fd8cbd0f
|
@ -89,8 +89,8 @@
|
||||||
CRIT=''${1:-10}
|
CRIT=''${1:-10}
|
||||||
NOTIFY=${lib.getExe' pkgs.libnotify "notify-send"}
|
NOTIFY=${lib.getExe' pkgs.libnotify "notify-send"}
|
||||||
|
|
||||||
stat=$(cat $bat/status)
|
stat=$(${lib.getExe pkgs.coreutils "cat"} $bat/status)
|
||||||
perc=$(cat $bat/capacity)
|
perc=$(${lib.getExe pkgs.coreutils "cat"} $bat/capacity)
|
||||||
|
|
||||||
if [[ $perc -le $CRIT ]] && [[ $stat == "Discharging" ]]; then
|
if [[ $perc -le $CRIT ]] && [[ $stat == "Discharging" ]]; then
|
||||||
$NOTIFY --urgency=critical --icon=dialog-error "Battery Critical" "Current charge: $perc%".
|
$NOTIFY --urgency=critical --icon=dialog-error "Battery Critical" "Current charge: $perc%".
|
||||||
|
@ -178,10 +178,10 @@
|
||||||
mako-dnd = pkgs.writeShellScript "mako-dnd" ''
|
mako-dnd = pkgs.writeShellScript "mako-dnd" ''
|
||||||
show() {
|
show() {
|
||||||
MAKO_MODE=$(${lib.getExe' pkgs.mako "makoctl"} mode)
|
MAKO_MODE=$(${lib.getExe' pkgs.mako "makoctl"} mode)
|
||||||
if echo "$MAKO_MODE" | grep -q "do-not-disturb"; then
|
if ${lib.getExe pkgs.coreutils "echo"} "$MAKO_MODE" | ${lib.getExe pkgs.gnugrep "grep"} -q "do-not-disturb"; then
|
||||||
printf '{"text": "", "class": "on", "tooltip": "Notifications snoozed."}\n'
|
${lib.getExe pkgs.coreutils "printf"} '{"text": "", "class": "on", "tooltip": "Notifications snoozed."}\n'
|
||||||
else
|
else
|
||||||
printf '{"text": "", "class": "off","tooltip": "Notifications enabled."}\n'
|
${lib.getExe pkgs.coreutils "printf"} '{"text": "", "class": "off","tooltip": "Notifications enabled."}\n'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue