temporary (TM) solution to display the number of pending update
This commit is contained in:
parent
f3d28f90eb
commit
8a7f336032
3 changed files with 31 additions and 1 deletions
29
.config/i3/bar.sh
Executable file
29
.config/i3/bar.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
/usr/local/bin/i3status | while :
|
||||
do
|
||||
read line
|
||||
if echo "${line}" | grep -Pq '^\{"version":\d\}$' ; then
|
||||
echo $line
|
||||
elif echo "${line}" | grep -Pq '^\[$' ; then
|
||||
echo $line
|
||||
else
|
||||
echo -n "["
|
||||
line=`echo "${line}" | sed 's/^,\{0,1\}\[//' | sed 's/\]$//'`
|
||||
NB_UPDATES=`/sbin/checkupdates | /sbin/wc -l`
|
||||
NB_UPDATES_COLOR="#40AA40"
|
||||
if [ $NB_UPDATES -ge 10 ] ; then
|
||||
NB_UPDATES_COLOR="#FF8C00"
|
||||
elif [ $NB_UPDATES -ge 25 ] ; then
|
||||
NB_UPDATES_COLOR="#FF0000"
|
||||
fi
|
||||
echo -n "{"
|
||||
echo -n "\"name\":\"updates\","
|
||||
echo -n "\"full_text\":\"pending updates: ${NB_UPDATES} \","
|
||||
echo -n "\"color\":\"${NB_UPDATES_COLOR}\","
|
||||
echo -n "\"markup\":\"pango\""
|
||||
echo -n "},"
|
||||
echo "$line]" || exit 1
|
||||
echo -n ","
|
||||
fi
|
||||
done
|
|
@ -203,7 +203,7 @@ bindsym $mod+r mode "resize"
|
|||
# finds out, if available)
|
||||
bar {
|
||||
tray_output primary
|
||||
status_command /usr/local/bin/i3status
|
||||
status_command "sh ~/.config/i3/bar.sh"
|
||||
position top
|
||||
separator_symbol " | "
|
||||
colors {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# If the above line is not correctly displayed, fix your editor first!
|
||||
|
||||
general {
|
||||
output_format = "i3bar"
|
||||
colors = true
|
||||
interval = 5
|
||||
color_good = "#40AA40"
|
||||
|
|
Loading…
Reference in a new issue