From 6120ca25fbc83447934f4c376ba4171449124708 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Sun, 25 Aug 2024 16:30:22 +0800 Subject: [PATCH] home-manager/firefox: better sidebar --- home/xin/calcite.nix | 89 +++++++++++++++++++++++++++--- modules/home-manager/alacritty.nix | 1 + 2 files changed, 82 insertions(+), 8 deletions(-) diff --git a/home/xin/calcite.nix b/home/xin/calcite.nix index 130bd00..f39fe62 100644 --- a/home/xin/calcite.nix +++ b/home/xin/calcite.nix @@ -47,14 +47,15 @@ custom-hm = { alacritty = { enable = true; }; - direnv = { enable = true; }; - fish = { enable = true; }; - git = { enable = true; signing.enable = true; }; + cosmic-term = { enable = true; }; + direnv = { enable = true; }; fish = { enable = true; }; git = { enable = true; signing.enable = true; }; neovim = { enable = true; }; vscode = { enable = true; languages = { cxx = true; python = true; scala = true; latex = true; }; llm = true; }; zellij = { enable = true; }; }; + programs.gnome-shell.enable = true; + programs.atuin = { enable = true; flags = [ "--disable-up-arrow" ]; @@ -68,10 +69,82 @@ programs.firefox.profiles.default = { isDefault = true; - userChrome = builtins.readFile "${pkgs.fetchgit { - url = "https://gist.github.com/0ded98af9fe3da35f3688f81364d8c14.git"; - rev = "11bb4f428382052bcbbceb6cc3fef97f3c939481"; - hash = "sha256-J11indzEGdUA0HSW8eFe5AjesOxCL/G05KwkJk9GZSY="; - }}/userChrome.css"; + userChrome = '' + #titlebar { + display: none; + } + + #sidebar-header { + display: none; + } + + [titlepreface*="."] #sidebar-header { + visibility: collapse !important; + } + [titlepreface*="."] #titlebar { + visibility: collapse; + } + + #sidebar-box{ + --uc-sidebar-width: 33px; + --uc-sidebar-hover-width: 300px; + --uc-autohide-sidebar-delay: 90ms; + position: relative; + min-width: var(--uc-sidebar-width) !important; + width: var(--uc-sidebar-width) !important; + max-width: var(--uc-sidebar-width) !important; + z-index:1; + } + + #sidebar-box[positionend]{ direction: rtl } + #sidebar-box[positionend] > *{ direction: ltr } + + #sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr } + #sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl } + + #main-window[sizemode="fullscreen"] #sidebar-box{ --uc-sidebar-width: 1px; } + + #sidebar-splitter{ display: none } + + #sidebar-header{ + overflow: hidden; + color: var(--chrome-color, inherit) !important; + padding-inline: 0 !important; + } + + #sidebar-header::before, + #sidebar-header::after{ + content: ""; + display: -moz-box; + padding-left: 8px; + } + + #sidebar-switcher-target{ + -moz-box-pack: start !important; + } + + #sidebar-header, + #sidebar{ + transition: min-width 115ms linear var(--uc-autohide-sidebar-delay) !important; + min-width: var(--uc-sidebar-width) !important; + will-change: min-width; + } + #sidebar-box:hover > #sidebar-header, + #sidebar-box:hover > #sidebar{ + min-width: var(--uc-sidebar-hover-width) !important; + transition-delay: 0ms !important; + } + + .sidebar-panel{ + background-color: transparent !important; + color: var(--newtab-text-primary-color) !important; + } + + .sidebar-panel #search-box{ + -moz-appearance: none !important; + background-color: rgba(249,249,250,0.1) !important; + color: inherit !important; + } + ''; }; } diff --git a/modules/home-manager/alacritty.nix b/modules/home-manager/alacritty.nix index 7e39710..f5219ad 100644 --- a/modules/home-manager/alacritty.nix +++ b/modules/home-manager/alacritty.nix @@ -25,6 +25,7 @@ in window = { resize_increments = true; dynamic_padding = true; + decorations = "none"; }; }; };