Linux Mint Cinnamon Multi-Monitor show all apps on every panel

I'm a fan of Linux Mint's Cinnamon Desktop Environment and even though I've tried other environments, I've come back to using it on my desktop and both laptops.

By default, you may not even see a panel on every monitor. You need to right click on the panel that is visible and choose "Add a new panel". All monitor sides should then go red so you can pick a side to add the panel.

Then add the applet "Grouped window list" to the panel, and in Panel edit mode, drag it to the position you want.

I have two monitors connected to the desktop and added the extra panel and the Grouped window list applet to that (as well as Menu and Calendar), but one setting I get used to with Windows 10 (and older Windows) is having all the applications shown on the taskbar, whatever monitor I'm using.

This is actually a limitation, and Linux Mint Cinnamon displays the applications on the task panel that are only open on that monitor. You might actually prefer this, but I like a glance at all applications I've got open just by looking at the panel (taskbar in Windows speak) of whatever monitor I'm using.

If you want the same, it's easily done with a code change.

The fix is actually described at this post on LinuxQuestions.org.

This suggests changing applet.js under /usr/share/cinnamon/applets/window-list@cinnamon.org

If you are using the Grouped window list though, which is the default for Linux Mint 20+ (this is more like Windows 7+ style), you actually need to change applet.js under /usr/share/cinnamon/applets/grouped-window-list@cinnamon.org .

Make a backup first. I copied the file to a backup location, and also made a copy in my home folder which I can then freely edit without root permissions, for example.

cd ~
mkdir -p cinnamonedits/grouped-window-list@cinnamon.org
cp /usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/applet.js cinnamonedits/grouped-window-list@cinnamon.org
cd cinnamonedits/grouped-window-list@cinnamon.org
cp applet.js appletoriginal.js

Now edit the copy of applet.js in your favourite editor

Find updateMonitorWatchlist() - at line 512 as of Linux Mint 21 August 2022. Comment out, or remove this code:

        } else if (instances.length > 1 && !onPrimary) {
            monitorWatchList = [this.panel.monitorIndex];

Then find monitorWatchList.push(i); and remove the if statement before it (and curly bracket after if it exists).

Copy the modified file over the original with sudo permission:

sudo cp ~/cinnamonedits/grouped-window-list@cinnamon.org/applet.js /usr/share/cinnamon/applets/grouped-window-list@cinnamon.org

Restart cinnamon using Alt+F2, then type r and hit enter.

My edited full function of /usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/applet.js is below:

    updateMonitorWatchlist() {
        if (!this.numberOfMonitors) {
            this.numberOfMonitors = Gdk.Screen.get_default().get_n_monitors();
        }
        let onPrimary = this.panel.monitorIndex === Main.layoutManager.primaryIndex;
        let instances = Main.AppletManager.getRunningInstancesForUuid(this.state.uuid);
        let {monitorWatchList} = this.state;
        /* Simple cases */
        if (this.numberOfMonitors === 1) {
            monitorWatchList = [Main.layoutManager.primaryIndex];
        /*} else if (instances.length > 1 && !onPrimary) {
            monitorWatchList = [this.panel.monitorIndex];*/
        } else {
           /* This is an instance on the primary monitor - it will be
            * responsible for any monitors not covered individually.  First
            * convert the instances list into a list of the monitor indices,
            * and then add the monitors not present to the monitor watch list
            * */
            monitorWatchList = [this.panel.monitorIndex];
            for (let i = 0; i < instances.length; i++) {
                if (!instances[i]) {
                    continue;
                }
                instances[i] = instances[i].panel.monitorIndex;
            }

            for (let i = 0; i < this.numberOfMonitors; i++) {
                //if (instances.indexOf(i) === -1) {
                monitorWatchList.push(i);
                //}
            }
        }
        this.state.set({monitorWatchList});
    }

Update: Since this needs to be repeated after Cinnamon updates, I've created a simple patch to apply this with one command. You can download the tar.gz here (<1KB).

Extract with tar zxvf cinnamonedits.tar.gz

Run using shell script:

cd cinnamonedits
sudo ./patchmultimon.sh

Restart Cinnamon after using Alt+F2, typing r, enter.

If the script is not executable, run sudo chmod +x patchmultimon.sh>

This is one thing to love about free open-source - things can actually be changed!

Labels

Linux | Linux Mint