feat (home/graphical): custom .desktop files, filter default apps

This commit is contained in:
Henri Saudubray 2026-04-13 13:56:23 +02:00
parent cb57c3fd7c
commit d5b2a8832b
Signed by: hms
GPG key ID: 7065F57ED8856128
6 changed files with 280 additions and 47 deletions

View file

@ -1,5 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [
./packages/librewolf
./packages/thunderbird
];
home = { home = {
packages = packages =
with pkgs; with pkgs;
@ -7,7 +12,6 @@
adw-gtk3 adw-gtk3
blackbox-terminal blackbox-terminal
discord discord
gapless
gnome-solanum gnome-solanum
gnome-tweaks gnome-tweaks
high-tide high-tide
@ -34,55 +38,26 @@
useless-gaps useless-gaps
window-centering window-centering
]); ]);
file."librewolf-gnome-theme" = {
target = ".librewolf/default/chrome/librewolf-gnome-theme";
source = fetchTarball {
url = "https://github.com/rafaelmardojai/firefox-gnome-theme/archive/v143.tar.gz";
sha256 = "1gkfi77n8cn5xzl3wi9mggh7adirjrsnbqygg1mcvjy0ynmd6kfh";
};
};
file."thunderbird-gnome-theme" = {
target = ".thunderbird/default/chrome/thunderbird-gnome-theme";
source = fetchTarball {
url = "https://github.com/rafaelmardojai/thunderbird-gnome-theme/archive/v115.tar.gz";
sha256 = "1l295w61h5469328qkjggny3mjq1x0q3zr9p8pz5sq5pypc7604x";
};
};
}; };
programs.firefox.enable = true; programs.firefox.enable = true;
programs.librewolf = { xdg.desktopEntries = {
enable = true; "com.raggesilver.BlackBox" = {
profiles.default = { categories = [
name = "Default"; "GNOME"
settings = { "GTK"
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; "System"
"svg.context-properties.content.enabled" = true; "TerminalEmulator"
"gnomeTheme.hideSingleTab" = true; ];
}; comment = "Access the terminal";
userChrome = '' exec = "blackbox";
@import "librewolf-gnome-theme/userChrome.css"; genericName = "Terminal Emulator";
@import "librewolf-gnome-theme/theme/colors/dark.css"; icon = "com.raggesilver.BlackBox";
''; name = "Terminal";
}; startupNotify = false;
}; terminal = false;
type = "Application";
programs.thunderbird = {
enable = true;
profiles.default = {
isDefault = true;
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"svg.context-properties.content.enabled" = true;
"gnomeTheme.hideTabbar" = true;
};
userChrome = ''
@import "thunderbird-gnome-theme/userChrome.css";
@import "thunderbird-gnome-theme/theme/colors/dark.css";
'';
}; };
}; };

View file

@ -0,0 +1,49 @@
{ ... }:
{
home.file."librewolf-gnome-theme" = {
target = ".librewolf/default/chrome/librewolf-gnome-theme";
source = fetchTarball {
url = "https://github.com/rafaelmardojai/firefox-gnome-theme/archive/v143.tar.gz";
sha256 = "1gkfi77n8cn5xzl3wi9mggh7adirjrsnbqygg1mcvjy0ynmd6kfh";
};
};
programs.librewolf = {
enable = true;
profiles.default = {
name = "Default";
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"svg.context-properties.content.enabled" = true;
"gnomeTheme.hideSingleTab" = true;
};
userChrome = ''
@import "librewolf-gnome-theme/userChrome.css";
@import "librewolf-gnome-theme/theme/colors/dark.css";
'';
};
};
xdg.desktopEntries.librewolf = {
categories = [
"Network"
"WebBrowser"
];
comment = "Browse the Web";
exec = "librewolf --name librewolf %U";
genericName = "Web Browser";
icon = ./icon.svg;
mimeType = [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
name = "Web";
startupNotify = true;
terminal = false;
type = "Application";
};
}

View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="98" x2="108" y1="112" y2="112">
<stop offset="0" stop-color="#16529c"/>
<stop offset="1" stop-color="#236ac0"/>
</linearGradient>
<linearGradient id="b" gradientTransform="matrix(0 -1 1 0 -157 121)" gradientUnits="userSpaceOnUse" x1="0.999999" x2="0.999999" y1="215" y2="171">
<stop offset="0" stop-color="#2166bb"/>
<stop offset="1" stop-color="#89eda9"/>
</linearGradient>
<filter id="c" height="100%" width="100%" x="0%" y="0%">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
</filter>
<mask id="d">
<g filter="url(#c)">
<rect fill-opacity="0.5" height="128" width="128"/>
</g>
</mask>
<clipPath id="e">
<rect height="152" width="192"/>
</clipPath>
<mask id="f">
<g filter="url(#c)">
<rect fill-opacity="0.5" height="128" width="128"/>
</g>
</mask>
<clipPath id="g">
<rect height="152" width="192"/>
</clipPath>
<mask id="h">
<g filter="url(#c)">
<rect fill-opacity="0.5" height="128" width="128"/>
</g>
</mask>
<clipPath id="i">
<rect height="152" width="192"/>
</clipPath>
<path d="m 64 5 c 33.136719 0 60 26.863281 60 60 s -26.863281 60 -60 60 s -60 -26.863281 -60 -60 s 26.863281 -60 60 -60 z m 0 0" fill="url(#a)"/>
<path d="m 64 5 c -33.136719 0 -60 26.863281 -60 60 s 26.863281 60 60 60 z m 0 0" fill="url(#b)"/>
<path d="m 124 63 c 0 33.136719 -26.863281 60 -60 60 s -60 -26.863281 -60 -60 s 26.863281 -60 60 -60 s 60 26.863281 60 60 z m 0 0" fill="#40a1c8"/>
<path d="m 28.003906 64 c 0.125 13.914062 2.882813 27.367188 7.835938 38.25 c -3.941406 2.015625 -7.28125 4.441406 -9.863282 7.160156 c -13.640624 -11.171875 -21.675781 -27.78125 -21.96875 -45.410156 z m 0 0" fill="#49bbb0"/>
<path d="m 64 96 v 27 c -4.5 0 -8.988281 -0.507812 -13.375 -1.511719 c -5.800781 -4.058593 -10.894531 -10.691406 -14.78125 -19.238281 c 7.902344 -4.039062 17.867188 -6.25 28.15625 -6.25 z m 0 0" fill="#378bde"/>
<path d="m 99.996094 64 c -0.125 13.914062 -2.882813 27.367188 -7.839844 38.25 c 3.945312 2.015625 7.28125 4.441406 9.863281 7.160156 c 13.640625 -11.171875 21.675781 -27.78125 21.972657 -45.410156 z m 0 0" fill="#266ec6"/>
<path d="m 64 64 v 59 c 4.5 0 8.988281 -0.507812 13.375 -1.511719 c 13.472656 -9.433593 22.390625 -32.097656 22.621094 -57.488281 z m 0 0" fill="#378bde"/>
<path d="m 64 96 v 27 c 4.5 0 8.988281 -0.507812 13.375 -1.511719 c 5.800781 -4.058593 10.894531 -10.691406 14.78125 -19.238281 c -7.902344 -4.039062 -17.867188 -6.25 -28.15625 -6.25 z m 0 0" fill="#266ec6"/>
<path d="m 92.160156 102.25 c -3.890625 8.546875 -8.984375 15.175781 -14.78125 19.238281 c 9.035156 -2.066406 17.472656 -6.203125 24.644532 -12.078125 c -2.582032 -2.71875 -5.921876 -5.144531 -9.863282 -7.160156 z m 0 0" fill="#1e62b5"/>
<path d="m 64 3 c -33.136719 0 -60 26.863281 -60 60 c 0 0.332031 0.003906 0.667969 0.007812 1 h 59.992188 z m 0 0" fill="#53d795"/>
<path d="m 50.625 4.507812 c -9.039062 2.070313 -17.476562 6.203126 -24.648438 12.078126 c 2.582032 2.722656 5.921876 5.144531 9.867188 7.164062 c 3.890625 -8.550781 8.984375 -15.179688 14.78125 -19.242188 z m 0 0" fill="#72e99a"/>
<path d="m 64 3 c -4.5 0 -8.984375 0.507812 -13.375 1.507812 c -13.664062 9.570313 -22.625 32.734376 -22.625 58.492188 c 0 0.332031 0 0.667969 0.003906 1 h 35.996094 z m 0 0" fill="#49bbb0"/>
<path d="m 64 3 c -4.5 0 -8.984375 0.507812 -13.375 1.507812 c -5.796875 4.0625 -10.890625 10.691407 -14.78125 19.242188 c 7.90625 4.039062 17.867188 6.25 28.15625 6.25 z m 0 0" fill="#53d795"/>
<path d="m 64 3 c 33.136719 0 60 26.863281 60 60 c 0 0.332031 -0.003906 0.667969 -0.007812 1 h -59.992188 z m 0 0" fill="#378bde"/>
<path d="m 77.375 4.507812 c 9.039062 2.070313 17.476562 6.203126 24.648438 12.078126 c -2.582032 2.722656 -5.921876 5.144531 -9.863282 7.160156 c -3.894531 -8.546875 -8.988281 -15.175782 -14.785156 -19.238282 z m 0 0" fill="#40a1c8"/>
<path d="m 64 3 c 4.5 0 8.988281 0.507812 13.375 1.507812 c 13.664062 9.570313 22.625 32.734376 22.625 58.492188 c 0 0.332031 0 0.667969 -0.003906 1 h -35.996094 z m 0 0" fill="#40a1c8"/>
<path d="m 64 3 c 4.5 0 8.988281 0.507812 13.375 1.507812 c 5.796875 4.0625 10.890625 10.691407 14.78125 19.238282 c -7.90625 4.042968 -17.867188 6.253906 -28.15625 6.253906 z m 0 0" fill="#49bbb0"/>
<g clip-path="url(#e)" mask="url(#d)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 169.5 24 v 1 h 13 v -1 z m 0 0" fill="#2e3436"/>
</g>
<g clip-path="url(#g)" mask="url(#f)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 169.5 21 v 1 h 13 v -1 z m 0 0" fill="#2e3436"/>
</g>
<g clip-path="url(#i)" mask="url(#h)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 169.5 27 v 1 h 13 v -1 z m 0 0" fill="#2e3436"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -0,0 +1,51 @@
{ ... }:
{
home.file."thunderbird-gnome-theme" = {
target = ".thunderbird/default/chrome/thunderbird-gnome-theme";
source = fetchTarball {
url = "https://github.com/rafaelmardojai/thunderbird-gnome-thee/archive/v115.tar.gz";
sha256 = "1l295w61h5469328qkjggny3mjq1x0q3zr9p8pz5sq5pypc7604x";
};
};
programs.thunderbird = {
enable = true;
profiles.default = {
isDefault = true;
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"svg.context-properties.content.enabled" = true;
"gnomeTheme.hideTabbar" = true;
};
userChrome = ''
@import "thunderbird-gnome-theme/userChrome.css";
@import "thunderbird-gnome-theme/theme/colors/dark.css";
'';
};
};
xdg.desktopEntries.thunderbird = {
categories = [
"Network"
"Chat"
"Email"
"Feed"
"GTK"
"News"
];
comment = "Read and write e-mails or RSS feeds, or manage tasks on calendars.";
exec = "thunderbird --name thunderbird %U";
genericName = "Email Client";
icon = ./icon.svg;
mimeType = [
"message/rfc822"
"x-scheme-handler/mailto"
"text/calendar"
"text/x-vcard"
];
name = "Email";
startupNotify = true;
terminal = false;
type = "Application";
};
}

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="12" x2="116.000001" y1="124" y2="124">
<stop offset="0" stop-color="#ce9508"/>
<stop offset="0.0384615" stop-color="#f5c211"/>
<stop offset="0.0769231" stop-color="#e5a50a"/>
<stop offset="0.921478" stop-color="#e5a50a"/>
<stop offset="0.961538" stop-color="#f5c211"/>
<stop offset="1" stop-color="#ce9708"/>
</linearGradient>
<linearGradient id="b" gradientUnits="userSpaceOnUse" x1="18.000001" x2="110.000001" y1="24" y2="24">
<stop offset="0" stop-color="#cc920a"/>
<stop offset="0.0434163" stop-color="#e5a50a"/>
<stop offset="0.955153" stop-color="#e5a50a"/>
<stop offset="1" stop-color="#cc920a"/>
</linearGradient>
<filter id="c" height="100%" width="100%" x="0%" y="0%">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
</filter>
<mask id="d">
<g filter="url(#c)">
<rect fill-opacity="0.1" height="128" width="128"/>
</g>
</mask>
<clipPath id="e">
<rect height="152" width="192"/>
</clipPath>
<mask id="f">
<g filter="url(#c)">
<rect fill-opacity="0.14" height="128" width="128"/>
</g>
</mask>
<clipPath id="g">
<rect height="152" width="192"/>
</clipPath>
<mask id="h">
<g filter="url(#c)">
<rect fill-opacity="0.3" height="128" width="128"/>
</g>
</mask>
<linearGradient id="i" gradientUnits="userSpaceOnUse" x1="28.53382" x2="115.42492" y1="64.799103" y2="64.799103">
<stop offset="0" stop-opacity="0.35"/>
<stop offset="0.5"/>
<stop offset="1" stop-opacity="0.35"/>
</linearGradient>
<clipPath id="j">
<rect height="152" width="192"/>
</clipPath>
<mask id="k">
<g filter="url(#c)">
<rect fill-opacity="0.3" height="128" width="128"/>
</g>
</mask>
<clipPath id="l">
<rect height="152" width="192"/>
</clipPath>
<path d="m 20 12 h 88 c 4.417969 0 8 3.582031 8 8 v 88 c 0 4.417969 -3.582031 8 -8 8 h -88 c -4.417969 0 -8 -3.582031 -8 -8 v -88 c 0 -4.417969 3.582031 -8 8 -8 z m 0 0" fill="url(#a)"/>
<path d="m 20 12 h 88 c 4.417969 0 8 3.582031 8 8 v 60 c 0 4.417969 -3.582031 8 -8 8 h -88 c -4.417969 0 -8 -3.582031 -8 -8 v -60 c 0 -4.417969 3.582031 -8 8 -8 z m 0 0" fill="#f6d32d"/>
<path d="m 20 18 h 88 c 1.105469 0 2 0.894531 2 2 v 60 c 0 1.105469 -0.894531 2 -2 2 h -88 c -1.105469 0 -2 -0.894531 -2 -2 v -60 c 0 -1.105469 0.894531 -2 2 -2 z m 0 0" fill="url(#b)"/>
<path d="m 20 42 h 88 c 1.105469 0 2 0.894531 2 2 v 36 c 0 1.105469 -0.894531 2 -2 2 h -88 c -1.105469 0 -2 -0.894531 -2 -2 v -36 c 0 -1.105469 0.894531 -2 2 -2 z m 0 0" fill="#c18b08"/>
<path d="m 22.203125 28.058594 c -1.203125 0 -2.179687 0.976562 -2.179687 2.179687 l -0.023438 51.761719 h 18 v 8 h 52 v -8 h 18 l -0.054688 -51.761719 c 0 -1.203125 -0.976562 -2.179687 -2.179687 -2.179687 z m 0 0" fill="#f6f5f4"/>
<g clip-path="url(#e)" mask="url(#d)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 28.460938 44.675781 l 43.167968 34.886719 l 43.609375 -34.886719 l -43.609375 37.066407 z m 0 0"/>
</g>
<path d="m 22.203125 28.675781 c -0.464844 0 -0.894531 0.148438 -1.25 0.398438 l 42.675781 34.488281 l 42.894532 -34.316406 c -0.386719 -0.351563 -0.902344 -0.570313 -1.464844 -0.570313 z m 0 0" fill="#f7f8f9"/>
<g clip-path="url(#g)" mask="url(#f)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 71.628906 68.839844 c -4 0 -8 1.429687 -11.0625 4.285156 l -32.542968 22.921875 l -0.023438 -0.046875 v 2 h 88 v -2 l -33.304688 -22.875 c -3.066406 -2.855469 -7.066406 -4.285156 -11.066406 -4.285156 z m 0 0"/>
</g>
<path d="m 63.628906 54.839844 c -4 0 -8 1.429687 -11.0625 4.285156 l -32.542968 22.921875 l 17.976562 -0.046875 v 10 h 52 v -10 h 18 l -33.304688 -22.875 c -3.066406 -2.855469 -7.066406 -4.285156 -11.066406 -4.285156 z m 0 0" fill="#f0f0ee"/>
<g clip-path="url(#j)" mask="url(#h)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 30.554688 44.675781 c -0.914063 0 -1.695313 1.5625 -2.019532 2.359375 l 33.128906 33.546875 c 5.714844 5.785157 14.917969 5.785157 20.632813 0 l 33.128906 -33.546875 c -0.324219 -0.796875 -1.105469 -2.359375 -2.019531 -2.359375 z m 0 0" fill="url(#i)"/>
</g>
<path d="m 22.554688 28.675781 c -0.472657 0 -0.910157 0.152344 -1.265626 0.40625 l 32.375 32.375 c 5.714844 5.714844 14.917969 5.714844 20.632813 0 l 32.371094 -32.375 c -0.355469 -0.253906 -0.789063 -0.40625 -1.261719 -0.40625 z m 0 0" fill="#f6f5f4"/>
<path d="m 38 95 v 7 c 0 2.214844 1.785156 4 4 4 h 44 c 2.214844 0 4 -1.785156 4 -4 v -7 c 0 2.214844 -1.785156 4 -4 4 h -44 c -2.214844 0 -4 -1.785156 -4 -4 z m 0 0" fill="#f6d32d"/>
<path d="m 90 92 v 4 c 0 2.214844 -1.785156 4 -4 4 h -44 c -2.214844 0 -4 -1.785156 -4 -4 v -4 z m 0 0" fill="#c0bfbc"/>
<g clip-path="url(#l)" mask="url(#k)" transform="matrix(1 0 0 1 -8 -16)">
<path d="m 172.492188 27 h 7 c 0.832031 0 1.5 0.445312 1.5 1 s -0.667969 1 -1.5 1 h -7 c -0.832032 0 -1.5 -0.445312 -1.5 -1 s 0.667968 -1 1.5 -1 z m 0 0" fill="#241f31"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -1,4 +1,9 @@
{ lib, config, ... }: {
config,
lib,
pkgs,
...
}:
{ {
options = { options = {
graphical.enable = lib.mkEnableOption "Enable graphical features"; graphical.enable = lib.mkEnableOption "Enable graphical features";
@ -11,6 +16,16 @@
services.displayManager.gdm.enable = true; services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true; services.desktopManager.gnome.enable = true;
environment.gnome.excludePackages = with pkgs; [
epiphany
geary
gnome-characters
gnome-connections
gnome-console
gnome-music
gnome-tour
yelp
];
services.gnome.gnome-browser-connector.enable = true; services.gnome.gnome-browser-connector.enable = true;
}; };
} }