Skip to content

Instantly share code, notes, and snippets.

@bahrom04
Last active December 27, 2025 20:29
Show Gist options
  • Select an option

  • Save bahrom04/369faf33f2ca2ccc59cbcc57544fadf3 to your computer and use it in GitHub Desktop.

Select an option

Save bahrom04/369faf33f2ca2ccc59cbcc57544fadf3 to your computer and use it in GitHub Desktop.

Git hosting repo language stats helper

To use install Tampermonkey extension for Chrome-based or Firefox-based browsers.

Codeberg

Skrinshot: 2025-12-25 12-57-21

Gitlab

Skrinshot: 2025-12-25 12-57-36
// ==UserScript==
// @name Codeberg auto toggle language stats
// @namespace http://tampermonkey.net/
// @version 2025-12-25
// @description try to take over the world!
// @author You
// @match https://codeberg.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=codeberg.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
function fix() {
document.getElementById("language-stats-legend")?.classList?.remove("tw-hidden")
}
window.onload = function(e) {
fix();
}
})();
// ==UserScript==
// @name Repo language helper
// @namespace http://tampermonkey.net/
// @version 2025-12-25
// @description try to take over the world!
// @author You
// @match https://gitlab.gnome.org/*
// @match https://gitlab.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=gnome.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
let progress = $(".progress.repository-languages-bar.js-show-on-project-root");
let children = progress.children();
let parent = progress.parent();
if (!parent[0]) return;
let container = $(document.createElement("div"));
container.css("margin", "4px 0");
parent.append(container);
children.each((i, child) => {
let ch = $(child);
let tooltip = $(ch.attr("title"));
let lang = tooltip[0].innerText;
let perc = tooltip[2].innerText;
let color = ch.css("background-color");
let childContainer = $(document.createElement("div"));
childContainer.css("display", "flex");
childContainer.css("gap", "8px");
childContainer.css("align-items", "center");
container.append(childContainer)
let dot = $(document.createElement("div"));
dot.css("height", "6px");
dot.css("width", "6px");
dot.css("border-radius", "50%");
dot.css("background-color", color);
childContainer.append(dot);
let span = $(document.createElement("span"));
span.text(`${lang} - ${perc}`);
childContainer.append(span);
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment