How to enforce signle instance of firefox on gnome?

0

I need to help some users finding their lost browser tabs.

Problem is that they keep launching multiple instances of a browser. On gnome, alt-tab is difficult to explain as it requires navigation through windows of same app. Can I configure gnome to launch only one process of an application?

sevo

Posted 2017-09-12T18:14:20.370

Reputation: 133

Answers

0

You could write a script that checks if firefox is already running and only run it if it is not.

There is a similar question here. I just tried it out on my machine in this way:

#!/bin/bash

# Abort startup if another instance was found
pidof /usr/lib/firefox/firefox > /dev/null && {
  echo Sorry. Only one instance allowed.
  exit
}
firefox

Firefox now only runs if it is not already running. Check the correct path to check with ps aux | grep firefox, it might be different on your system, I don't know.

Now have your users run this script instead of directly running firefox.

jasu

Posted 2017-09-12T18:14:20.370

Reputation: 1

0

You could instead configure GNOME to make Alt+Tab navigate windows, not tabs:

gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']"

Then no explanation for Alt+Tab will be needed.

(Though, just accessing the overview via Super would give a similar result...)

user1686

Posted 2017-09-12T18:14:20.370

Reputation: 283 655