Re: [qubes-users] Help finetuning i3status in Qubes dom0 [solved]

17 views
Skip to first unread message

One7two99

unread,
Oct 3, 2017, 5:59:16 PM10/3/17
to Ilpo Järvinen, qubes-users
Hello Ilpo,

amazing, thank you for the quick tip!
I was able to get exactly what I was looking for (see attached screenshot)

I can now get my summarized RAM usage via:
[USER@dom0 ~] xl list | awk '{print $3}' | tail -n +2 | paste -s -d+ - | bc
15022

as such I have edited my /usr/bin/qubes-i3status to add the RAM usage to my status bar near the "running qubes section"

status_qubes() {
    # Output in Status bar, ex: 6 Qubes using 15.050 MB RAM
    local sum_ram="("$(xl list | awk '{print $3}' | tail -n +2 | paste -s -d+ -)")/1000"
    local sum_ram=$(bc <<< "scale=3;$sum_ram")"MB"
    local qubes=$(qvm-ls 2>/dev/null | grep ' \* ' | wc -l)
    json qubes "$qubes Qubes using $sum_ram RAM"
}

or if you want to have the output as with "15.0G" instead of "15.050MB":


status_qubes() {
    # Output in Status bar, ex: 6 Qubes using 15.0G RAM
    local sum_ram="("$(xl list | awk '{print $3}' | tail -n +2 | paste -s -d+ -)")/1000"
    local sum_ram=$(bc <<< "scale=1;$sum_ram")"G"
    local qubes=$(qvm-ls 2>/dev/null | grep ' \* ' | wc -l)
    json qubes "$qubes Qubes using $sum_ram RAM"
}

Maybe someone more skilled can write a subroutine in qubes-i3status so that it can be enabled or disabled by the user like with all other party in the main() area.

[799]


Screenshot_2017-10-03_23-56-54.png
Reply all
Reply to author
Forward
0 new messages