You are not logged in.

#1 2011-01-14 22:28:46

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

[SOLVED]Kill tint2 before suspend, bring it back after resume...

NetworkManager Applet does this annoying thing with tint2 that when I suspend and resume, the systray grows with empty space. I need to do a proper bug report, but first I want to just kill tint2 on suspend and launch it again on resume, so I created /etc/pm/sleep.d/99tint2

#!/bin/bash
case $1 in
   hibernate)
       killall tint2
       ;;
   suspend)
       killall tint2
       ;;
   thaw)
       su rob -c tint2
       ;;
   resume)
       su rob -c tint2
       ;;
   *)
       ;;
esac

Then I chmod +x it and it almost works.

It kills tint2 when I suspend, but it doesn't bring it back on resume.

Last edited by pogeymanz (2011-01-15 00:42:13)

Offline

#2 2011-01-14 23:12:42

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: [SOLVED]Kill tint2 before suspend, bring it back after resume...

pogeymanz wrote:

It kills tint2 when I suspend, but it doesn't bring it back on resume.

Try using 'su rob -c "env DISPLAY=:0 tint2" ' instead

Offline

#3 2011-01-15 00:42:00

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: [SOLVED]Kill tint2 before suspend, bring it back after resume...

Excellent!

Why is it that I need to set the Display variable?

Offline

#4 2011-01-15 01:23:49

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: [SOLVED]Kill tint2 before suspend, bring it back after resume...

Because its not being run from inside X. Try running a gui app from a tty and it'll need the same thing.

Offline

#5 2011-07-31 12:32:51

kwevej
Member
Registered: 2011-06-23
Posts: 12

Re: [SOLVED]Kill tint2 before suspend, bring it back after resume...

I had the same problem.
Based on your script and the issue thread ( http://code.google.com/p/tint2/issues/detail?id=343 ) I did this:

#!/bin/bash
case $1 in
   hibernate|suspend)
       ;;
   thaw|resume)
       sleep 3 && killall -SIGUSR1 tint2
       ;;
   *)
       ;;
esac

Offline

Board footer

Powered by FluxBB