elenapan / dotfiles

There is no place like ~/
GNU General Public License v2.0
3.51k stars 175 forks source link

Brave browser doesn't appear on Firefox icon in statusbar #94

Closed simplyshiro closed 4 years ago

simplyshiro commented 4 years ago

Hi,

Clicking on the Firefox icon runs or raises Brave but appears on a different icon in the statusbar. Screenshot

I already replaced user.browser to brave and I added Brave and Brave-browser to rc.lua.

rule_any = {
            class = {
                "firefox",
                "Nightly",
                -- "qutebrowser",
                "Brave",
                "Brave-browser"
            },
        },

(I'm new to awesome and I don't really know Lua that much)

ceuk commented 4 years ago

Hey @shiro-su

@elenapan uses this very clever file to work out what icons to show for things

If you check out around line 38 you can see a load of different app names and the symbol to use (this might look funny on Github because of the font). The list uses the window class so to add an entry for Brave in there we need to know the window class.

We can get this by using a handy tool called xprop. You type that in your terminal and then click on a window and it will print out a load of information about that window. We're looking for the WM_CLASS property. We can filter for this property with grep so out command would like like this:

xprop | grep WM_CLASS

Type it, press enter and click on Brave, you should see something like this:

image

If that worked you'll see we have two class names there. You generally want to be using the version with the titlecase name in my experience or you could just add a line for both.

So, now that we know the class, we can just copy and paste line 39 in config/awesome/icons/init.lua and change "Firefox" to "Brave-browser".

I think that should do the trick for you, and now that you understand how it works/how to get window classes you can add new icons in the future if you need to.

Hope that helps :)

simplyshiro commented 4 years ago

Thanks!

That fixed it. It took me a while how to pin an icon on the statusbar.