TL;DR You need nice
for this:
sudo nice -n -20 <your_command>
Start minecraft with this command:
sudo nice -n -20 su -c java -jar minecraft.jar $USER
If you have a desktop file for minecraft then change the property Exec
and install the package gksu
, we need gksudo
:
sudo apt-get install gksu
Example (Replace <your_username>
with your username, the output of echo $USER
. $USER
doesn't works in a desktop file):
[Desktop Entry]
Type=Application
Name=Minecraft
GenericName=Game
Comment=Break and place blocks to build imaginative things
Exec=gksudo "nice -n -20 su -c 'java -jar /usr/share/minecraft/minecraft.jar' <your_username>"
Icon=minecraft
Categories=Game
StartupNotify=true
StartupWMClass=net-minecraft-bootstrap-Bootstrap
The Linux niceness scale goes from -20 to 19. The lower the number the
more priority that task gets. If the niceness value is high number
like 19 the task will be set to the lowest priority and the CPU will
process it whenever it gets a chance. The default nice value is zero.
Source
from man nice
:
-n, --adjustment=N
add integer N to the niceness (default 10)