How do I lower the critical temperature?

You can try Computer Temp at Computer Temperature Monitor

Computer Temperature Monitor is a little applet for the GNOME desktop that shows the temperature of your computer CPU and disks on screen.

It also allows you to log temperatures to a file. You can set alarms to notify you when a tempertature is reached. Several monitors can be added to the panel to monitor different sensors. It is designed to look like CPU Frequency Gnome applet, so they match each other on panel.

Other way around it is to cool your CPU temperature frequency throttling:

Sepero Hacker: Linux: Cool your CPU temperature with frequency throttling


The better option is to follow the advice in the comment (try to see what has failed when you closed the lid).

As a workaround, or a safety net, you can use a script running in background, something like this one, which depend on the package lm-sensors being installed:

#! /bin/bash

while true; do
    t=$(sensors | grep temp1 | awk '{print $2}' | sed 's/\..*$//')
    if (( $t > 95 )); then   # max temp in whichever units your sensors outputs
        echo High temp $t
            #sudo /usr/sbin/pm-suspend   # uncomment after testing.  
    fi
    sleep 60
done

You have to change temp1 to something relevant for you (look at the output of the command sensors in a terminal). In my case it is:

(0)asus-romano:/etc% sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +61.0°C  (crit = +98.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +46.0°C  (crit = +100.0°C)

...and I want to check temp1. You have to put a string that is able to select only the line you like, so that the pipe in $(..) outputs only the temperature numner. You can test it by hand in the terminal:

(0)asus-romano:/etc% sensors | grep temp1 | awk '{print $2}' | sed 's/\..*$//'
+61

To being able to do the poweroff with sudo without being asked for a password, you can add a file to the directory /etc/sudoers.d:

(1)asus-romano:/etc% sudo cat /etc/sudoers.d/power-off
romano ALL=NOPASSWD: /usr/sbin/pm-suspend
romano ALL=NOPASSWD: /sbin/poweroff

(adapt with your user, obviously --- note that the file content is just the two last lines. The name of the file is irrelevant, see more here) --- now your user will have the power to use this two commands (with sudo) without being asked for a password.