3

I use Ubuntu 18.04 Bionic Beaver with the GNOME Desktop environment. I would like to use keyboard shortcuts to open a webpage in a certain Chrome person in another workspace. Opening the webpage is no problem, but I don't know how to extend the command to open it in my second workspace. I have shortcuts to move it to an other workspace after it opens, but I would like to do it all at one (maybe calling a .sh file might help?). This is what I have so far:

google-chrome https://askubuntu.com/ --profile-directory="Person 0"
0

1 Answer 1

4

It's a hacky workaround, but I think this would achieve what you're looking for. You need to install wmctrl first by running the following command

sudo apt install wmctrl

Then you need to create a bash script. First create a text file and add the following lines to it.

#!/bin/bash
wmctrl -s 1
google-chrome --new-window https://askubuntu.com/ --profile-directory="Person 0"

(note that you need to use wmctrl -s %n in the second line if you want to open Chrome in the %n+1-th workspace). Save the file as, say chrome-workspace2.sh, and make it executable.

Finally, while creating the keyboard shortcut, use the full path to this script as the command for the shortcut.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .