diff --git a/flake-modules/colors.json b/flake-modules/colors.json index a9f5b35..83cd7ef 100644 --- a/flake-modules/colors.json +++ b/flake-modules/colors.json @@ -27,15 +27,15 @@ }, "NxNORTH": { "base": { - "foreground": "#e7ccfe", - "background": "#0d0019" + "foreground": "#e5e5e5", + "background": "#0c0c0c" }, "to_alter": { - "accent": "#9f35fc", - "secondary": "#324cff", - "tertiary": "#4a62e7", - "special": "#91fc34", - "weird": "#fc344f" + "accent": "#999999", + "secondary": "#dddddd", + "tertiary": "#999999", + "special": "#999999", + "weird": "#999999" } }, "NxDCS": { diff --git a/home-modules/bar/caldav-event.nix b/home-modules/bar/caldav-event.nix index aea4782..097fc05 100644 --- a/home-modules/bar/caldav-event.nix +++ b/home-modules/bar/caldav-event.nix @@ -7,10 +7,9 @@ libraries = with pkgs.python3Packages; [ caldav ics pytz ]; flakeIgnore = [ "E302" "E305" "E501" "E261" ]; } /* python */ '' -import os import json from caldav import DAVClient -from datetime import datetime, timezone +from datetime import datetime, timezone, timedelta from ics import Calendar from pytz import UTC @@ -33,13 +32,15 @@ def datetime_parser(dct): return dct def load_cache(cache_file): - if os.path.exists(cache_file): + try: with open(cache_file, "r") as file: return json.load(file, object_hook=datetime_parser) - return None + except (json.JSONDecodeError, FileNotFoundError): + return None def save_cache(cache_file, data): with open(cache_file, "w") as file: + data['last_checked'] = datetime.now(timezone.utc) json.dump(data, file, default=datetime_converter, indent=4) @@ -83,6 +84,11 @@ def is_expired(event_dict: dict): event_end = event_dict['event_end'].timestamp() return not (now <= event_end) +def is_too_old(event_dict: dict) -> bool: + last_checked = event_dict['last_checked'] + now = datetime.now(timezone.utc) + return now - last_checked >= timedelta(minutes=10) + if __name__ == "__main__": password_file = "${config.sops.secrets."nx2site/radicale/password".path}" # Path to password file cache_file = "/tmp/caldav_event_cache.json" # Path to cache file @@ -93,7 +99,7 @@ if __name__ == "__main__": event_dict = load_cache(cache_file) - if (event_dict is None) or (is_expired(event_dict)): + if (event_dict is None) or is_expired(event_dict) or is_too_old(event_dict): event_dict = get_ongoing_or_next_event(url, username, password) save_cache(cache_file, event_dict) diff --git a/home-modules/firefox/userContent.nix b/home-modules/firefox/userContent.nix index 75d7005..e72d84c 100644 --- a/home-modules/firefox/userContent.nix +++ b/home-modules/firefox/userContent.nix @@ -130,6 +130,16 @@ in /* css */ '' border-radius: ${builtins.toString rice.rounding}px; } } + @-moz-document domain(notebooklm.google.com) { + body, html, notebook, omnibar { + background-color: transparent !important; + } + header, footer, .studio-panel, .chat-panel, .source-panel { + background-color: rgba(0,0,0,0.5) !important; + backdrop-filter: blur(100px); + border-radius: ${builtins.toString rice.rounding}px; + } + } @-moz-document domain(moodle.informatik.tu-darmstadt.de) { body, html , .main-inner, .main-inner * { diff --git a/home-modules/helix.nix b/home-modules/helix.nix index f12cb44..18f2a6e 100644 --- a/home-modules/helix.nix +++ b/home-modules/helix.nix @@ -190,7 +190,7 @@ keys = { normal = { "C-g" = [ ":new" ":insert-output lazygit" ":buffer-close!" ":redraw" ]; - "C-i" = [ ":pipe fgl" "toggle_comments" ]; + "C-m" = [ ":pipe fgl" "toggle_comments" ]; "A-`" = [ "no_op" ]; "`" = [ "no_op" ]; "รถ" = { "s" = [ "switch_case" ]; "u" = [ "switch_to_uppercase" ]; "l" = [ "switch_to_lowercase" ]; }; @@ -215,12 +215,30 @@ language-servers = [ "tinymist" ]; # language-servers = [ "language-tool" "tinymist" ]; } + { + name = "typst-with-language-tool"; + scope = ""; + language-servers = [ "language-tool" "tinymist" ]; + injection-regex = ""; + file-types = [""]; + comment-tokens = "//"; + indent = { tab-width = 2; unit = " "; }; + } { name = "markdown"; - language-servers = [ "language-tool" "marksman" ]; + language-servers = [ "marksman" ]; file-types = [ "md" "MD" ]; scope = "text."; } + { + name = "markdown-with-language-tool"; + language-servers = [ "language-tool" "marksman" ]; + scope = "text."; + injection-regex = ""; + file-types = [""]; + # blcok-comment-tokens = { start = ""; }; + indent = { tab-width = 2; unit = " "; }; + } { name = "python"; language-servers = [ "pyright" "ruff" ]; diff --git a/home-modules/hyprland.nix b/home-modules/hyprland.nix index 1bc6df2..bc4b727 100644 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland.nix @@ -19,15 +19,16 @@ }; in { home.packages = with pkgs; [ - xdg-desktop-portal-hyprland + grim + hyprcursor + hypridle hyprland-protocols hyprlock - hypridle - hyprshot hyprpicker - hyprcursor - grim + hyprshade + hyprshot slurp + xdg-desktop-portal-hyprland ]; @@ -290,7 +291,7 @@ in { "center, title:^(terminal-file-picker)$" "size 80% 80%, title:^(terminal-file-picker)$" - "size 30% 30%, initialTitle:^(Select Calendar)$" + # "size 30% 30%, initialTitle:^(Select Calendar)$" ]; @@ -425,6 +426,8 @@ in { # "SUPER, B, exec, bitwarden" "SUPER, N, togglesplit" # "SUPER, M, exec, /home/nx2/scripts/meme-full-screen/meme-full-screen.sh " + ''SUPER, M, exec, sh -c "hyprshade on $(find ${hyper.home}/.config/hypr/shaders -type f | sed -E 's-.*shaders/(.+)\.glsl-\1-g' | rofi -dmenu)"'' + "SUPER Shift, M, exec, hyprshade off" # "SUPER, comma, exec, /home/nx2/scripts/change-language.sh" "SUPER, ., exec, echo key x:Prior | dotool" "SUPER, -, exec, echo key x:Next | dotool" diff --git a/home-modules/pkgs-list/shell.nix b/home-modules/pkgs-list/shell.nix index 0879b87..823e6dc 100644 --- a/home-modules/pkgs-list/shell.nix +++ b/home-modules/pkgs-list/shell.nix @@ -25,6 +25,7 @@ neofetch pastel pdfgrep + pdftk pipes pv reflex diff --git a/home-modules/yazi.nix b/home-modules/yazi.nix index 7023d90..e81f48c 100644 --- a/home-modules/yazi.nix +++ b/home-modules/yazi.nix @@ -1,5 +1,5 @@ { pkgs, ... }@all: with all; let - nox-var = (pkgs.pkgs-version != "24.05"); + not-nod = (pkgs.pkgs-version != "24.05"); tfc = pkgs.unstable.xdg-desktop-portal-termfilechooser; in { home.packages = [ @@ -68,7 +68,8 @@ in { # Operation { on = "o"; run = "open"; desc = "Open selected files"; } { on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; } - { on = ""; run = "open"; desc = "Open selected files"; } + { on = ""; run = "plugin smart-enter"; desc = "Open selected files"; } + # { on = ""; run = "open"; desc = "Open selected files"; } { on = ""; run = "open --interactive"; desc = "Open selected files interactively"; } { on = "y"; run = [ ''shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list'' "yank" ]; desc = "Yank selected files (copy)"; } { on = "y"; run = "yank"; desc = "Yank selected files (copy)"; } @@ -442,7 +443,7 @@ in { ]; }; }; - } // (if nox-var then { + } // (if not-nod then { shellWrapperName = "ya"; initLua = /* lua */ '' require("zoxide"):setup { @@ -469,8 +470,8 @@ in { return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue") end, 500, Header.LEFT) ''; - plugins = with pkgs; { - inherit glow git; + plugins = { inherit (pkgs.yaziPlugins) + glow git smart-enter; }; } else {}); diff --git a/system-modules/boot.nix b/system-modules/boot.nix index 985d9f2..719de76 100644 --- a/system-modules/boot.nix +++ b/system-modules/boot.nix @@ -9,8 +9,10 @@ device-boot = if hyper.host == "NxNORTH" then { kernelPackages = pkgs.linuxPackages_zen; kernelParams = [ - "fbcon=margin:1" + # "fbcon=margin:1" "fbcon=nodefer" + "video=DP-4:2560x1440@60" + # "video=HDMI-A-3:d" ]; lanzaboote = { enable = true; @@ -66,5 +68,23 @@ in { config = { environment.systemPackages = with pkgs; lib.mkIf ( host == "NxNORTH" ) [ sbctl ]; boot = { tmp.useTmpfs = false; } // device-boot; + # thx fxzzi + # sh*tty nvidia makes the tty on my 1440p monitor 1080p + # so just resize it to 1440p + systemd.services.fbset = lib.mkIf (hyper.host == "NxNORTH") { + enable = true; + wantedBy = ["multi-user.target"]; + unitConfig = { + Description = "Set framebuffer resolution"; + Before = "display-manager.service"; + }; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${lib.getExe pkgs.fbset} -xres 2560 -yres 1440 -match --all"; + RemainAfterExit = "yes"; + StandardOutput = "journal"; + StandardError = "journal"; + }; + }; }; }