mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 23:12:32 +01:00
added pkg modules
This commit is contained in:
parent
43a3f5e5dd
commit
eabba09507
@ -34,6 +34,11 @@
|
||||
},
|
||||
"tooltip": false
|
||||
},
|
||||
"custom/pkg": {
|
||||
"format": "{}",
|
||||
"interval": 3600,
|
||||
"exec": "~/.config/waybar/modules/pkg.sh",
|
||||
},
|
||||
"network": {
|
||||
"format-wifi": "<span foreground='#929292'></span> {essid} <span foreground='#929292'>{signalStrength}%</span>",
|
||||
"format-ethernet": "<span foreground='#929292'></span> {ifname}",
|
||||
@ -55,12 +60,6 @@
|
||||
"interval": 5,
|
||||
"exec" : "pgrep openvpn"
|
||||
},
|
||||
"custom/nixos-pkg": {
|
||||
"format": "<span foreground='#ff5c57'></span> {}",
|
||||
"return-type": "string",
|
||||
"interval": 1,
|
||||
"exec" : "~/.config/waybar/modules/nixos-kernel.sh"
|
||||
},
|
||||
"backlight": {
|
||||
"format": "{icon} {percent}%",
|
||||
"format-icons": [""],
|
||||
|
@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
booted=$(readlink /run/booted-system/kernel)
|
||||
installed=$(readlink /run/current-system/kernel)
|
||||
|
||||
if [[ $booter != $installed ]]
|
||||
then
|
||||
echo "reboot"
|
||||
fi
|
16
roles/waybar/files/waybar/modules/pkg.sh
Executable file
16
roles/waybar/files/waybar/modules/pkg.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
pac=$(checkupdates 2>/dev/null | wc -l)
|
||||
aur=$(trizen -Qua 2>/dev/null | wc -l)
|
||||
|
||||
if [[ $pac -eq "0" ]] && [[ $aur -eq "0" ]] || [[ ! $pac =~ [0-9]+ ]] || [[ ! $aur =~ [0-9]+ ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $(checkupdates | grep '^linux\ ') ]]
|
||||
then
|
||||
echo "$pac <span foreground='#ff5c57'></span> $aur"
|
||||
else
|
||||
#echo "$pac %{F#5b5b5b}%{F-} $aur"
|
||||
echo "$pac <span foreground='#5b5b5b'></span> $aur"
|
||||
fi
|
@ -54,7 +54,7 @@ window {
|
||||
color: @alert;
|
||||
}
|
||||
|
||||
#mode, #battery, #cpu, #memory, #network, #pulseaudio, #backlight, #custom-storage, #custom-spotify, #custom-weather, #custom-vpn, #custom-nixos-kernel, #temperature {
|
||||
#mode, #battery, #cpu, #memory, #network, #pulseaudio, #backlight, #custom-pkg, #custom-storage, #custom-spotify, #custom-weather, #custom-vpn, #temperature {
|
||||
margin: 0px 6px 0px 10px;
|
||||
}
|
||||
|
||||
@ -79,6 +79,10 @@ window {
|
||||
border-bottom: 2px solid @yellow;
|
||||
}
|
||||
|
||||
#custom-pkg {
|
||||
border-bottom: 2px solid @red;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
/*border-bottom: 2px solid @green;*/
|
||||
}
|
||||
@ -91,10 +95,6 @@ window {
|
||||
border-bottom: 2px solid @cyan;
|
||||
}
|
||||
|
||||
#custom-nixos-kernel {
|
||||
border-bottom: 2px solid @alert;
|
||||
}
|
||||
|
||||
#battery.warning {
|
||||
color: rgba(255, 210, 4, 1);
|
||||
}
|
||||
@ -107,10 +107,10 @@ window {
|
||||
color: rgba(217, 216, 216, 1);
|
||||
}
|
||||
|
||||
#custom-zfs.warning {
|
||||
#custom-storage.warning {
|
||||
color: @warning;
|
||||
}
|
||||
|
||||
#custom-zfs.critical {
|
||||
#custom-storage.critical {
|
||||
color: @alert;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user