From 72cbaf459cfbc37f551bb0218cf6086105eb0da0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 11 Aug 2024 13:24:41 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 143 ++++++++++++++++++++++++++++----------- accounts/gkleen@sif/hyprland.nix | 34 ++++++++-- 2 files changed, 132 insertions(+), 45 deletions(-) (limited to 'accounts/gkleen@sif') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 5c90808c..09d0f4fa 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -76,6 +76,14 @@ let }) ]; }; + + nvidiaOffloadScript = pkgs.writeShellScriptBin "nvidia-offload" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec -a "$1" "$@" + ''; in { imports = with flake.nixosModules.userProfiles.${userName}; [ mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) @@ -279,46 +287,98 @@ in { enable = true; target = "hyprland-session.target"; }; - settings.mainBar = { - layer = "top"; - position = "top"; - height = 14; - output = [ "eDP-1" ]; - modules-left = [ "hyprland/workspaces" ]; - modules-center = [ "hyprland/window" ]; - modules-right = [ "clock" "tray" "battery" ]; - - clock = { - interval = 1; - timezone = "Europe/Berlin"; - format = "W{:%V-%u %F %H:%M:%S%Ez}"; - tooltip-format = "{calendar}"; - calendar = { - mode = "year"; - mode-mon-col = 3; - week-pos = "right"; - on-scroll = 1; - format = { - months = "{}"; - days = "{}"; - weeks = "W{}"; - weekdays = "{}"; - today = "{}"; - }; - }; + settings = let + windowRewrites = { + "(.*) — Mozilla Firefox" = "$1"; + "(.*) - mpv" = "$1"; }; - battery = { - format = "{icon}"; - format-icons = ["" "" "" "" ""]; - tooltip-format = "{capacity}% {timeTo}"; - }; - icon = { - icon-size = 12; - show-passive-items = true; - spacing = 2; - }; - }; + iconSize = 14; + in [ + { + layer = "top"; + position = "top"; + height = 14; + output = "eDP-1"; + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "privacy" "clock" "tray" "battery" ]; + + "hyprland/workspaces" = { + all-outputs = true; + }; + "hyprland/window" = { + separate-outputs = true; + icon = true; + icon-size = iconSize; + rewrite = windowRewrites; + }; + clock = { + interval = 1; + timezone = "Europe/Berlin"; + format = "W{:%V-%u %F %H:%M:%S%Ez}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "left"; + on-scroll = 1; + format = { + months = "{}"; + days = "{}"; + weeks = "{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + battery = { + format = "{icon}"; + format-icons = ["" "" "" "" ""]; + tooltip-format = "{capacity}% {timeTo}"; + }; + tray = { + icon-size = iconSize; + # show-passive-items = true; + spacing = 2; + }; + privacy = { + icon-spacing = 2; + icon-size = iconSize; + modules = [ { type = "screenshare"; } { type = "audio-in"; } ]; + }; + } + { + layer = "top"; + position = "top"; + height = 14; + output = "!eDP-1"; + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "clock" ]; + + "hyprland/workspaces" = { + all-outputs = false; + }; + "hyprland/window" = { + separate-outputs = true; + icon = true; + icon-size = iconSize; + rewrite = windowRewrites; + }; + clock = { + interval = 1; + timezone = "Europe/Berlin"; + format = "{:%H:%M}"; + tooltip-format = "W{:%V-%u %F %H:%M:%S%Ez}"; + }; + } + ]; style = '' + @define-color white #dddddd; + @define-color blue #1a8fff; + @define-color green #23fd00; + @define-color red #f2201f; + * { border: none; font-family: "Fira Sans"; @@ -328,7 +388,7 @@ in { window#waybar { background-color: rgba(0, 0, 0, 0.5); - color: #ffffff; + color: @white; } label.module { @@ -344,6 +404,9 @@ in { #workspaces button.urgent { color: @red; } + #workspaces button.empty { + opacity: 0.5; + } ''; }; wpaperd = { @@ -591,7 +654,7 @@ in { matrix-synapse-tools.synadm wrappedRocketChatDesktop flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs sieve-connect gimp inkscape udiskie glab scrot nitrokey-app - pynitrokey gtklock wlrctl + pynitrokey gtklock wlrctl nvidiaOffloadScript ]; file = { diff --git a/accounts/gkleen@sif/hyprland.nix b/accounts/gkleen@sif/hyprland.nix index 9b20f89e..927e1639 100644 --- a/accounts/gkleen@sif/hyprland.nix +++ b/accounts/gkleen@sif/hyprland.nix @@ -53,6 +53,9 @@ passes = 1; vibrancy = 0.1696; + + special = true; + popups = true; }; }; @@ -122,11 +125,11 @@ "$mainMod" = "SUPER"; bind = [ - "$mainMod, Q, exec, $terminal" - "$mainMod, C, killactive" + "$mainMod, return, exec, $terminal" + "$mainMod, Q, killactive" "$mainMod, M, exit" "$mainMod, V, togglefloating" - "$mainMod, R, exec, $menu" + "$mainMod, D, exec, $menu" "$mainMod, P, pseudo," "$mainMod, J, togglesplit," @@ -145,7 +148,15 @@ "$mainMod, T, cyclenext" - "$mainMod SHIFT, N, movecurrentworkspacetomonitor, +1" + "$mainMod, G, focusmonitor, 0" + "$mainMod, C, focusmonitor, 1" + "$mainMod, R, focusmonitor, 2" + "$mainMod, L, focusmonitor, 3" + + "$mainMod CTRL, G, movecurrentworkspacetomonitor, 0" + "$mainMod CTRL, C, movecurrentworkspacetomonitor, 1" + "$mainMod CTRL, R, movecurrentworkspacetomonitor, 2" + "$mainMod CTRL, L, movecurrentworkspacetomonitor, 3" "$mainMod, F, fullscreen, 1" "$mainMod SHIFT, F, fullscreen, 0" @@ -207,9 +218,17 @@ windowrulev2 = [ "suppressevent maximize, class:.*" - "maximize, class:^(Element|thunderbird)$" + + # "maximize, class:^(Element|thunderbird)$" "workspace special:keepass, class:^org\.keepassxc\.KeePassXC$" # "group set always lock invade, class:^Element$" + "workspace 4, class:^evince$" + "workspace 10, class:^mpv$" + "unset, class:^org\.keepassxc\.KeePassXC$, title:^KeePassXC - Access Request$" + "float, class:^org\.keepassxc\.KeePassXC$, title:^KeePassXC - Access Request$" + "center, class:^org\.keepassxc\.KeePassXC$, title:^KeePassXC - Access Request$" + + "bordercolor rgba(ffee33ee) rgba(ff9500ee) 45deg, fullscreen:1" ]; workspace = [ @@ -221,6 +240,11 @@ "special:easyeffects, on-created-empty:easyeffects" "special:blueman, on-created-empty:blueman-manager" "special:keepass, on-created-empty:keepassxc" + + "1, defaultName:comm" + "2, defaultName:web" + "3, defaultName:work" + "4, defaultName:read" ]; layerrule = [ -- cgit v1.2.3