Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Pause and continue proccesses ( to game / record )
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Devport
Guru
Guru


Joined: 15 Dec 2004
Posts: 361

PostPosted: Sat Apr 15, 2006 8:35 pm    Post subject: Pause and continue proccesses ( to game / record ) Reply with quote

I have written a little script to stop and continue a list of apps. Why ? I don't want applications to abuse my cpu / internet connection while playing games, recording tv and so on. Here it is :

Code:
#!/bin/sh

applist=(
   evolution-alarm-notify
   evolution-data-server-1.6
   liferea
   liferea-bin
   mail-notification
   python
)

stop()
{
   PID="`pidof $1`"

   if [[ -n "$PID" ]]
   then
      kill -stop $PID
      echo "Stopped $1 with PID $PID"
   fi
}

cont()
{
   PID="`pidof $1`"

   if [[ -n "$PID" ]]
   then
      kill -cont $PID
      echo "Continued $1 with PID $PID"
   fi
}

if [[ "$1" = "-c" ]]
then
   for app in ${applist[@]}
   do
      cont $app
   done
else
   for app in ${applist[@]}
   do
      stop $app
   done
fi


As you can see there is a list of apps that should be paused / continued. Call it with "mygame" ( thats what I called it for now ) to stop the apps and with "mygame -c" to continue those apps.

If there is interest I can extend it to be more generiy and to use a configuration file for the list of apps.
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sat Apr 15, 2006 10:35 pm    Post subject: ok Reply with quote

that will do a good job locking them away from cpu/hd/video/net but it won't free up their resources entirely, which is probably what you want.

Try looking on th forum, i remember stuff better for this exact thing.

Also save on significant memory footprint and cpu time of wm like KDE or Gnome.

And background apps too

its a good idea!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum