From cf2108ad8209749922ebe367702f4468233edbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Sat, 6 Jun 2026 13:11:00 +0200 Subject: [PATCH] update system --- hosts/aero/home.nix | 28 ++- hosts/shark/home.nix | 2 +- .../desktops/hyprland/default.nix | 118 +++++---- modules/home-manager/programs/neovide.nix | 4 +- modules/home-manager/theme/hyprland.conf | 20 -- modules/home-manager/theme/hyprland.lua | 50 ++++ modules/home-manager/theme/md3-evo.nix | 237 ++++++++---------- modules/nixos/desktops/hyprland.nix | 2 +- modules/nixos/hardware/fv43u.nix | 174 ++++++------- modules/nixos/hardware/nvidia-proprietary.nix | 2 +- modules/nixos/shell/firefox-pip.nix | 10 +- modules/nixos/shell/flameshot.nix | 4 +- modules/nixos/shell/gnome-keyring.nix | 4 +- modules/nixos/shell/grimblast.nix | 7 +- modules/nixos/shell/hyprpicker.nix | 7 +- modules/nixos/shell/kitty.nix | 7 +- modules/nixos/shell/walker.nix | 10 +- 17 files changed, 361 insertions(+), 325 deletions(-) delete mode 100644 modules/home-manager/theme/hyprland.conf create mode 100644 modules/home-manager/theme/hyprland.lua diff --git a/hosts/aero/home.nix b/hosts/aero/home.nix index f72391e..a9bcc4f 100755 --- a/hosts/aero/home.nix +++ b/hosts/aero/home.nix @@ -16,15 +16,28 @@ ]; }; wayland.windowManager.hyprland.settings = { - general.layout = "master"; - master = { - orientation = "right"; - mfact = 0.65; - always_keep_position = true; + config = { + general.layout = "master"; + master = { + orientation = "right"; + mfact = 0.65; + always_keep_position = true; + }; + input.kb_options = [ "lv3:caps_switch" ]; }; monitor = [ - "eDP-1,3840x2160@60,0x0,2" - "HDMI-A-4,2560x1440@75,1920x-768,1" + { + output = "eDP-1"; + mode = "3840x2160@60"; + position = "0x0"; + scale = 2; + } + { + output = "HDMI-A-4"; + mode = "2560x1440@75"; + position = "1920x-768"; + scale = 1; + } ]; }; systemd.user.services = { @@ -52,6 +65,5 @@ }; }; - wayland.windowManager.hyprland.settings.input.kb_options = [ "lv3:caps_switch" ]; services.nextcloud-client.enable = true; } diff --git a/hosts/shark/home.nix b/hosts/shark/home.nix index 3ef50cf..4fc142a 100755 --- a/hosts/shark/home.nix +++ b/hosts/shark/home.nix @@ -17,7 +17,7 @@ gamma-launcher ]; }; - wayland.windowManager.hyprland.settings.input.kb_options = [ "lv3:caps_switch" ]; + wayland.windowManager.hyprland.settings.config.input.kb_options = [ "lv3:caps_switch" ]; services.nextcloud-client.enable = true; systemd.user.services = { nm-applet = { diff --git a/modules/home-manager/desktops/hyprland/default.nix b/modules/home-manager/desktops/hyprland/default.nix index dbc00fe..4df21a9 100644 --- a/modules/home-manager/desktops/hyprland/default.nix +++ b/modules/home-manager/desktops/hyprland/default.nix @@ -14,77 +14,97 @@ let ''; }; cfg = osConfig.desktops.hyprland; + bind = bind: action: { + _args = [ + bind + (lib.generators.mkLuaInline action) + ]; + }; + bindm = bind: action: { + _args = [ + bind + (lib.generators.mkLuaInline action) + { mouse = true; } + ]; + }; in { config = lib.mkIf cfg.enable { wayland.windowManager.hyprland = { enable = true; + configType = "lua"; settings = { - general = { - allow_tearing = true; - layout = lib.mkIf cfg.scrolling "scrolling"; - }; - input = { - accel_profile = "flat"; - kb_layout = osConfig.services.xserver.xkb.layout; - kb_variant = osConfig.services.xserver.xkb.variant; + config = { + general = { + allow_tearing = true; + layout = lib.mkIf cfg.scrolling "scrolling"; + }; + input = { + accel_profile = "flat"; + kb_layout = osConfig.services.xserver.xkb.layout; + kb_variant = osConfig.services.xserver.xkb.variant; + touchpad.natural_scroll = true; + }; + misc = { + layers_hog_keyboard_focus = false; + disable_hyprland_logo = true; + disable_splash_rendering = true; + vrr = lib.mkDefault 2; + enable_swallow = true; + swallow_regex = "^kitty$"; + }; + binds.scroll_event_delay = 0; + decoration.border_part_of_window = false; }; bind = [ - "SUPER,C,killactive" - "SUPER,P,togglefloating," - "SUPER,P,pin," - "SUPER,D,fullscreen,1" - "SUPER,V,fullscreen,0" + (bind "SUPER + C" "hl.dsp.window.close()") + (bind "SUPER + P" '' + function() + hl.dsp.window.float() + hl.dsp.window.pin() + end + '') + (bind "SUPER + D" "hl.dsp.window.fullscreen({ mode = 'maximized' })") + (bind "SUPER + V" "hl.dsp.window.fullscreen({ mode = 'fullscreen' })") - "SUPER,f,workspace,r-1" - "SUPER,h,workspace,r+1" - "SUPER_SHIFT,f,movetoworkspace,r-1" - "SUPER_SHIFT,h,movetoworkspace,r+1" + (bind "SUPER + F" "hl.dsp.focus({ workspace = 'r-1' })") + (bind "SUPER + H" "hl.dsp.focus({ workspace = 'r+1' })") + (bind "SUPER + SHIFT + F" "hl.dsp.window.move({ workspace = 'r-1' })") + (bind "SUPER + SHIFT + H" "hl.dsp.window.move({ workspace = 'r+1' })") + + (bindm "SUPER + mouse:272" "hl.dsp.window.drag()") + (bindm "SUPER + mouse:273" "hl.dsp.window.resize()") ] ++ ( if cfg.scrolling then [ - "SUPER,up,layoutmsg,focus u" - "SUPER,down,layoutmsg,focus d" - "SUPER,right,layoutmsg,focus r" - "SUPER,left,layoutmsg,focus l" + (bind "SUPER + SHIFT + LEFT" "hl.dsp.layout('swapcol l')") + (bind "SUPER + SHIFT + RIGHT" "hl.dsp.layout('swapcol r')") - "SUPER_SHIFT,up,layoutmsg,movewindowto u" - "SUPER_SHIFT,down,layoutmsg,movewindowto d" - "SUPER_SHIFT,left,layoutmsg,swapcol l" - "SUPER_SHIFT,right,layoutmsg,swapcol r" + (bind "SUPER + UP" "hl.dsp.layout('focus u')") + (bind "SUPER + DOWN" "hl.dsp.layout('focus d')") + (bind "SUPER + LEFT" "hl.dsp.layout('focus l')") + (bind "SUPER + RIGHT" "hl.dsp.layout('focus r')") - "SUPER,mouse_up,layoutmsg,focus r" - "SUPER,mouse_down,layoutmsg,focus l" + (bind "SUPER + mouse_up" "hl.dsp.layout('focus r')") + (bind "SUPER + mouse_down" "hl.dsp.layout('focus l')") ] else [ - "SUPER_SHIFT,up,movewindow,u" - "SUPER_SHIFT,down,movewindow,d" - "SUPER_SHIFT,left,movewindow,l" - "SUPER_SHIFT,right,movewindow,r" + (bind "SUPER + SHIFT + UP" "hl.dsp.window.move({ direction = 'up' })") + (bind "SUPER + SHIFT + DOWN" "hl.dsp.window.move({ direction = 'down' })") + (bind "SUPER + SHIFT + LEFT" "hl.dsp.window.move({ direction = 'left' })") + (bind "SUPER + SHIFT + RIGHT" "hl.dsp.window.move({ direction = 'right' })") - "SUPER,up,movefocus,u" - "SUPER,down,movefocus,d" - "SUPER,left,movefocus,l" - "SUPER,right,movefocus,r" + (bind "SUPER + UP" "hl.dsp.focus({ direction = 'up' })") + (bind "SUPER + DOWN" "hl.dsp.focus({ direction = 'down' })") + (bind "SUPER + LEFT" "hl.dsp.focus({ direction = 'left' })") + (bind "SUPER + RIGHT" "hl.dsp.focus({ direction = 'right' })") - "SUPER,mouse_up,workspace,r+1" - "SUPER,mouse_down,workspace,r-1" + (bind "SUPER + mouse_up" "hl.dsp.focus({ workspace = 'r-1' })") + (bind "SUPER + mouse_down" "hl.dsp.focus({ workspace = 'r+1' })") ] ); - bindm = [ - "SUPER,mouse:272,movewindow" - "SUPER,mouse:273,resizewindow" - ]; - misc = { - layers_hog_keyboard_focus = false; - disable_hyprland_logo = true; - disable_splash_rendering = true; - vrr = lib.mkDefault 2; - }; - decoration.border_part_of_window = false; - input.touchpad.natural_scroll = true; }; }; diff --git a/modules/home-manager/programs/neovide.nix b/modules/home-manager/programs/neovide.nix index b8c9a81..1c1b28b 100644 --- a/modules/home-manager/programs/neovide.nix +++ b/modules/home-manager/programs/neovide.nix @@ -29,10 +29,10 @@ ]; }; }; - wayland.windowManager.hyprland.settings.windowrule = [ + wayland.windowManager.hyprland.settings.window_rule = [ { name = "Suppress maximize for neovide"; - "match:class" = "^(neovide)$"; + match.class = "^(neovide)$"; suppress_event = "maximize"; } ]; diff --git a/modules/home-manager/theme/hyprland.conf b/modules/home-manager/theme/hyprland.conf deleted file mode 100644 index eababef..0000000 --- a/modules/home-manager/theme/hyprland.conf +++ /dev/null @@ -1,20 +0,0 @@ -general { - col.inactive_border = 0x00000000 - col.active_border = 0x00000000 - # col.inactive_border = rgba({{colors.surface.default.hex_stripped}}{{custom.transparency_hex | to_lower}}) - # col.active_border = rgb({{colors.primary.default.hex_stripped}}) - border_size = 0 - extend_border_grab_area = 4 - gaps_in = {{custom.padding}} - gaps_out = {{custom.double_padding}} -} - -decoration { - rounding = {{custom.radius}} - - blur { - size = {{custom.blur}} - passes = 3 - popups = true - } -} diff --git a/modules/home-manager/theme/hyprland.lua b/modules/home-manager/theme/hyprland.lua new file mode 100644 index 0000000..a86c4d3 --- /dev/null +++ b/modules/home-manager/theme/hyprland.lua @@ -0,0 +1,50 @@ +hl.config({ + general = { + col = { + inactive_border = "rgba(00000000)", + active_border = "rgba(00000000)", + }, + border_size = 0, + extend_border_grab_area = 4, + -- stylua: ignore + gaps_in = {{custom.padding}}, + -- stylua: ignore + gaps_out = {{custom.double_padding}}, + }, + decoration = { + -- stylua: ignore + rounding = {{custom.radius}}, + blur = { + -- stylua: ignore + size = {{custom.blur}}, + passes = 3, + popups = true, + }, + inactive_opacity = 0.8, + shadow = { + enabled = true, + range = 32, + render_power = 8, + color = "rgba(000000aa)", + color_inactive = "rgba(00000011)", + }, + }, + animations = { + enabled = true, + }, +}) + +hl.curve("default", { type = "spring", mass = 1, stiffness = 90, dampening = 30 }) +hl.curve("linear", { type = "bezier", points = { { 0.5, 0.5 }, { 0.5, 0.5 } } }) + +hl.animation({ leaf = "windows", enabled = true, speed = 1, spring = "default", style = "slide" }) +hl.animation({ leaf = "windowsIn", enabled = true, speed = 1, spring = "default", style = "slide bottom" }) +hl.animation({ leaf = "windowsOut", enabled = true, speed = 1, spring = "default", style = "slide bottom" }) + +hl.animation({ leaf = "border", enabled = true, speed = 1, spring = "default" }) + +hl.animation({ leaf = "fade", enabled = true, speed = 3, bezier = "linear" }) +hl.animation({ leaf = "fadeShadow", enabled = true, speed = 4, bezier = "linear" }) +hl.animation({ leaf = "fadeDim", enabled = true, speed = 4, bezier = "linear" }) + +hl.animation({ leaf = "workspaces", enabled = true, speed = 1, spring = "default" }) diff --git a/modules/home-manager/theme/md3-evo.nix b/modules/home-manager/theme/md3-evo.nix index 495a30c..5a41575 100644 --- a/modules/home-manager/theme/md3-evo.nix +++ b/modules/home-manager/theme/md3-evo.nix @@ -189,104 +189,106 @@ in pkgs.zenity pkgs.sunwait ]; - text = '' - WALLPAPER=${config.xdg.configHome}/matugen/wallpaper - STATE=${config.xdg.stateHome}/md3-evo + text = + # sh + '' + WALLPAPER=${config.xdg.configHome}/matugen/wallpaper + STATE=${config.xdg.stateHome}/md3-evo - SCHEME=$(dconf read /org/gnome/desktop/interface/color-scheme) - if [ "$SCHEME" = "'prefer-light'" ]; then - MODE="light" - else - MODE="dark" - fi - - if [ ! -d "$STATE" ]; then - mkdir -p "$STATE" - fi - if [ -f "$STATE/mode" ]; then - MODE=$(cat "$STATE/mode") - fi - - if [ $# -eq 0 ]; then - echo -e "\033[1mUsage:\033[0m mode|light|dark|auto|toggle|wallpaper" - exit 1 - elif [ "$1" = "mode" ]; then - echo -e "$MODE" - exit 0 - elif [ "$1" = "wallpaper" ]; then - if [ $# -eq 1 ]; then - PICKED=$(zenity --file-selection --file-filter='Images | *.png *.jpg *.jpeg *.svg *.bmp *.gif') - cp "$PICKED" "$WALLPAPER" + SCHEME=$(dconf read /org/gnome/desktop/interface/color-scheme) + if [ "$SCHEME" = "'prefer-light'" ]; then + MODE="light" else - cp "$2" "$WALLPAPER" + MODE="dark" fi - elif [ "$1" = "toggle" ]; then + + if [ ! -d "$STATE" ]; then + mkdir -p "$STATE" + fi + if [ -f "$STATE/mode" ]; then + MODE=$(cat "$STATE/mode") + fi + + if [ $# -eq 0 ]; then + echo -e "\033[1mUsage:\033[0m mode|light|dark|auto|toggle|wallpaper" + exit 1 + elif [ "$1" = "mode" ]; then + echo -e "$MODE" + exit 0 + elif [ "$1" = "wallpaper" ]; then + if [ $# -eq 1 ]; then + PICKED=$(zenity --file-selection --file-filter='Images | *.png *.jpg *.jpeg *.svg *.bmp *.gif') + cp "$PICKED" "$WALLPAPER" + else + cp "$2" "$WALLPAPER" + fi + elif [ "$1" = "toggle" ]; then + if [ "$MODE" = "light" ]; then + MODE="dark" + else + MODE="light" + fi + echo "$MODE" > "$STATE/mode" + elif [ "$1" = "light" ] || [ "$1" = "dark" ] || [ "$1" == "auto" ]; then + MODE="$1" + echo "$MODE" > "$STATE/mode" + elif [ "$1" = "init" ]; then + echo -e "\033[1mSetting up matugen\033[0m" + else + echo -e "\033[31mInvalid argument\033[0m" + exit 1 + fi + + if [ ! -f $WALLPAPER ]; then + echo -e "\033[31,1mNo wallpaper set\033[0m" + exit 1 + fi + + THEME_SERVICE_PATH="${config.xdg.configHome}/systemd/user/theme-init.timer" + if [ "$MODE" = "auto" ]; then + TIME=$(sunwait poll ${builtins.toString cfg.auto-dark.lat}N ${builtins.toString cfg.auto-dark.lon}E || :) + if [ "$TIME" = "DAY" ]; then + MODE="light" + NEXT=6 + else + MODE="dark" + NEXT=4 + fi + NEXT=$(sunwait report ${builtins.toString cfg.auto-dark.lat}N ${builtins.toString cfg.auto-dark.lon}E | awk "/Daylight:/ {print \$$NEXT}") + cat < /dev/null + [Unit] + Description=Next theme change timer + + [Timer] + OnCalendar=*-*-* $(date -d "$NEXT today + 5 minutes" +'%H:%M'):00 + AccuracySec=1min + + [Install] + WantedBy=timers.target + EOF + else + rm -f "$THEME_SERVICE_PATH" + fi + systemctl --user daemon-reload &> /dev/null || : + systemctl --user restart theme-init.timer &> /dev/null || : + + if command -v niri &> /dev/null; then + niri msg action do-screen-transition --delay-ms 500 + fi + if [ "$MODE" = "light" ]; then - MODE="dark" + GTK_THEME="adw-gtk3" else - MODE="light" + GTK_THEME="adw-gtk3-dark" fi - echo "$MODE" > "$STATE/mode" - elif [ "$1" = "light" ] || [ "$1" = "dark" ] || [ "$1" == "auto" ]; then - MODE="$1" - echo "$MODE" > "$STATE/mode" - elif [ "$1" = "init" ]; then - echo -e "\033[1mSetting up matugen\033[0m" - else - echo -e "\033[31mInvalid argument\033[0m" - exit 1 - fi - if [ ! -f $WALLPAPER ]; then - echo -e "\033[31,1mNo wallpaper set\033[0m" - exit 1 - fi + matugen image "$WALLPAPER" --type scheme-${cfg.flavour} --contrast ${builtins.toString cfg.contrast} --mode "$MODE" + awww img "$WALLPAPER" - THEME_SERVICE_PATH="${config.xdg.configHome}/systemd/user/theme-init.timer" - if [ "$MODE" = "auto" ]; then - TIME=$(sunwait poll ${builtins.toString cfg.auto-dark.lat}N ${builtins.toString cfg.auto-dark.lon}E || :) - if [ "$TIME" = "DAY" ]; then - MODE="light" - NEXT=6 - else - MODE="dark" - NEXT=4 - fi - NEXT=$(sunwait report ${builtins.toString cfg.auto-dark.lat}N ${builtins.toString cfg.auto-dark.lon}E | awk "/Daylight:/ {print \$$NEXT}") - cat < /dev/null - [Unit] - Description=Next theme change timer - - [Timer] - OnCalendar=*-*-* $(date -d "$NEXT today + 5 minutes" +'%H:%M'):00 - AccuracySec=1min - - [Install] - WantedBy=timers.target - EOF - else - rm -f "$THEME_SERVICE_PATH" - fi - systemctl --user daemon-reload &> /dev/null || : - systemctl --user restart theme-init.timer &> /dev/null || : - - if command -v niri &> /dev/null; then - niri msg action do-screen-transition --delay-ms 500 - fi - - if [ "$MODE" = "light" ]; then - GTK_THEME="adw-gtk3" - else - GTK_THEME="adw-gtk3-dark" - fi - - matugen image "$WALLPAPER" --type scheme-${cfg.flavour} --contrast ${builtins.toString cfg.contrast} --mode "$MODE" - awww img "$WALLPAPER" - - dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'" - dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'" - dconf write /org/gnome/desktop/interface/icon-theme "'Adwaita'" - ''; + dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'" + dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'" + dconf write /org/gnome/desktop/interface/icon-theme "'Tela'" + ''; } ); in @@ -294,6 +296,7 @@ in home.packages = [ pkgs.adw-gtk3 pkgs.awww + pkgs.tela-icon-theme theme-script ]; @@ -344,44 +347,18 @@ in }; wayland.windowManager.hyprland = { - settings = { - windowrule = [ - { - name = "floating-zenity"; - "match:class" = "^(zenity)$"; - float = true; - } - ]; - decoration = { - inactive_opacity = 0.8; - shadow = { - enabled = true; - range = 32; - render_power = 8; - color = "rgba(000000aa)"; - color_inactive = "rgba(00000011)"; - }; - }; - animations = { - enabled = "yes"; - bezier = [ - "expoOut, 0.16, 1, 0.3, 1" - ]; - animation = [ - "windowsIn, 1, 5, expoOut, slide bottom" - "windows, 1, 5, expoOut, slide" - "windowsOut, 1, 5, expoOut, slide bottom" - "border, 1, 10, default" - "fade, 1, 7, default" - "fadeShadow, 1, 10, default" - "fadeDim, 1, 10, default" - "workspaces, 1, 6, default" - ]; - }; - }; - extraConfig = '' - source=./theme.conf - ''; + settings.window_rule = [ + { + name = "floating-zenity"; + match.class = "^(zenity)$"; + float = true; + } + ]; + extraConfig = + # lua + '' + require("theme") + ''; }; # TODO: include is coming in the next release @@ -518,8 +495,8 @@ in }) // (lib.optionalAttrs osConfig.programs.hyprland.enable { hyprland = { - input_path = ./hyprland.conf; - output_path = "${config.xdg.configHome}/hypr/theme.conf"; + input_path = ./hyprland.lua; + output_path = "${config.xdg.configHome}/hypr/theme.lua"; post_hook = pkgs.writeShellScript "reload-hyprland-theme" '' if command -v hyprctl &> /dev/null; then hyprctl reload diff --git a/modules/nixos/desktops/hyprland.nix b/modules/nixos/desktops/hyprland.nix index ae30637..4e85a6a 100644 --- a/modules/nixos/desktops/hyprland.nix +++ b/modules/nixos/desktops/hyprland.nix @@ -28,7 +28,7 @@ in systemd.enable = false; package = null; portalPackage = null; - settings = { + settings.config = { ecosystem = { no_update_news = true; no_donation_nag = true; diff --git a/modules/nixos/hardware/fv43u.nix b/modules/nixos/hardware/fv43u.nix index 83f9e9f..003831f 100644 --- a/modules/nixos/hardware/fv43u.nix +++ b/modules/nixos/hardware/fv43u.nix @@ -32,120 +32,92 @@ in '') ]; - home-manager.users.${username} = - let - monitorline = "DP-3,3840x2160@144,0x0,1,bitdepth,10,cm,${if cfg.hdr then "hdr" else "srgb"}"; - in - { - programs.mpv.config = { - vo = "gpu-next"; - gpu-api = "vulkan"; - gpu-context = "waylandvk"; - target-colorspace-hint = "auto"; - }; - programs.niri.settings = { - prefer-no-csd = true; - outputs."DP-3" = { - scale = 1; - mode = { - width = 3840; - height = 2160; - refresh = 143.999; - }; - variable-refresh-rate = "on-demand"; - }; - layout.struts.top = 80; - }; - wayland.windowManager.hyprland.settings = { + home-manager.users.${username} = { + programs.mpv.config = { + vo = "gpu-next"; + gpu-api = "vulkan"; + gpu-context = "waylandvk"; + target-colorspace-hint = "auto"; + }; + wayland.windowManager.hyprland.settings = { + config = { scrolling = { column_width = 0.4; focus_fit_method = 0; fullscreen_on_one_column = false; - }; - master = { - orientation = "center"; - slave_count_for_center_master = 0; - mfact = 0.4; - allow_small_split = true; + wrap_focus = false; }; render.direct_scanout = 0; - monitorv2 = { - output = "DP-3"; - mode = "3840x2160@144"; - position = "0x0"; - scale = 1; - bitdepth = 10; - addreserved = "80,0,0,0"; - cm = if cfg.hdr then "hdredid" else "srgb"; - sdr_min_luminance = 0.25; - sdr_max_luminance = 250; - }; xwayland.force_zero_scaling = true; misc.vrr = 2; # VA suffers from VRR flicker + quirks.prefer_hdr = 1; cursor = { min_refresh_rate = 48; no_break_fs_vrr = 1; }; - # experimental.xx_color_management_v4 = true; }; - - programs.waybar.settings.mainBar = - let - tmpFile = "${config.home-manager.users.${username}.xdg.configHome}/gbmonctl-brightness"; - cmd = - if cfg.hdr then - # sh - '' - BRIGHTNESS=$(cat ${tmpFile} || echo "0") - BRIGHTNESS=$(printf "1.%02d" $((BRIGHTNESS / 2))) - hyprctl keyword monitor ${monitorline},sdrbrightness,$BRIGHTNESS - '' - else - "${pkgs.gbmonctl}/bin/gbmonctl -prop brightness -val $BRIGHTNESS"; - in - { - "custom/saturation" = { }; - "custom/brightness" = { - return-type = "json"; - exec = pkgs.writeShellScript "waybar-brightness" '' - BRIGHTNESS=$(cat ${tmpFile} || echo "0") - if [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 1)} ]; then - ICON="󰃚" - elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 2)} ]; then - ICON="󰃛" - elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 3)} ]; then - ICON="󰃜" - elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 4)} ]; then - ICON="󰃝" - elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 5)} ]; then - ICON="󰃞" - elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 6)} ]; then - ICON="󰃟" - else - ICON="󰃠" - fi - - echo "{\"text\": \"$ICON $BRIGHTNESS%\"}" - ''; - on-scroll-up = pkgs.writeShellScript "waybar-brightness-up" '' - BRIGHTNESS=$(cat ${tmpFile} || echo "0") - BRIGHTNESS=$((BRIGHTNESS + 5)) - BRIGHTNESS=$((BRIGHTNESS > 100 ? 100 : BRIGHTNESS)) - echo $BRIGHTNESS > ${tmpFile} - ${cmd} - ''; - on-scroll-down = pkgs.writeShellScript "waybar-brightness-up" '' - BRIGHTNESS=$(cat ${tmpFile} || echo "0") - BRIGHTNESS=$((BRIGHTNESS - 5)) - BRIGHTNESS=$((BRIGHTNESS < 0 ? 0 : BRIGHTNESS)) - echo $BRIGHTNESS > ${tmpFile} - ${cmd} - ''; - exec-on-event = true; - exec-if = "sleep 0.1"; - interval = "once"; - }; - }; + monitor = { + output = "DP-3"; + mode = "3840x2160@144"; + position = "0x0"; + scale = 1; + bitdepth = 10; + reserved_area.top = 80; + sdr_min_luminance = 0.25; + sdr_max_luminance = 250; + icc = toString ./fv43u.icc; + cm = "dcip3"; + }; }; + + programs.waybar.settings.mainBar = + let + tmpFile = "${config.home-manager.users.${username}.xdg.configHome}/gbmonctl-brightness"; + cmd = "${pkgs.gbmonctl}/bin/gbmonctl -prop brightness -val $BRIGHTNESS"; + in + { + "custom/saturation" = { }; + "custom/brightness" = { + return-type = "json"; + exec = pkgs.writeShellScript "waybar-brightness" '' + BRIGHTNESS=$(cat ${tmpFile} || echo "0") + if [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 1)} ]; then + ICON="󰃚" + elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 2)} ]; then + ICON="󰃛" + elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 3)} ]; then + ICON="󰃜" + elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 4)} ]; then + ICON="󰃝" + elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 5)} ]; then + ICON="󰃞" + elif [ "$BRIGHTNESS" -lt ${toString (100 / 7 * 6)} ]; then + ICON="󰃟" + else + ICON="󰃠" + fi + + echo "{\"text\": \"$ICON $BRIGHTNESS%\"}" + ''; + on-scroll-up = pkgs.writeShellScript "waybar-brightness-up" '' + BRIGHTNESS=$(cat ${tmpFile} || echo "0") + BRIGHTNESS=$((BRIGHTNESS + 5)) + BRIGHTNESS=$((BRIGHTNESS > 100 ? 100 : BRIGHTNESS)) + echo $BRIGHTNESS > ${tmpFile} + ${cmd} + ''; + on-scroll-down = pkgs.writeShellScript "waybar-brightness-up" '' + BRIGHTNESS=$(cat ${tmpFile} || echo "0") + BRIGHTNESS=$((BRIGHTNESS - 5)) + BRIGHTNESS=$((BRIGHTNESS < 0 ? 0 : BRIGHTNESS)) + echo $BRIGHTNESS > ${tmpFile} + ${cmd} + ''; + exec-on-event = true; + exec-if = "sleep 0.1"; + interval = "once"; + }; + }; + }; }; } diff --git a/modules/nixos/hardware/nvidia-proprietary.nix b/modules/nixos/hardware/nvidia-proprietary.nix index ad270bc..25f5ad3 100644 --- a/modules/nixos/hardware/nvidia-proprietary.nix +++ b/modules/nixos/hardware/nvidia-proprietary.nix @@ -52,7 +52,7 @@ in nvidiaPersistenced = false; }; - home-manager.users.${username}.wayland.windowManager.hyprland.settings = { + home-manager.users.${username}.wayland.windowManager.hyprland.settings.config = { cursor.no_hardware_cursors = true; opengl.nvidia_anti_flicker = true; # render.direct_scanout = 1; diff --git a/modules/nixos/shell/firefox-pip.nix b/modules/nixos/shell/firefox-pip.nix index d4cce22..b0e1999 100644 --- a/modules/nixos/shell/firefox-pip.nix +++ b/modules/nixos/shell/firefox-pip.nix @@ -17,11 +17,13 @@ in config = lib.mkIf cfg.enable { home-manager.users.${username} = { wayland.windowManager.hyprland.settings = { - windowrule = [ + window_rule = [ { name = "firefox-pip"; - "match:class" = "^(firefox)$"; - "match:title" = "^(Picture-in-Picture)$"; + match = { + class = "^(firefox)$"; + title = "^(Picture-in-Picture)$"; + }; float = true; no_follow_mouse = true; opaque = true; @@ -29,7 +31,7 @@ in fullscreen_state = "2 0"; move = "240 8"; keep_aspect_ratio = true; - border_size = "0"; + border_size = 0; animation = "fade"; } ]; diff --git a/modules/nixos/shell/flameshot.nix b/modules/nixos/shell/flameshot.nix index c8af2e5..c1bd069 100644 --- a/modules/nixos/shell/flameshot.nix +++ b/modules/nixos/shell/flameshot.nix @@ -21,10 +21,10 @@ in bind = [ "SUPER_SHIFT,V,exec,XDG_CURRENT_DESKTOP=sway uwsm app -- flameshot gui --clipboard" ]; - windowrule = [ + window_rule = [ { name = "Flameshot"; - "match:class" = "^(flameshot)$"; + match.class = "^(flameshot)$"; animation = "fade"; float = true; } diff --git a/modules/nixos/shell/gnome-keyring.nix b/modules/nixos/shell/gnome-keyring.nix index d2f8aa1..045efee 100644 --- a/modules/nixos/shell/gnome-keyring.nix +++ b/modules/nixos/shell/gnome-keyring.nix @@ -16,10 +16,10 @@ in config = lib.mkIf cfg.enable { home-manager.users.${username} = { - wayland.windowManager.hyprland.settings.windowrule = [ + wayland.windowManager.hyprland.settings.window_rule = [ { name = "Gnome Keyring"; - "match:class" = "^(gcr-prompter)$"; + match.class = "^(gcr-prompter)$"; border_size = 0; rounding = 10; animation = "slide"; diff --git a/modules/nixos/shell/grimblast.nix b/modules/nixos/shell/grimblast.nix index aceda89..88e1752 100644 --- a/modules/nixos/shell/grimblast.nix +++ b/modules/nixos/shell/grimblast.nix @@ -19,7 +19,12 @@ in wayland.windowManager.hyprland = { settings = { bind = [ - "SUPER_SHIFT,V,exec,uwsm app -- ${lib.getExe pkgs.grimblast} --freeze copy area" + { + _args = [ + "SUPER + SHIFT + V" + (lib.generators.mkLuaInline "hl.dsp.exec_cmd('uwsm app -- ${lib.getExe pkgs.grimblast} --freeze copy area')") + ]; + } ]; }; }; diff --git a/modules/nixos/shell/hyprpicker.nix b/modules/nixos/shell/hyprpicker.nix index 81cd4fc..18a15a8 100644 --- a/modules/nixos/shell/hyprpicker.nix +++ b/modules/nixos/shell/hyprpicker.nix @@ -22,7 +22,12 @@ in ''; in [ - "SUPER_SHIFT,C,exec,uwsm app -- ${color-picker}" + { + _args = [ + "SUPER + SHIFT + C" + (lib.generators.mkLuaInline "hl.dsp.exec_cmd('uwsm app -- ${color-picker}')") + ]; + } ]; }; } diff --git a/modules/nixos/shell/kitty.nix b/modules/nixos/shell/kitty.nix index ee807e9..a8942b4 100644 --- a/modules/nixos/shell/kitty.nix +++ b/modules/nixos/shell/kitty.nix @@ -16,7 +16,12 @@ in config = lib.mkIf cfg.enable { home-manager.users.${username} = { wayland.windowManager.hyprland.settings.bind = [ - "SUPER,T,exec,uwsm app -- kitty" + { + _args = [ + "SUPER + T" + (lib.generators.mkLuaInline "hl.dsp.exec_cmd('uwsm app -- kitty')") + ]; + } ]; programs.kitty = { enable = true; diff --git a/modules/nixos/shell/walker.nix b/modules/nixos/shell/walker.nix index 40761d6..ed2975e 100644 --- a/modules/nixos/shell/walker.nix +++ b/modules/nixos/shell/walker.nix @@ -17,7 +17,15 @@ in config = lib.mkIf cfg.enable { home-manager.users.${username} = { wayland.windowManager.hyprland.settings = { - bindr = [ "SUPER,SUPER_L,exec,uwsm app -- ${lib.getExe pkgs.walker}" ]; + bind = [ + { + _args = [ + "SUPER + SUPER_L" + (lib.generators.mkLuaInline "hl.dsp.exec_cmd('uwsm app -- ${lib.getExe pkgs.walker}')") + { release = true; } + ]; + } + ]; /* layerrule = [ # TODO: Add layer rules for walker