Use Browser like a PRO !

Using shortcuts to open browser and different profiles inside browser

Well, I like to keep things in Marie Kondo's way! Especially in the digital world, the more stuff is organized the more you have peace of mind. That's the primary reason I use Window Manager. I know exactly where my window is going to open and depending on the application, in which workspace it's going to open. The predictability keeps everything sane and organized.

So what about the browser? I like Brave Browser. It's somewhat fast, secure and being a chromium browser I have all access to various chrome extensions as well.

But I want to have different browsers for work and personal and at the same time, I don't want to use different browsers like google chrome or firefox. Solution? ... multiple profiles !!

Multiple Profiles

Using the Profiles option we can create different profiles for different domains of our digital life. This is quite awesome because now I can have 2 profiles: one for personal and one for work.

So far so good. But being a nerd, I wanted to run everything with shortcuts. The browser and the profiles in it.

Solution?... Welcome to sxhkd!

sxhkd

sxhkd or Simple X Hot Key Daemon. It's a lightweight daemon that helps bind certain keymaps (or shortcuts in layman's terms) with programs on your window manager.

You simply create a configuration file for sxhkd and add your favourite keymaps as follows

# for browser
super + b
    brave

Note : After saving the configuration file, you need to restart the daemon. You can do so by pkill -USR1 -x sxhkd command.

Here we've mapped super ( aka meta or windows key ) with b to open brave browser.

Now I can open brave with the above combination but how to open the profile? Well after opening the browser we can use ctrl+shift+m to open the popup for profiles and then using the arrow keys we can select the profile we want to open. But to be honest, it's a lot! and annoying as well.

So instead of doing this drill every time we can simply use power of sxhkd to open the profile as well for us. How?

# for default profile
super + b
    brave

# for work profile
alt + b
    brave --profile-directory="Profile 1"

Since brave is a binary, we can use --profile-directory flag and pass the profile value.

Note that the profile value isn't the name you've given to your profile. It'll start with Profile 1 and go on depending on the number of profiles you have. The very first profile has a value Default

Great! Now you can open the browser the default browser using super + b shortcut and work browser using alt+b shortcut and use the browser like a PRO !


Socials

Github

LinkedIn