Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Twitter Avatar in Menu
// ==UserScript==
// @name Twitter Avatar in Menu
// @namespace http://patik.com/code/user-scripts/
// @include https://twitter.com/*
// @include http://twitter.com/*
// @version 2.1.20131118
// ==/UserScript==
(function _twitter_avatar_in_menu() {
// Find the generic 'person' outline in the nav bar, which will be replaced
var menuitem = document.querySelector('.nav-me') || null,
// Get avatar from the user menu (gear icon) to ensure we don't grab some other avatar
avi = document.querySelector('.global-nav .current-user .avatar[src]');
if (menuitem && avi.src) {
menuitem.style.cssText = 'background-image: url("' + avi.src + '") !important;background-position: 0 0;border-radius: 4px;background-size: 21px 22px;';
}
}());
Owner

patik commented Mar 13, 2012

Shows your avatar in the top menu on Twitter.com so you can tell at a glance which account you're logged in under.

Click on the 'raw' link in the top right of the gist to prompt Firefox & Chrome to install it as a user script.

Example

Owner

patik commented Nov 18, 2013

Updated to work with the current site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment