Commit bc4c7a5f authored by Dylan Araps's avatar Dylan Araps

Merge pull request #100 from dylanaraps/windows

Remove 'set $mem'
parents 2b9167e8 8eb25c60
...@@ -706,7 +706,7 @@ getde () { ...@@ -706,7 +706,7 @@ getde () {
getwm () { getwm () {
if [ -n "$DISPLAY" ] && [ "$os" != "Mac OS X" ]; then if [ -n "$DISPLAY" ] && [ "$os" != "Mac OS X" ]; then
id="$(xprop -root -notype | \awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" id="$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')"
wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)" wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)"
wm=${wm/*_NET_WM_NAME = } wm=${wm/*_NET_WM_NAME = }
wm=${wm/\"} wm=${wm/\"}
...@@ -1014,12 +1014,8 @@ getmemory () { ...@@ -1014,12 +1014,8 @@ getmemory () {
"Windows") "Windows")
mem="$(awk 'NR < 3 {printf $2 " "}' /proc/meminfo)" mem="$(awk 'NR < 3 {printf $2 " "}' /proc/meminfo)"
# Split the string above into 2 vars memtotal=${mem/ *}
# This is faster than using an array. memfree=${mem#* }
set $mem
memtotal=$1
memfree=$2
memavail=$((memtotal - memfree)) memavail=$((memtotal - memfree))
memused=$((memtotal - memavail)) memused=$((memtotal - memavail))
memory="$((${memused%% *} / 1024))MB / " memory="$((${memused%% *} / 1024))MB / "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment