Skip to content

Commit

Permalink
version 0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeouter committed Aug 13, 2017
1 parent ef67253 commit c023db3
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 79 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<h2>System monitor extension for Argos with real CPU graph</h2>

This extension created specially for [Argos](https://github.com/p-e-w/argos) and linux-powered computers w/ GNOME shell.
It is based on **free**, **top**, **df** and **vmstat** output and uses power of SVG to draw charts.
This script uses power of SVG to draw charts.

Please note that the CPU consumption is **very** approximate. It calculates only by first 6 processes of **top** output. See previous releases to
As you see at screenshot, CPU chart has 3 colors: green for iowait consumption, dark grey for user comsumption, and light gray for overall CPU consumption.

Please note that the CPU consumption is approximate. It calculates by **/proc/stat** output, also as memory by **free**, temperature by **/sys/class/thermal/thermal_zone0/temp** and disks by **df** outputs.

<h3>TODO</h3>

* beautify charts with power of SVG
* rewrite script in another lang
* adopt code from [native System Monitor extension for GNOME Shell](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet)
* find workaround for top issue
* add another improvements

<h3>Known bugs</h3>

Different configurations of **top** utility doesn't allow to show processes and it's CPU consumtion (see opened issue here).
To fix this, open script in text editor and replace `$9 / 2` to `$7 / 2`. Also you may need to change `head -n 10` to `head -n 13`. Also, you may need to change 2 to 4 - this is how many cores in your CPU.
Different configurations of **top** utility doesn't allow to show processes list (see opened issue here).
To fix this, open script in text editor and replace `$9 / 2` to `$7 / 2`. Also you may need to change `head -n 10` to `head -n 13`. Also, you may need to change number of CPU cores (2, 4).
In further releases I will fix this by more elegant way.

<h2>Screenshot</h2>

<img src="https://raw.githubusercontent.com/fadeouter/sysinfo/master/screenshot.png"> <img src="https://raw.githubusercontent.com/fadeouter/sysinfo/master/screenshot_w.png">
<img src="https://raw.githubusercontent.com/fadeouter/sysinfo/master/screenshot.png">

<h2>License</h2>
GNU GPL v3.0 - https://www.gnu.org/licenses/gpl-3.0.en.html
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshot_w.png
Binary file not shown.
259 changes: 187 additions & 72 deletions sysinfo.1s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,125 +3,214 @@
# this is simple and usable script from a newbie
# based on some findings on the internet
# based on Ganesh V BitBar script (https://github.com/ganeshv/mtop)
# and Leo-G script (https://github.com/Leo-G/DevopsWiki/wiki/How-Linux-CPU-Usage-Time-and-Percentage-is-calculated)
# author: fadeouter (https://github.com/fadeouter/)


scale="2" # if you have HIDPI screen
svg_font_size="9" # probably you won't change this
svg_font_family="Ubuntu" # set as theme font
#symbolic="-symbolic" # uncomment to use multicolour icons

# IMPORTANT! Go to line 114 and set your number of CPU cores

### LIGHT THEME
graphWidth="50" # CPU chart width in pixels, also a number of chart points
scale="1" # if you have HIDPI screen, set appropriate coeff. for scaling
svg_font_size="9" # probably you won't change this
svg_font_family="Ubuntu" # set as GNOME Shell theme font
symbolic=""
#symbolic="-symbolic" # uncomment to use monocolor icons

chart_color="rgba(0,0,0,0.7)" # CPU chart main color
pie_fg_color="rgba(0,0,0,0.5)" # pie foreground color
pie_bg_color="rgba(125,125,125,0.2)" # pie background color
text_muted="#555555" # font color of partition mountpoint
diskbar_font="#333333" # font color of disk used space

### LIGHT THEME (swap with DARK THEME to enable)

chart_system_color="silver" # CPU chart main color
chart_user_color="dimgray" # CPU chart main color
chart_io_color="greenyellow" # CPU chart main color

pie_fg_color=$chart_user_color # pie foreground color
pie_bg_color=$chart_system_color # pie background color
text_muted=$chart_user_color # font color of partition mountpoint
diskbar_font="#333333" # font color of disk used space
diskbar_font_highlighted="green" # font color of disk free space
diskbar_bg_color=$pie_bg_color # disk bar bg color


### DARK THEME

chart_color="rgba(255,255,255,0.8)" # CPU chart main color
pie_fg_color="rgba(255,255,255,0.8)" # pie foreground color
pie_bg_color="rgba(0,0,0,0.3)" # pie background color
text_muted="#ccc" # font color of partition mountpoint
diskbar_font="white" # font color of disk used space
diskbar_font_highlighted="#7eff35" # font color of disk free space
diskbar_bg_color=$pie_fg_color # disk bar bg color
### DARK THEME

chart_system_color="silver" # CPU chart main color
chart_user_color="dimgray" # CPU chart main color
chart_io_color="greenyellow" # CPU chart main color

pie_fg_color=$chart_user_color # pie foreground color
pie_bg_color=$chart_system_color # pie background color
text_muted=$chart_user_color # font color of partition mountpoint
diskbar_font="#ffffff" # font color of disk used space
diskbar_font_highlighted="#7eff35" # font color of disk free space
diskbar_bg_color=$pie_bg_color # disk bar bg color

### SIZES OF SVG OBJECTS

### SIZES AND POSITION OF SVG OBJECTS

icon_h=$(expr 12 \* $scale)
graph_h=$(expr 16 \* $scale)
graph_w=$(expr 32 \* $scale)
graph_h=$(expr 14 \* $scale)
graph_svg_w=$(expr $graphWidth + 14)
mem_bar_pos=$(expr $graphWidth + 5)
diskbar_h=$(expr 18 \* $scale)
diskbar_w=$(expr 120 \* $scale)
px='px'


################################################################
#
# CPU
# 0. Settings
#
################################################################

### SET XXX to number of CPU cores '{ printf("%-4s %-s\n", $9 / XXX, $NF); }'

top=$(top -o "%CPU" -bn 1 | tr -d '[]|' | sed 's\`-\ \g' | sed 's\+\…\g' | head -n 14 | tail -n 6 | awk '{ printf("%-4s %-s\n", $9 / 4, $NF); }' | awk 1 ORS="\\\n")
CPU=$(echo $top | sed 's/\\n/ /g' | awk '{ print $1 + $3 + $5 + $7 + $9 + $12}' | awk '{ printf("%.0f\n", $1"%"); }')

########### cpu graph ################
SETTINGS="${HOME}/.argos-sysinfo.settings"

HISTORY_FILE="${HOME}/.cpu.history"
touch "${HISTORY_FILE}"
PREVIOUS=$(tail -20 "${HISTORY_FILE}")
echo "$PREVIOUS" > "${HISTORY_FILE}"
echo "$CPU" >> "${HISTORY_FILE}"

CPU_GRAPH=$(cat $HISTORY_FILE | tr "\n" "\t" | awk '{print(100-$1,"L 5,"100-$2,"10,"100-$3,"15,"100-$4,"20,"100-$5,"25,"100-$6,"30,"100-$7,"35,"100-$8,"40,"100-$9,"45,"100-$10,"50,"100-$11,"55,"100-$12,"60,"100-$13,"65,"100-$14,"70,"100-$15,"75,"100-$16,"80,"100-$17,"85,"100-$18,"90,"100-$19,"95,"100-$20)}')
if [ ! -f "${SETTINGS}" ]; then
touch "${SETTINGS}"
echo "%on" > "${SETTINGS}"
echo "memon" >> "${SETTINGS}"
fi

cpu_icon=$(echo "<svg xmlns='http://www.w3.org/2000/svg' width='56px' height='56px' viewBox='0 0 100 100'> <g transform='translate(0,0)'> <path style='fill:$chart_color;fill-opacity:1;fill-rule:evenodd;' d='M 0,100 V $CPU_GRAPH l 0,100' /> </g></svg>" | base64 -w 0) # fill style
showPercents=$(grep -E "(%on|%off)" ${SETTINGS})
showMembar=$(grep -E "(memon|memoff)" ${SETTINGS})

########### cpu graph end ############

echo "| image=$cpu_icon imageHeight=$graph_h imageWidth=$graph_w"
echo "---"
echo "<b>$CPU%</b> CPU | image=$cpu_icon imageHeight=$icon_h font=monospace size=10"
echo "$top| font=monospace size=9 iconName=utilities-system-monitor$symbolic bash=gnome-system-monitor terminal=false"
echo "---"
if [ "$showMembar" == "memoff" ]; then
graph_svg_w=$graphWidth
fi


################################################################
#
# Mem
# 01. Memory
#
################################################################

raw_mem=$(free -m | grep Mem)
raw_swap=$(free -m | grep Swap)
mem_used=$(echo $raw_mem | awk '{print $2 - $7}')
mem_D=$(echo $raw_mem | awk '{print (($2 - $7) / $2) * 10}' | awk '{ printf("%.0f\n", $1); }' | awk '{print $0"0"}')
mem_full=$(echo $raw_mem | awk '{print $2}')
memPercent=$(echo $raw_mem | awk '{print ($3 / $2) * 100 }')
memPercentPie=$(echo $raw_mem | awk '{print 174 + (($3 / $2) * 174) }')

raw_swap=$(free -m | grep Swap)
swap_used=$(echo $raw_swap | awk '{print $3}')
swap_full=$(echo $raw_swap | awk '{print $2}')
swap_D=$(echo $raw_swap | awk '{print ($3 / $2) * 10 }' | awk '{ printf("%.0f\n", $1); }' | awk '{print $0"0"}')
swapPercent=$(echo $raw_swap | awk '{print ($3 / $2) * 100 }')
swapPercentPie=$(echo $raw_swap | awk '{print 174 + (($3 / $2) * 174) }')

mempie=$(echo "<svg xmlns='http://www.w3.org/2000/svg' width='$icon_h' height='$icon_h' viewBox='0 0 94.997788 94.997783' transform='translate($icon_h,0) scale(-1,1)'><circle cx='47.5' cy='47.5' r='47.5' fill='$pie_bg_color' /><circle cx='47.5' cy='47.5' r='9' fill='$pie_fg_color' /><path d='M47.499 19.844c15.273 0 27.655 12.381 27.655 27.655 0 15.273-12.382 27.655-27.655 27.655-15.274 0-27.655-12.382-27.655-27.655 0-15.273 12.381-27.655 27.655-27.655' fill='none' stroke='$pie_fg_color' stroke-width='39.688' stroke-dasharray='174' stroke-dashoffset='$memPercentPie' /></svg>" | base64 -w 0)

swappie=$(echo "<svg xmlns='http://www.w3.org/2000/svg' width='$icon_h' height='$icon_h' viewBox='0 0 94.997788 94.997783' transform='translate($icon_h,0) scale(-1,1)'><circle cx='47.5' cy='47.5' r='47.5' fill='$pie_bg_color' /><circle cx='47.5' cy='47.5' r='9' fill='$pie_fg_color' /><path d='M47.499 19.844c15.273 0 27.655 12.381 27.655 27.655 0 15.273-12.382 27.655-27.655 27.655-15.274 0-27.655-12.382-27.655-27.655 0-15.273 12.381-27.655 27.655-27.655' fill='none' stroke='$pie_fg_color' stroke-width='39.688' stroke-dasharray='174' stroke-dashoffset='$swapPercentPie' /></svg>" | base64 -w 0)



################################################################
#
# 02. CPU graph calculation
#
################################################################

# XXX must be equal to number of CPU cores: '...{ printf("%-4s %-s\n", $9 / XXX, $NF); }...'
top=$(top -o "%CPU" -bn 1 | head -n 14 | tail -n 7 | awk '{ printf("%-4s %-s\n", $9 / 4, $NF); }' | awk 1 ORS="\\\n")

HISTORY_FILE="${HOME}/.argos-sysinfo.cpu"
touch "${HISTORY_FILE}"
PREVIOUS=$(tail -$graphWidth "${HISTORY_FILE}")
PREV=$(tail -n 1 "${HISTORY_FILE}")
echo "$PREVIOUS" > "${HISTORY_FILE}"

if [$PREV == '']; then
PREV="0 0 0 0"
fi

PREV_TOTAL=$(echo $PREV | awk '{print $1}' )
PREV_IDLE=$(echo $PREV | awk '{print $2}' )
PREV_USER=$(echo $PREV | awk '{print $3}' )
PREV_IO=$(echo $PREV | awk '{print $4}' )

STAT=(`sed -n 's/^cpu\s//p' /proc/stat`)
IDLE=${STAT[3]}

TOTAL=0
for VALUE in "${STAT[@]}"; do
let "TOTAL=$TOTAL+$VALUE"
done

let "USER=$TOTAL-${STAT[0]}"
let "IO=$TOTAL-${STAT[4]}"
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
let "DIFF_USER=$USER-$PREV_USER"
let "DIFF_IO=$IO-$PREV_IO"
let "CPU=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
let "CPU_USER=CPU-((1000*($DIFF_USER-$DIFF_IDLE)/$DIFF_USER+5)/10)"
let "CPU_IO=CPU-((1000*($DIFF_IO-$DIFF_IDLE)/$DIFF_IO+5)/10)"


echo "$TOTAL $IDLE $USER $IO $CPU $CPU_USER $CPU_IO" >> "${HISTORY_FILE}"


COUNTER=0
while [ $COUNTER -lt $graphWidth ]; do
fullCpuBar=$(sed -n $COUNTER\p ${HISTORY_FILE} | awk '{print $5}')
ioCpuBar=$(sed -n $COUNTER\p ${HISTORY_FILE} | awk '{print ($5-$7)}')
userCpuBar=$(sed -n $COUNTER\p ${HISTORY_FILE} | awk '{print $6}')
old_string=$svg_string
new_string="<path fill='none' stroke='$chart_system_color' stroke-width='1' d='M$COUNTER,0 $COUNTER,$fullCpuBar'/><path fill='none' stroke='$chart_io_color' stroke-width='1' d='M$COUNTER,$ioCpuBar $COUNTER,$fullCpuBar'/><path fill='none' stroke='$chart_user_color' stroke-width='1' d='M$COUNTER,0 $COUNTER,$userCpuBar'/>"
svg_string=$old_string$new_string
let COUNTER=COUNTER+1
done

cpu_icon=$(echo "<svg xmlns='http://www.w3.org/2000/svg' width='$graph_svg_w' height='100' viewBox='0 0 $graph_svg_w 100'> <g transform='translate(0,100) scale(1,-1)'>
$svg_string
<g transform='translate($mem_bar_pos,0)'><path fill='none' stroke='$chart_system_color' stroke-width='4' d='M0,0 0,$memPercent'/>
<path fill='none' stroke='$chart_system_color' stroke-width='4' d='M7,0 7,$swapPercent'/>
</g></g></svg>" | base64 -w 0)



pie_start="<svg width='$hw' height='$hw' viewBox='0 0 90.146759 90.144005'><g transform='translate(-59.928 -103.428)'><circle cx='105' cy='148.5' r='45.979' fill='$pie_bg_color'/>"
pie_00="</g></svg>"
pie_10="<path d='M105 103.52a44.98 44.98 0 0 1 26.438 8.592L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_20="<path d='M105 103.52a44.98 44.98 0 0 1 42.777 31.08L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_30="<path d='M105 103.52a44.98 44.98 0 0 1 36.388 18.542 44.98 44.98 0 0 1 6.39 40.337L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_40="<path d='M105 103.52a44.98 44.98 0 0 1 44.98 44.98A44.98 44.98 0 0 1 105 193.48V148.5z' fill='$pie_fg_color' /></g></svg>"
pie_50="<path d='M105 103.52a44.98 44.98 0 0 1 44.98 44.98A44.98 44.98 0 0 1 105 193.48V148.5z' fill='$pie_fg_color' /></g></svg>"
pie_60="<path d='M105 103.52a44.98 44.98 0 0 1 42.777 31.08 44.98 44.98 0 0 1-16.34 50.288 44.98 44.98 0 0 1-52.875 0L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_70="<path d='M105 103.52a44.98 44.98 0 0 1 44.732 40.278 44.98 44.98 0 0 1-35.38 48.698 44.98 44.98 0 0 1-52.13-30.097L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_80="<path d='M105 103.52a44.98 44.98 0 0 1 42.777 31.08 44.98 44.98 0 0 1-16.34 50.288 44.98 44.98 0 0 1-52.875 0 44.98 44.98 0 0 1-16.34-50.287L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_90="<path d='M105 103.52a44.98 44.98 0 0 1 44.425 37.944 44.98 44.98 0 0 1-30.526 49.813 44.98 44.98 0 0 1-53.976-22.357 44.98 44.98 0 0 1 13.638-56.808L105 148.5z' fill='$pie_fg_color' /></g></svg>"
pie_100="<circle cx='105' cy='148.5' r='44.979' fill='$pie_fg_color' /></g></svg>"
################################################################
#
# 03. Temperature
#
################################################################

pie_sw="pie_$swap_D"
pie_sw=$(echo "${!pie_sw}")
pie_sw=$(echo "$pie_start$pie_sw" | base64 -w 0)
temp=$(cat /sys/class/thermal/thermal_zone0/temp | awk '{print $1/1000 }')

pie_mem="pie_$mem_D"
pie_mem=$(echo "${!pie_mem}")
pie_mem=$(echo "$pie_start$pie_mem" | base64 -w 0)

echo "Mem: ${mem_used%%.*} / ${mem_full%%.*} MiB | image=$pie_mem"
echo "Swap: ${swap_used%%.*} / ${swap_full%%.*} MiB | image=$pie_sw"

################################################################
#
# 04. Output
#
################################################################

IMAGE_CPU="$CPU%"

if [ "$showPercents" == "%off" ]; then
IMAGE_CPU=''
fi


echo "$IMAGE_CPU| image=$cpu_icon imageHeight=$graph_h imageWidth=$graph_svg_w"

echo "---"

echo "<span color='$text_muted'>CPU </span>\t$CPU% | iconName=utilities-system-monitor"
echo "<span color='$text_muted'>Mem</span>\t${mem_used%%.*} / ${mem_full%%.*} MiB | image=$mempie imageHeight=$icon_h"
echo "<span color='$text_muted'>Swap</span>\t${swap_used%%.*} / ${swap_full%%.*} MiB | image=$swappie imageHeight=$icon_h"
echo "<span color='$text_muted'>Temp</span>\t$temp C° | imageHeight=$icon_h image=PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxMzUuNDY2NjcgMTM1LjQ2NjY3JyBoZWlnaHQ9JzY0JyB3aWR0aD0nNjQnPjxkZWZzPjxtYXJrZXIgb3JpZW50PSdhdXRvJyBpZD0nYicgb3ZlcmZsb3c9J3Zpc2libGUnPjxwYXRoIGQ9J00uOTggMGExIDEgMCAxIDEtMiAwIDEgMSAwIDAgMSAyIDB6JyBmaWxsPScjZjU1JyBmaWxsLXJ1bGU9J2V2ZW5vZGQnIHN0cm9rZT0nI2Y1NScgc3Ryb2tlLXdpZHRoPScuMjY3Jy8+PC9tYXJrZXI+PG1hcmtlciBvcmllbnQ9J2F1dG8nIGlkPSdhJyBvdmVyZmxvdz0ndmlzaWJsZSc+PHBhdGggZD0nTS45OCAwYTEgMSAwIDEgMS0yIDAgMSAxIDAgMCAxIDIgMHonIGZpbGw9JyNjY2MnIGZpbGwtcnVsZT0nZXZlbm9kZCcgc3Ryb2tlPScjY2NjJyBzdHJva2Utd2lkdGg9Jy4yNjcnLz48L21hcmtlcj48L2RlZnM+PGcgc3Ryb2tlLXdpZHRoPScxNC43NzknPjxwYXRoIGQ9J002Ni4zNzggMTEyLjU5NmMuMDEzLTMxLjcyNi4wMjctNS42My4wNC05NS4yMzUnIGZpbGw9JyNjY2MnIHN0cm9rZT0nI2NjYycgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBtYXJrZXItc3RhcnQ9J3VybCgjYSknIHRyYW5zZm9ybT0ndHJhbnNsYXRlKC0xLjE4MiAtNC42ODcpIHNjYWxlKDEuMDM4MjQpJy8+PHBhdGggZD0nTTY2LjM3OCAxMTIuNTk2Yy4wMi0xNi4zMzguMDQtMi45LjA2LTQ5LjA0MycgZmlsbD0nI2Y1NScgc3Ryb2tlPScjZjU1JyBtYXJrZXItc3RhcnQ9J3VybCgjYiknIHRyYW5zZm9ybT0ndHJhbnNsYXRlKC0xLjE4MiAtNC42ODcpIHNjYWxlKDEuMDM4MjQpJy8+PC9nPjwvc3ZnPgo=c@t"

echo "---"

echo "$top| font=monospace size=9 iconName=utilities-system-monitor$symbolic bash=gnome-system-monitor terminal=false"



################################################################
#
# Disk cap
# 05. Disk
#
################################################################

Expand All @@ -136,7 +225,7 @@ get_disk_stats() {
local IFS=$'\n'
local i dfdata

dfdata=($(df -H | grep "/dev/mapper*\|/dev/sd*" | grep -v "/boot\|/shm" ))
dfdata=($(df -lH | grep "/dev/mapper*\|/dev/sd*" | grep -v "/boot\|/shm" ))

IFS=$OLDIFS
for ((i = 0; i < ${#dfdata[@]}; i++)); do
Expand All @@ -159,18 +248,44 @@ for ((i = 0; i < ${#capacity[@]}; i++)); do
if [[ ${name[$i]} = \/media* ]]; then
disk_icon="drive-removable-media$symbolic"
fi
echo "---"
echo "${cap[$i]} <span color='$text_muted' font='10'>${name[$i]}</span> | iconName=$disk_icon imageHeight=$icon_h length=20 bash='nautilus ${name[$i]}' terminal=false"
#echo "${used[$i]} / <span color='green'>${free[$i]}</span> (${capacity[$i]} %)| refresh=false iconName=image-filter$symbolic"
diskbar_green=$(echo ${capacity[$i]} | awk '{print 255 - $0 * 2.55 }' | awk '{ printf("%.0f\n", $1); }')
diskbar_red=$(echo ${capacity[$i]} | awk '{print $0 * 2.55 }' | awk '{ printf("%.0f\n", $1); }')
diskbar_color="rgba($diskbar_red,$diskbar_green,0,0.7)"
diskbar=$(echo "<svg xmlns='http://www.w3.org/2000/svg' width='$diskbar_w$px' height='$diskbar_h$px' viewBox='0 0 100 11'> <rect width='100' height='2' x='0' y='$height' fill='$diskbar_bg_color' rx='1px'/> <rect width='${capacity[$i]}' height='2' x='0' y='$height' fill='$diskbar_color' rx='1px'/> <text x='0' y='7' font-size='$svg_font_size' font-family='$svg_font_family'><tspan fill='$diskbar_font'>${used[$i]} / <tspan fill='$diskbar_font_highlighted'>${free[$i]}</tspan> (${capacity[$i]} %)</tspan></text> </svg>" | base64 -w 0)
echo "|image=$diskbar iconName=baobab$symbolic imageHeight=$diskbar_h"
echo "---"
done


echo "Check free space | iconName=baobab$symbolic bash=baobab terminal=false"
echo "Open System Monitor | iconName=utilities-system-monitor$symbolic bash=gnome-system-monitor terminal=false"
print
################################################################
#
# 6. Settings rendering
#
################################################################


echo "---"
echo "Settings | iconName=gnome-settings$symbolic"

slon="PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyNCcgaGVpZ2h0PScyNCcgdmlld0JveD0nMCAwIDM3MCAzNzAnPjxwYXRoIGQ9J00yNzMgODhIOTdjLTUzLjUgMC05NyA0My42LTk3IDk3czQzLjUgOTcgOTcgOTdoMTc2YzUzLjUgMCA5Ny00My42IDk3LTk3cy00My41LTk3LTk3LTk3em0tMTE3LjYgOTdjMCAyOC44LTIzLjQgNTIuMi01Mi4yIDUyLjItMjguOCAwLTUyLjItMjMuNC01Mi4yLTUyLjIgMC0yOC44IDIzLjQtNTIuMiA1Mi4yLTUyLjIgMjguOCAwIDUyLjIgMjMuNCA1Mi4yIDUyLjJ6JyB0cmFuc2Zvcm09J3RyYW5zbGF0ZSgzNzAsIDApIHNjYWxlKC0xLCAxKScgZmlsbD0nZ3JlZW4nIC8+PC9zdmc+Cg=="
sloff="PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyNCcgaGVpZ2h0PScyNCcgdmlld0JveD0nMCAwIDM3MCAzNzAnPjxwYXRoIGQ9J00yNzMgODhIOTdjLTUzLjUgMC05NyA0My42LTk3IDk3czQzLjUgOTcgOTcgOTdoMTc2YzUzLjUgMCA5Ny00My42IDk3LTk3cy00My41LTk3LTk3LTk3em0tMTE3LjYgOTdjMCAyOC44LTIzLjQgNTIuMi01Mi4yIDUyLjItMjguOCAwLTUyLjItMjMuNC01Mi4yLTUyLjIgMC0yOC44IDIzLjQtNTIuMiA1Mi4yLTUyLjIgMjguOCAwIDUyLjIgMjMuNCA1Mi4yIDUyLjJ6JyBmaWxsPSdyZWQnIC8+PC9zdmc+Cg=="


if [ "$showPercents" == "%on" ]; then
echo "--Show CPU usage | refresh=true bash='sed -i -e s/%on/%off/g ${SETTINGS}' terminal=false image=$slon"
elif [ "$showPercents" == "%off" ]; then
echo "--Show CPU usage | refresh=true bash='sed -i -e s/%off/%on/g ${SETTINGS}' terminal=false image=$sloff"
fi


if [ "$showMembar" == "memon" ]; then
echo "--Show memory bars | refresh=true bash='sed -i -e s/memon/memoff/g ${SETTINGS}' terminal=false image=$slon"
elif [ "$showMembar" == "memoff" ]; then
echo "--Show memory bars | refresh=true bash='sed -i -e s/memoff/memon/g ${SETTINGS}' terminal=false image=$sloff"
fi




0 comments on commit c023db3

Please sign in to comment.