You are at the newest post.
22:31

### Suspend firefox process when not in use with i3-wm

The task is to stop firefox process eating your resources when its just at the moment not in use. If you are using i3-wm as your window manager it is relatively easy to do. The trick is having an workspace assigned for all Firefox windows and sending STOP or CONT signals to Firefox process while switching between workspaces at the same time. Sure you can decide not to STOP when switching to a specific workspace (workspace called "mail" in this case). In the example below you can also see how to do this for unnamed workspaces (workspaces 4 a 5 has no name).

~/.i3/config:
assign [class="^Thunderbird"] 1: mail
assign [class="^Firefox"] 2: ff
assign [class="^Gajim"] 3: IM

set $WS1 mail set$WS2 ff
set $WS3 IM # switch to workspace bindsym$mod+1 workspace 1: $WS1 bindsym$mod+2 workspace 2: $WS2; exec killall -CONT firefox /usr/lib/firefox/plugin-container bindsym$mod+3 workspace 3: $WS3; exec killall -STOP firefox /usr/lib/firefox/plugin-container bindsym$mod+4 workspace 4; exec killall -STOP firefox /usr/lib/firefox/plugin-container
bindsym \$mod+5 workspace 5; exec killall -STOP firefox /usr/lib/firefox/plugin-container

you'll probably also want to preserve that feature when link/URL clicked in another program (i.e. mail client like Thunderbird) is opened in new tab of your firefox. For this reason, it is good idea to add following line to beginning of the shell script /usr/bin/firefox:

/usr/bin/firefox:
killall -CONT firefox
/usr/lib/firefox/plugin-container