I want to open Chromium browser and then open a couple of web pages, let's say "google.com", and "stackexchange.com". My code for the same is below.
#!/bin/bash #website 1 chromium-browser xdotool type http://google.com xdotool key --delay 2000 'Return' xdotool key 'ctrl+Tab' #website 2 xdotool type http://stackexchange.com xdotool key --delay 2000 'Return'
1) This piece of code only works when I already have a Chromium browser open. Then only, it opens another Chromium browser (as per the code) and performs everything perfectly.
2) If I don't have a browser already open, then this script just opens the browser and does nothing.
Where am I going wrong? Why do I need to have another browser open for the code to work?