| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
GSETTINGS=$(whereis -b gsettings | awk '{print $2}') |
| 4 |
SED=$(whereis -b sed | awk '{print $2}') |
| 5 |
|
| 6 |
if [ -z "$GSETTINGS" ]; then |
| 7 |
echo "Command 'gsettings' not found!" |
| 8 |
exit 1 |
| 9 |
fi |
| 10 |
|
| 11 |
RESOULT=$("$GSETTINGS" get com.canonical.Unity.Panel systray-whitelist || echo "") |
| 12 |
|
| 13 |
if [ -n "$RESOULT" ]; then |
| 14 |
HIME=$(echo "$RESOULT" | grep hime) |
| 15 |
if [ -z "$HIME" ]; then |
| 16 |
NEW_SCHEMA=$("$GSETTINGS" get com.canonical.Unity.Panel systray-whitelist | "$SED" -e "s/]$/, \'hime\']/") |
| 17 |
"$GSETTINGS" set com.canonical.Unity.Panel systray-whitelist "$NEW_SCHEMA" |
| 18 |
else |
| 19 |
echo "'hime' is already in the systray-whitelist of Unity Panel. exiting..." |
| 20 |
fi |
| 21 |
fi |