Quantcast
Channel: Pinguy OS Forum - All Forums
Viewing all articles
Browse latest Browse all 1646

Fix Docky & Network Issues After Suspend

$
0
0
If you are having issues with Docky opening more then once after suspend, and the network is disabled.

Follow this guide to fix it.

Code:
gedit ~/process_monitor.sh

Add this to the file:

Code:
#!/bin/bash

if [[ -z "$1" ]];then
echo "ERROR: must specify program"
exit 1
fi

while (( 0 == 0 ));do
$@ &
pid=`jobs -l | awk '{print $2}'`
wait $pid
done

Save the file.

Set the permission:

Code:
chmod a+x ~/process_monitor.sh

Move file to bin:

Code:
sudo mv process_monitor.sh /usr/local/bin/process_monitor

Open/Create /etc/pm/sleep.d/20_docky file:

Code:
sudo gedit /etc/pm/sleep.d/20_docky

And add/replace text with this:

Code:
#!/bin/sh
case $1 in
resume)
USER=`who | grep ":0" | head -1 | cut -d" " -f1`
USERHOME=/home/$USER
export XAUTHORITY="$USERHOME/.Xauthority"
export DISPLAY=":0"
su $USER - -c "service network-manager restart" &
su $USER - -c "process_monitor docky" &
exit 0;
;;
esac

Save the file and make it executable.

Code:
sudo chmod +x /etc/pm/sleep.d/20_docky
sudo chmod 755 /etc/pm/sleep.d/20_docky

Next Open/Create /etc/pm/power.d/20_docky file:

Code:
sudo gedit /etc/pm/power.d/20_docky

And add/replace text with this:

Code:
#!/bin/sh
USER=`who | grep ":0" | head -1 | cut -d" " -f1`
USERHOME=/home/$USER
export XAUTHORITY="$USERHOME/.Xauthority"
export DISPLAY=":0"
su $USER - -c "service network-manager restart" &
su $USER - -c "process_monitor docky" &
exit 0;

Save the file and make it executable.

Code:
sudo chmod +x /etc/pm/power.d/20_docky
sudo chmod 755 /etc/pm/power.d/20_docky

Thats it. Docky and the network will work fine after a suspend.

Viewing all articles
Browse latest Browse all 1646

Trending Articles