mirror of https://github.com/polybar/polybar.git
Updated User contributed configs (markdown)
parent
72dd591ff7
commit
5505b1c10b
|
@ -1 +1,48 @@
|
|||
...
|
||||
# Archlinux updates
|
||||
|
||||
![pkg](http://ptpb.pw/IgGS.png)
|
||||
|
||||
## Dependencies
|
||||
|
||||
* [aur: cower](https://aur.archlinux.org/packages/cower/)
|
||||
* [aur: ttf-font-awesome](https://aur.archlinux.org/packages/ttf-font-awesome/)
|
||||
|
||||
## Setup
|
||||
* Create ``.config/polybar/pkg.sh`` script
|
||||
```
|
||||
cat << EOF > $HOME/.config/polybar/pkg.sh
|
||||
#!/bin/bash
|
||||
pac=$(checkupdates | wc -l)
|
||||
aur=$(cower -u | wc -l)
|
||||
|
||||
check=$((pac + aur))
|
||||
if [[ "$check" != "0" ]]
|
||||
then
|
||||
echo "$pac %{F#5b5b5b}%{F-} $aur"
|
||||
fi
|
||||
EOF
|
||||
chmod +x .config/polybar/pkg.sh
|
||||
```
|
||||
|
||||
|
||||
* Add awesome font in polybar
|
||||
```
|
||||
font-3 = FontAwesome:pixelsize=14;0
|
||||
```
|
||||
* Create pkg module
|
||||
```
|
||||
[module/pkg]
|
||||
type = custom/script
|
||||
interval = 1200
|
||||
format = <label>
|
||||
format-underline = #dc322f
|
||||
label = "%output:0:30%"
|
||||
exec = .config/polybar/pkg.sh
|
||||
exec-if = "ping -q -w 2 -c 1 176.34.135.167 > /dev/null"
|
||||
```
|
||||
|
||||
## How it works
|
||||
|
||||
1 check with duckduckgo.com if you're connected to internet
|
||||
2 check if there are updates
|
||||
3 if yes, it prints left side : pacman updates, right side : aur updates
|
Loading…
Reference in New Issue