Every time Vivaldi gets updated, I have to run this sed command to apply custom.css
sudo sed -i '1s/^/@import "custom.css";/' /opt/vivaldi-snapshot/resources/vivaldi/style/common.css
Now the command works fine in the terminal but not when I try to run it by creating an alias in ~/.bash_aliases or even through a bash script (placed inside /bin/ with executable permission). I did try using full-path for "custom.css" but it still didn't work. Thanks.
Edit:
(1) Through alias:
alias vivupdate="sed -i '1s/^/@import "custom.css";/' /opt/vivaldi-snapshot/resources/vivaldi/style/common.css"
When I tried to run, I'm getting this error:
$ sudo vivupdate
[sudo] password for admn:
sudo: vivupdate: command not found
$
(2) Through a Bash script:
#!/bin/bash
sed -i '1s/^/@import "custom.css";/' /opt/vivaldi-snapshot/resources/vivaldi/style/common.css
created vivupdate.sh, made it executable and placed it inside /bin/.
Then edited sudoers file and added:
user ALL=(ALL:ALL) NOPASSWD:/bin/vivupdate.sh
But when I run the script in terminal, I get this error:
sed: couldn't open temporary file /opt/vivaldi-snapshot/resources/vivaldi/style/sedCIt48u: Permission denied
common.css
not modified? Was it modified but the change was ignored? Was it modified in a different way to what you were expecting? What happens when you try the alias? Any error messages?