home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94fb2cd
)
Show graphics card (NVIDIA) temp and mem usage
author
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 3 Jul 2018 21:26:46 +0000
(17:26 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 3 Jul 2018 21:26:46 +0000
(17:26 -0400)
bin/khatus_show
patch
|
blob
|
blame
|
history
diff --git
a/bin/khatus_show
b/bin/khatus_show
index
f008d19
..
c0a41a1
100755
(executable)
--- a/
bin/khatus_show
+++ b/
bin/khatus_show
@@
-355,11
+355,29
@@
mpd_current_file=$(
'
)
+graphics_card=$(
+ nvidia-smi \
+ --format=csv,noheader,nounits \
+ --query-gpu=memory.total,memory.used,temperature.gpu \
+ | awk -F ',' '
+ {
+ mem_total = $1;
+ mem_used = $2;
+ temp = $3;
+ mem_used_percent = (100 * mem_used) / mem_total;
+ printf("[%d%% %dC]", mem_used_percent, temp);
+ }
+ '
+)
+
echo \
"\
E$energy\
\
\
+ G=$graphics_card\
+ \
+ \
M$memory\
\
\
This page took
0.02235 seconds
and
4
git commands to generate.