Screen Flicker with Linux Mint 22

After upgrading to Linux Mint 22 on my Lenovo ThinkPad T470 I began to experience screen flicker.

Research revealed that the problem was introduced to installations using Intel video drivers in the Linux Kernel 6.8 and subsequent releases in the 6.8 stream.

A fix was implemented with a couple of boot options. Instructions on what those options are and how to implement them will follow.

My continued research suggests that the problem is resolved in the 6.9 kernel.

There are ways to start using the newer kernel but for now I’ll stick with the workaround until Linux Mint 22 makes the 6.9 kernel available in an update/upgrade.

The boot options that will prevent screen flickering are:

i915.enable_dc=0 intel_idle.max_cstate=2

To make these boot options semi-permanent, they can be added to the default grub menu template.

Using your favourite text editor with sudo, edit the /etc/default/grub file

Look for a line containing:

GRUB_CMDLINE_LINUX=""

Note that there may already be some boot options between the “” on that line.

Add the above two options between the quotes on that line (along with any other options, if there are any).

The line in will now look something like:

GRUB_CMDLINE_LINUX="i915.enable_dc=0 intel_idle.max_cstate=2"

Then run:

sudo update-grub

Now, reboot your computer and when the grub menu appears you can confirm that the options have been added to the “linux” line in the menu entries.

How to re-connect quickly to internet when the laptop lid is lifted

I am running Linux Mint 22 on my Lenovo Thinkpad T470.

When I re-open the laptop lid it would take several minutes for internet to re-connect.

In order to solve this problem I consulted ChatGPT and was given a few options to try. I discovered that restarting the NetworkManager did the trick.

I then asked ChatGPT how to automate this process. It suggested setting up a service that would launch whenever the laptop lid is opened.

Here is how I implemented it:

1. Create a systemd service

You can create a custom systemd service that triggers when the laptop lid opens.

Open Terminal and create a new service file:

sudo vim /etc/systemd/system/lid-open.service

Add the following configuration:

[Unit]
Description=Run a command when the laptop lid is opened
After=suspend.target

[Service]
Type=oneshot
ExecStart=/path/to/your/script.sh

[Install]
WantedBy=suspend.target

Replace /path/to/your/script.sh with the path to the script or command you want to run when the lid opens

2. Create the Script

Create the script that will be executed when the lid opens.

In your home directory, create the script file:

vim ~/lid-open-script.sh

Add your desired command to the script. For example, if you want to reconnect to Wi-Fi, your script might look like this:

#!/usr/bin/bash
sudo systemctl restart NetworkManager

Make the script executable

chmod +x ~/lid-open-script.sh

3. Enable and Start the Service

Enable and start the service so that it runs when the laptop resumes after the lid opens.

Enable the service:
sudo systemctl enable lid-open.service

Start the service:

sudo systemctl start lid-open.service

4. Test the Setup

Close and reopen your laptop lid to see if the script runs as expected. You can also check the status of your service to troubleshoot if necessary:

sudo systemctl status lid-open.service

This method allows you to automate the execution of any command or script when the laptop lid opens. If you run into any issues, you can check the logs with journalctl -xe for further details.

Wake up Linux Mint with PS/2 Mouse

Thanks to ChatGPT which gave me specific and accurate instructions I can now wake my computer running Linux Mint when the monitor goes to sleep (not Suspend) after the time specified in the Power Management settings.

Here is what ChatGPT told me to do:

To enable your Linux Mint system to wake up from suspend using a PS/2 mouse, you can try the following steps:

Check if the PS/2 mouse is recognized:

Open a terminal and run:

cat /proc/bus/input/devices

This command will list all input devices. Look for a section related to your PS/2 mouse. It might be labeled something like “ImPS/2 Generic Wheel Mouse” or similar.

Enable wakeup for the PS/2 mouse:

First, identify the device file corresponding to the PS/2 mouse. You can usually find it under /sys/bus/serio/devices/serioX/power/wakeup where X is the specific identifier of your mouse device.


Check if wakeup is enabled for the device by running:

cat /sys/bus/serio/devices/serioX/power/wakeup

Replace serioX with the correct identifier for your mouse. If it says “disabled,” you’ll need to enable it.


To enable it, run the following command (you’ll need root privileges):

echo enabled | sudo tee /sys/bus/serio/devices/serioX/power/wakeup

Make the change persistent:

To ensure that the setting persists after a reboot, you can add the command to a startup script.

Edit the file /etc/rc.local (create it if it doesn’t exist) and add the wakeup command just before the exit 0 line. For example:

# Enable wakeup for PS/2 mouse
echo enabled > /sys/bus/serio/devices/serioX/power/wakeup
exit 0

Make sure the file is executable:

sudo chmod +x /etc/rc.local

Test it out:

Suspend your system and then try moving the PS/2 mouse to see if it wakes up your system.