#!/bin/bash

# WAIT FOR gnome-panel TO START
pgrep -lx gnome-panel >> /dev/null
while [ "$?" = "1" ]; do
	sleep 1;
	pgrep -lx gnome-panel >> /dev/null
done;

# GIVE TIME TO TRAY TO APPEAR
sleep 5

# KILL ANY PREVIOUS INSTANCE OF g-p-m
pkill gnome-power-manager

# RUN g-p-m
/usr/bin/gnome-power-manager
