| 1 |
#!/bin/sh |
| 2 |
# fvwm-crystal.infoline |
| 3 |
# Script used to display various information about system |
| 4 |
# in FVWM-Crystal desktop |
| 5 |
# --------------------------------------------------------------------------- |
| 6 |
# Author: Maciej Delmanowski <[email protected]> |
| 7 |
# License: GPLv3+ |
| 8 |
# --------------------------------------------------------------------------- |
| 9 |
|
| 10 |
# Here are some sample commands you can combine |
| 11 |
# We can use only 1 line with limited length |
| 12 |
|
| 13 |
# Uptime |
| 14 |
uptime=`uptime | sed -e 's/.*up\ //g' -e 's/,.*//g'` |
| 15 |
|
| 16 |
# Hostname |
| 17 |
hostname=`hostname` |
| 18 |
|
| 19 |
# Kernel info |
| 20 |
kernel=`uname -sr` |
| 21 |
|
| 22 |
# Free memory (MB) |
| 23 |
memory_free=`free -m | grep "Mem\:" | awk '{print $4}'` |
| 24 |
|
| 25 |
# Free swap (MB) |
| 26 |
swap_free=`free -m | grep "Swap\:" | awk '{print $4}'` |
| 27 |
|
| 28 |
# --------------------------------------------------------------------------- |
| 29 |
# What will be displayed in FVWM-Crystal? |
| 30 |
# Format: "SetEnv FVWM_INFOLINE \"[displayed text]\"" |
| 31 |
|
| 32 |
echo "SetEnv FVWM_INFOLINE \"$hostname | $kernel | Free RAM $memory_free MB, swap $swap_free MB | Uptime: $uptime\"" |
| 33 |
|
| 34 |
|