This script adds a line to add custom.js to vivaldi browser directory:

#!/bin/bash
vivaldi=/opt/vivaldi/resources/vivaldi
moddir=$HOME/vivaldi-modding/
sudo cp $moddir/custom.js $vivaldi
sudo sed -i -e 's/<\/body>/  <script src="custom.js"><\/script>\n  <\/body>/' "$vivaldi/window.html"
sudo chgrp rainer $vivaldi/custom.js
sudo chmod g+rw $vivaldi/custom.js
echo "vivaldi patched"

It is needed after each browser update that always deletes this line. It works fine for years, and I execute it by using a launcher that opens a terminal, with pw request:

[Desktop Entry]
Name=Vivaldi-mod
Exec=bash ~/vivaldi-modding/vivaldi.sh
Icon=vivaldi
Terminal=true

Now I want to add a command to start vivaldi browser. Just adding another line like:

/usr/bin/vivaldi-stable

does the job, however, because the browser is started via terminal, the latter produces lot of output and - more important - if I quit the terminal, the browser closes too.
To start the browser and quit terminal, I found this code:

/opt/vivaldi/vivaldi & disown ; exit

The code works when put into a fresh terminal as desired. However, putting that code at bottom of script (after echo "vivaldi patched"), it doesn't work. The patch is executed but the browser not started.

Question:

What solution is available?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.