From 08deff70bc8de10bfa41c6c9803729c10c87b8a9 Mon Sep 17 00:00:00 2001 From: unexplrd Date: Thu, 29 May 2025 14:39:05 +0300 Subject: [PATCH] desktop/hyprland: refactor Signed-off-by: unexplrd --- modules/home/desktop/hyprland/default.nix | 1258 ++--------------- modules/home/desktop/hyprland/hyprland.nix | 458 ++++++ .../desktop/hyprland/programs/default.nix | 23 + .../hyprland/programs/fuzzel/default.nix | 23 + .../hyprland/programs/hyprlock/default.nix | 94 ++ .../hyprland/programs/walker/default.nix | 307 ++++ .../hyprland/programs/waybar/default.nix | 331 +++++ .../desktop/hyprland/services/default.nix | 65 + .../hyprland/services/swaync/default.nix | 177 +++ 9 files changed, 1574 insertions(+), 1162 deletions(-) create mode 100644 modules/home/desktop/hyprland/hyprland.nix create mode 100644 modules/home/desktop/hyprland/programs/default.nix create mode 100644 modules/home/desktop/hyprland/programs/fuzzel/default.nix create mode 100644 modules/home/desktop/hyprland/programs/hyprlock/default.nix create mode 100644 modules/home/desktop/hyprland/programs/walker/default.nix create mode 100644 modules/home/desktop/hyprland/programs/waybar/default.nix create mode 100644 modules/home/desktop/hyprland/services/default.nix create mode 100644 modules/home/desktop/hyprland/services/swaync/default.nix diff --git a/modules/home/desktop/hyprland/default.nix b/modules/home/desktop/hyprland/default.nix index e4e6517..fb01ee0 100644 --- a/modules/home/desktop/hyprland/default.nix +++ b/modules/home/desktop/hyprland/default.nix @@ -1,1210 +1,143 @@ { - perSystem, - osConfig, config, - pkgs, + inputs, lib, + osConfig, + perSystem, + pkgs, ... }: let - inherit (config.stylix) colors; - inherit (lib) mkIf mkEnableOption mkDefault mkForce getExe; + inherit (config.lib.stylix) colors; + inherit (lib) mkIf mkEnableOption mkForce getExe; cfg = config.desktop.hyprland; hostname = osConfig.networking.hostName; cursorSize = config.stylix.cursor.size; - fontName = config.stylix.fonts.sansSerif.name; - keyboard = - if hostname == "eldrid" - then "chromeos" - else "platform"; - xdgPictures = - config.xdg.userDirs.pictures; ifLaptop = mkIf (hostname != "dunamis"); + launcher = getExe pkgs.walker; + lockscreen = getExe pkgs.hyprlock; in { options = { desktop.hyprland.enable = mkEnableOption "enable hyprland desktop"; }; config = mkIf cfg.enable { - stylix.targets.waybar.enable = false; - stylix.targets.hyprland.enable = false; - stylix.targets.hyprlock.enable = false; - home.pointerCursor.hyprcursor.enable = true; - home.pointerCursor.hyprcursor.size = cursorSize; - wayland.windowManager.hyprland = { - enable = true; - systemd = { - enable = true; - variables = [ - "--all" - ]; - }; - package = perSystem.hyprland.hyprland; - portalPackage = perSystem.hyprland.xdg-desktop-portal-hyprland; - # plugins = with pkgs.hyprlandPlugins; [ - # hyprspace - # hy3 - # hyprscroller - # ]; - settings = { - input = { - kb_layout = "us,ua"; - resolve_binds_by_sym = - if hostname == "dunamis" - then 0 - else 1; - repeat_rate = 50; - repeat_delay = 300; - # mouse - accel_profile = "flat"; - sensitivity = 0; - }; - device = [ - { - name = "ite-tech.-inc.-ite-device(8910)-keyboard"; - kb_variant = "colemak_dh,"; - } - { - name = "at-translated-set-2-keyboard"; - kb_variant = "colemak_dh,"; - } - { - name = "keyd-virtual-keyboard"; - kb_variant = "colemak_dh,"; - } - ]; - xwayland.force_zero_scaling = true; - monitor = [ - ", preferred, auto, 1" - "desc:AOC 27V2G5 0x0000026C, addreserved, 0, 300, 0, 0" - "desc:Samsung Electric Company S24R65x H4TMA03291, preferred, 0x0, 1, bitdepth, 10, vrr, 1" - "desc:Philips Consumer Electronics Company 27M2N5500 UK02418033254, 2560x1440@180.00Hz, 0x0, 1.3333333, bitdepth, 10, vrr, 1" - "desc:BOE 0x08E8, preferred, 1920x0, 1.2, bitdepth, 10" - "desc:LG Display 0x068B, preferred, 1920x0, 1.2, bitdepth, 10" - "desc:Chimei Innolux Corporation 0x1406, preferred, 1920x0, 1.2" - ]; - env = [ - "ELECTRON_OZONE_PLATFORM_HINT,auto" - "QT_QPA_PLATFORM,wayland" - "QT_QPA_PLATFORMTHEME,gtk3" - "XCURSORSIZE,${toString cursorSize}" - "GSK_RENDERER,ngl" - ]; - decoration = { - shadow.enabled = false; - # drop_shadow = false; - blur = { - size = 8; - passes = 3; - }; - # shadow_offset = "0 5"; - # "col.shadow" = "rgba(00000099)"; - rounding = 12; - }; - misc = { - font_family = fontName; - disable_splash_rendering = true; - disable_hyprland_logo = true; - # vfr = true; - }; - bezier = [ - "easeOutQuad, 0.25, 0.46, 0.45, 0.94" - "easeOutExpo, 0.19, 1, 0.22, 1" - ]; - animation = [ - "workspaces, 1, 3, easeOutExpo, slidefade 20%" - "windows, 1, 3, easeOutExpo, popin 80%" - "layers, 1, 2, easeOutExpo, fade" - ]; - plugin = [ - { - overview = { - gapsIn = 12; - gapsOut = 24; - exitOnClick = true; - centerAligned = true; - showNewWorkspace = false; - showEmptyWorkspace = false; - affectStrut = false; - }; - hyprexpo = { - columns = 3; - gap_size = 8; - #bg_col = "rgb(111111)"; - workspace_method = "first 1"; # [center/first] [workspace] e.g. first 1 or center m+1 - enable_gesture = true; # laptop touchpad - gesture_fingers = 3; # 3 or 4 - gesture_distance = 400; # how far is the "max" - gesture_positive = false; # positive = swipe down. Negative = swipe up.; - }; - } - { - hy3 = { - autotile = true; - tab_first_window = false; - tabs = { - render_text = true; - height = 24; - padding = 8; - rounding = 8; - text_height = 14; - text_center = true; - text_font = fontName; - - "col.active" = "0xff${colors.base00}"; - "col.inactive" = "0xff${colors.base00}"; - "col.urgent" = "0xff${colors.base00}"; - "col.active.text" = "0xff${colors.base0D}"; - "col.inactive.text" = "0xff${colors.base05}"; - "col.urgent.text" = "0xff${colors.base09}"; - "col.active.border" = "0xff${colors.base00}"; - "col.inactive.border" = "0xff${colors.base00}"; - "col.urgent.border" = "0xff${colors.base00}"; - }; - }; - } - { - scroller = { - column_widths = "onethird onehalf twothirds one"; - window_heights = "onethird onehalf twothirds one"; - gesture_scroll_fingers = 3; - gesture_overview_fingers = 3; - jump_labels_font = fontName; - jump_labels_color = "0xff${colors.base0A}"; - }; - } - ]; - - dwindle = { - force_split = 2; - default_split_ratio = 1.2; - }; - master = { - mfact = 0.6; - }; - - "$mod" = "SUPER"; - "$modShift" = "$mod SHIFT"; - "$modCtrl" = "$mod CTRL"; - "$modShiftCtrl" = "$mod SHIFT CTRL"; - - "$left" = "N"; - "$down" = "E"; - "$up" = "I"; - "$right" = "O"; - - "$terminal" = "ghostty"; - "$dlauncher" = "tofi-drun"; - "$launcher" = "tofi-run | xargs hyprctl dispatch exec --"; - "$screenLocker" = "hyprlock"; - "$webBrowser" = "io.github.zen_browser.zen"; - "$clipboardManager" = "copyq menu"; - - general = { - "col.active_border" = "0xff${colors.base0D}"; - "col.inactive_border" = "0xff${colors.base03}"; - gaps_in = 4; - gaps_out = 8; - border_size = 3; - allow_tearing = true; - layout = "dwindle"; - }; - group = { - "col.border_active" = "0xff${colors.base0D}"; - "col.border_inactive" = "0xff${colors.base03}"; - "col.border_locked_active" = "0xff${colors.base0A}"; - "col.border_locked_inactive" = "0xff${colors.base0F}"; - groupbar = { - height = 16; - rounding = 0; - indicator_height = 0; - gradient_rounding = 4; - font_size = 14; - gradients = true; - font_family = fontName; - "text_color" = "0xff${colors.base00}"; - "col.active" = "0xff${colors.base0D}"; - "col.inactive" = "0xff${colors.base03}"; - }; - }; - binds.scroll_event_delay = 0; - cursor.persistent_warps = true; - - bind = [ - "$mod, Return, exec, $terminal" - "$mod, Space, exec, $dlauncher" - "$modShift, Space, exec, $launcher" - "$modCtrl, Q, killactive" - "$modCtrl, M, fullscreen" - "$modCtrl, G, togglefloating" - "$mod, G, pin" - - "$mod, T, togglegroup" - "$mod, period, changegroupactive, f" - "$mod, comma, changegroupactive, b" - "$modCtrl, period, movewindoworgroup, r" - "$modCtrl, comma, movewindoworgroup, l" - - "$mod, Tab, cyclenext," - "$modShift, Tab, cyclenext, prev" - "$mod, Tab, bringactivetotop," - - "$modShift, U, focusurgentorlast" - - "$modCtrl, L, exec, $screenLocker" - "$modCtrl, B, exec, $webBrowser" - "$modCtrl, V, exec, $clipboardManager" - "$modCtrl, K, focuswindow, title:(Meet:.*)" - - # ", Print, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -o -r -c '\#\#00000000')\" -t ppm - | ${pkgs.satty}/bin/satty --filename - --fullscreen --output-filename ${xdgPictures}/screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png" - ", Print, exec, hyprshot -z -m region -o ${xdgPictures}/screenshots -f screenshot-$(date '+%Y%m%d-%H:%M:%S').png" - "CTRL, Print, exec, hyprshot -z -m window -o ${xdgPictures}/screenshots -f screenshot-$(date '+%Y%m%d-%H:%M:%S').png" - "SHIFT, Print, exec, hyprshot -z -m output -o ${xdgPictures}/screenshots -f screenshot-$(date '+%Y%m%d-%H:%M:%S').png" - ## navigation - "$mod, $left, movefocus, l" - "$mod, $down, movefocus, d" - "$mod, $up, movefocus, u" - "$mod, $right, movefocus, r" - "$modShift, $left, workspace, e-1" - "$modShift, $right, workspace, e+1" - "$mod, left, movefocus, l" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - "$mod, right, movefocus, r" - "$modShift, W, focuscurrentorlast" - "$mod, mouse_down, workspace, e-1" - "$mod, mouse_up, workspace, e+1" - "$modShift, left, workspace, e-1" - "$modShift, right, workspace, e+1" - - "$modCtrl, $left, movewindow, l" - "$modCtrl, $down, movewindow, d" - "$modCtrl, $up, movewindow, u" - "$modCtrl, $right, movewindow, r" - "$modCtrl, left, movewindow, l" - "$modCtrl, up, movewindow, u" - "$modCtrl, down, movewindow, d" - "$modCtrl, right, movewindow, r" - # workspaces - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, togglespecialworkspace" - - "$modShiftCtrl, 1, movetoworkspace, 1" - "$modShiftCtrl, 2, movetoworkspace, 2" - "$modShiftCtrl, 3, movetoworkspace, 3" - "$modShiftCtrl, 4, movetoworkspace, 4" - "$modShiftCtrl, 5, movetoworkspace, 5" - "$modShiftCtrl, 6, movetoworkspace, 6" - "$modShiftCtrl, 7, movetoworkspace, 7" - "$modShiftCtrl, 8, movetoworkspace, 8" - "$modShiftCtrl, 9, movetoworkspace, 9" - "$modShiftCtrl, 0, movetoworkspace, special" - - "$mod, Q, workspace, 1" - "$mod, W, workspace, 2" - "$mod, F, workspace, 3" - "$mod, P, workspace, 4" - "$mod, B, workspace, 5" - "$mod, J, workspace, 6" - "$mod, L, workspace, 7" - "$mod, U, workspace, 8" - "$mod, Y, workspace, 9" - "$mod, apostrophe, togglespecialworkspace" - - "$modShiftCtrl, Q, movetoworkspace, 1" - "$modShiftCtrl, W, movetoworkspace, 2" - "$modShiftCtrl, F, movetoworkspace, 3" - "$modShiftCtrl, P, movetoworkspace, 4" - "$modShiftCtrl, B, movetoworkspace, 5" - "$modShiftCtrl, J, movetoworkspace, 6" - "$modShiftCtrl, L, movetoworkspace, 7" - "$modShiftCtrl, U, movetoworkspace, 8" - "$modShiftCtrl, Y, movetoworkspace, 9" - "$modShiftCtrl, apostrophe, movetoworkspace, special" - - "$modShiftCtrl, $left, movetoworkspace, e-1" - "$modShiftCtrl, $right, movetoworkspace, e+1" - "$modShiftCtrl, left, movetoworkspace, e-1" - "$modShiftCtrl, right, movetoworkspace, e+1" - - ''$mod ALT, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 1.25}')"'' - ''$mod ALT, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 1.25}')"'' - "$mod ALT, mouse:274, exec, hyprctl keyword cursor:zoom_factor 1" # middle wheel click - ]; - # binde = [ - # "$mod, comma, resizeactive, -10 0" - # "$mod, period, resizeactive, 10 0" - # "$modShift, comma, resizeactive, 0 -10" - # "$modShift, period, resizeactive, 0 10" - # ]; - bindl = [ - "$mod, Escape, exec, hyprctl switchxkblayout all next" - ", switch:on:Lid Switch, exec, hyprctl keyword monitor 'eDP-1, disable'" - ", switch:off:Lid Switch, exec, hyprctl keyword monitor 'eDP-1, preferred, 1920x0, 1.2'" - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPrev, exec, playerctl previous" - ", XF86AudioNext, exec, playerctl next" - "$modShiftCtrl ALT, Q, exit" - ]; - binde = [ - ", XF86MonBrightnessUp, exec, brightnessctl s 5%+" - ", XF86MonBrightnessDown, exec, brightnessctl s 5%-" - "ALT, XF86MonBrightnessUp, exec, brightnessctl s 5%+ -d ${keyboard}::kbd_backlight" - "ALT, XF86MonBrightnessDown, exec, brightnessctl s 5%- -d ${keyboard}::kbd_backlight" - ", XF86KbdBrightnessUp, exec, brightnessctl s 5%+ -d ${keyboard}::kbd_backlight" - ", XF86KbdBrightnessDown, exec, brightnessctl s 5%- -d ${keyboard}::kbd_backlight" - ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ]; - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - "$mod ALT, mouse:272, resizewindow" - ]; - gestures = { - workspace_swipe = true; - workspace_swipe_fingers = 3; - workspace_swipe_distance = 300; - }; - - workspace = [ - "1, defaultName:general" - "2, defaultName:web" - "3, defaultName:chat" - "4, defaultName:code" - "5, defaultName:uni" - "6, defaultName:games" - "7, defaultName:system" - "8, defaultName:media" - "9, defaultName:tray" - # "10, defaultName:" - ]; - windowrulev2 = [ - ## tray/misc utilities - # file picker - "float, class:xdg-desktop-portal-gtk" - "size <50% <90%, class:xdg-desktop-portal-gtk" - "center 1, class:xdg-desktop-portal-gtk" - # xdp-hyprland stream picker - "float, initialTitle:MainPicker" - # general apps - "float, class:(com.saivert.pwvucontrol)" - "float, class:(re.sonny.Junction)" - "float, class:(com.github.hluk.copyq)" - "float, class:(nm-connection-editor)" - "float, class:(.blueman-manager-wrapped)" - # telegram - "maximize, initialTitle:Медіапереглядач" - "noborder, title:TelegramDesktop" - "keepaspectratio, title:TelegramDesktop" - "noblur, title:TelegramDesktop" - "float, title:TelegramDesktop" - "pin, title:TelegramDesktop" - # any chromium-based - "noborder, title:Картинка в картинці" - "keepaspectratio, title:Картинка в картинці" - "noblur, title:Картинка в картинці" - "float, title:Картинка в картинці" - "pin, title:Картинка в картинці" - # and firefox - "noborder, title:Picture-in-Picture" - "keepaspectratio, title:Picture-in-Picture" - "noblur, title:Picture-in-Picture" - "float, title:Picture-in-Picture" - "pin, title:Picture-in-Picture" - # screenshot editor - "noanim, class:com.gabm.satty" - "float, class:com.gabm.satty" - "rounding 0, class:com.gabm.satty" - "size 100% 100%, class:com.gabm.satty" - "move 0 0, class:com.gabm.satty" - "pin, class:com.gabm.satty" - ## games - "float, class:(com.mojang.minecraft.java-edition)" - "immediate, class:(com.mojang.minecraft.java-edition)" - # cs2 - "immediate, class:(cs2)" - # deadlock - # "float, class:(steam_app_1422450)" - "fullscreen, class:(steam_app_1422450)" - "immediate, class:(steam_app_1422450)" - "immediate, initialTitle:(Ghostrunner)" - # dead by daylight - "immediate, class:deadbydaylight-egs-shipping.exe" - ## workspace assignments - "workspace name:chat, class:org.telegram.desktop" - "workspace name:chat, class:org.signal.Signal" - "workspace name:chat, class:im.riot.Riot" - "workspace name:chat, class:WebCord" - - "workspace name:games, class:com.heroicgameslauncher.hgl" - "workspace name:games, class:net.lutris.Lutris" - "workspace name:games, class:steam" - # "workspace name:game, class:" - ]; - }; - extraConfig = '' - bind = $modShift, R, submap, resize - submap = resize - binde = , right, resizeactive, 10 0 - binde = , left, resizeactive, -10 0 - binde = , up, resizeactive, 0 -10 - binde = , down, resizeactive, 0 10 - binde = , $right, resizeactive, 10 0 - binde = , $left, resizeactive, -10 0 - binde = , $up, resizeactive, 0 -10 - binde = , $down, resizeactive, 0 10 - bind = , escape, submap, reset - submap = reset - ''; + stylix.targets = { + waybar.enable = false; + hyprland.enable = false; + hyprlock.enable = false; + qt.enable = false; }; - services = { - hyprpaper.enable = true; - hypridle = { - enable = true; - settings = { - general = { - before_sleep_cmd = "loginctl lock-session"; - after_sleep_cmd = "hyprctl dispatch dpms on"; - lock_cmd = "pidof hyprlock || hyprlock"; - # unlock_cmd = "loginctl unlock-session"; - }; - listener = [ - { - timeout = 600; - on-timeout = "pidof hyprlock || hyprlock"; - } - { - timeout = 601; - on-timeout = "hyprctl dispatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - ]; - }; + home.pointerCursor.hyprcursor = { + enable = true; + size = cursorSize; + }; + dconf.settings = { + "org/gnome/desktop/wm/preferences" = { + button-layout = "icon:close"; }; - network-manager-applet.enable = true; - blueman-applet.enable = true; - playerctld.enable = true; - copyq.enable = true; - gnome-keyring = { - enable = true; - components = ["secrets" "ssh"]; + "org/gnome/desktop/interface" = { + icon-theme = config.gtk.iconTheme.name; + color-scheme = + if config.stylix.polarity == "dark" + then lib.mkDefault "prefer-dark" + else lib.mkDefault "prefer-light"; }; }; gtk = { enable = true; - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; + iconTheme = let + name = + if (lib.strings.hasPrefix "gruvbox" osConfig.module.stylix.theme) + then "Gruvbox-Plus-Dark" + else if config.stylix.polarity == "dark" + then "Papirus-Dark" + else "Papirus-Light"; + package = + if (lib.strings.hasPrefix "gruvbox" osConfig.module.stylix.theme) + then pkgs.gruvbox-plus-icons + else if (lib.strings.hasPrefix "rose-pine" osConfig.module.stylix.theme) + then pkgs.papirus-icon-theme.override {color = "indigo";} + else if (lib.strings.hasPrefix "nord" osConfig.module.stylix.theme) + then pkgs.papirus-icon-theme.override {color = "nordic";} + else pkgs.papirus-icon-theme; + in {inherit name package;}; }; qt = { enable = true; - platformTheme.name = mkDefault "gtk3"; + platformTheme.name = "gtk3"; }; - dconf.settings = { - "org/gnome/desktop/interface" = { - icon-theme = "${config.gtk.iconTheme.name}"; - }; - }; - programs.waybar = { - enable = true; - systemd = { - enable = true; - target = "graphical-session.target"; - }; - settings = { - bar-0 = { - layer = "top"; - position = "bottom"; - height = 32; - spacing = 4; - margin-left = 11; - margin-right = 11; - reload_style_on_change = true; - modules-left = [ - "hyprland/language" - "hyprland/workspaces" - "wlr/taskbar" - ]; - # modules-center = []; - modules-right = [ - "wireplumber" - (ifLaptop "group/laptop") - "tray" - "privacy" - (ifLaptop "power-profiles-daemon") - "idle_inhibitor" - "custom/notification" - "clock" - ]; - "hyprland/workspaces" = { - format = "{icon}"; - format-icons = { - "1" = "I"; - "2" = "II"; - "3" = "III"; - "4" = "IV"; - "5" = "V"; - "6" = "VI"; - "7" = "VII"; - "8" = "IIX"; - "9" = "IX"; - "10" = "X"; - general = "󰘧"; - web = "󰖟"; - chat = "󰻞"; - code = "󰅩"; - uni = "󱆀"; - games = "󰺶"; - system = "󰢻"; - media = "󱜐"; - tray = "󱊖"; - }; - }; - "hyprland/language" = { - format = "{}"; - format-en = "🇺🇸"; - format-uk = "🇺🇦"; - }; - "custom/separator" = { - format = "󰝠"; - interval = "once"; - tooltip = false; - }; - "group/laptop" = { - orientation = "inherit"; - modules = [ - "battery" - "backlight" - ]; - }; - "backlight" = { - format = "{percent}% {icon}"; - format-icons = ["" ""]; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = "󰅶"; - deactivated = "󰾪"; - }; - }; - "tray" = { - icon-size = 24; - spacing = 2; - }; - "clock" = { - interval = 1; - format = "{:%H:%M:%S}"; - tooltip-format = "{:%d.%m.%Y}"; - }; - battery = { - states = { - good = 95; - warning = 30; - critical = 15; - }; - format = "{capacity}% {icon}"; - format-full = "{capacity}% 󱟢"; - format-charging = "{capacity}% 󰂄"; - format-plugged = "{capacity}% 󰚥"; - format-alt = "{icon} {time}"; - format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; - }; - "upower" = { - icon-size = 16; - format = "{percentage}"; - hide-if-empty = true; - tooltip = true; - tooltip-spacing = 20; - }; - "power-profiles-daemon" = { - format = "{icon}"; - tooltip-format = "Power profile: {profile}\nDriver: {driver}"; - tooltip = true; - format-icons = { - default = "󱡮"; - performance = "󱡮"; - balanced = ""; - power-saver = ""; - }; - }; - "wireplumber" = { - scroll-step = 3; - format = "{volume}% {icon}"; - format-muted = "󰖁"; - format-icons = ["󰕿" "󰖀" "󰕾"]; - on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol"; - on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle"; - }; - "custom/notification" = { - tooltip = false; - format = "{icon}"; - format-icons = { - notification = ""; - none = ""; - dnd-notification = ""; - dnd-none = ""; - }; - return-type = "json"; - exec-if = "which swaync-client"; - exec = "swaync-client -swb"; - on-click = "swaync-client -t -sw"; - on-click-right = "swaync-client -d -sw"; - escape = true; - }; - "privacy" = { - icon-spacing = 2; - icon-size = 16; - transition-duration = 250; - screenshare = { - type = "screenshare"; - tooltip = true; - tooltip-icon-size = 24; - }; - audio-in = { - type = "audio-in"; - tooltip = true; - tooltip-icon-size = 24; - }; - }; - "wlr/taskbar" = { - format = "{icon}"; - icon-size = 24; - icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; - tooltip-format = "{title}"; - on-click = "activate"; - }; - }; - }; - style = '' - @define-color base00 #${colors.base00}; - @define-color base01 #${colors.base01}; - @define-color base02 #${colors.base02}; - @define-color base03 #${colors.base03}; - @define-color base04 #${colors.base04}; - @define-color base05 #${colors.base05}; - @define-color base06 #${colors.base06}; - @define-color base07 #${colors.base07}; - @define-color base08 #${colors.base08}; - @define-color base09 #${colors.base09}; - @define-color base0A #${colors.base0A}; - @define-color base0B #${colors.base0B}; - @define-color base0C #${colors.base0C}; - @define-color base0D #${colors.base0D}; - @define-color base0E #${colors.base0E}; - @define-color base0F #${colors.base0F}; - * { - font-family: ${fontName}, FontAwesome; - font-weight: 500; - font-size: 100%; - } - window#waybar { - background-color: transparent; - color: @base05; - transition-property: background-color; - transition-duration: 0.5s; - } - .modules-left, - .modules-right { - border-top-left-radius: 12px; - border-top-right-radius: 12px; - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; - background-color: @base00; - color: @base05; - padding: 0 0.5em; - } - tooltip { - background: @base01; - border: 1px solid @base0E; - } - tooltip label { - color: @base05; - } - button { - box-shadow: inset 0 -3px transparent; - border-radius: 16px; - } - button:hover { - background: inherit; - box-shadow: inset 0 -3px transparent; - } - #mode { - background-color: rgba(0, 0, 0, 0.2); - box-shadow: inset 0 -3px @base05; - } - #battery, - #backlight, - #workspaces, - #taskbar, - #language, - #clock, - #battery, - #backlight, - #wireplumber, - #custom-separator { - padding: 0 0.3em; - } - #privacy, - #tray button, - #privacy-item, - #idle_inhibitor, - #custom-notification, - #power-profiles-daemon, - #workspaces button { - padding: 0 0.2em; - } - #taskbar button { - padding: 0 0.1em; - } - #workspaces button.active { - color: @base0D; - } - #taskbar button:hover { - box-shadow: transparent; - } - #taskbar.empty, - window#empty { - background-color: transparent; - } - #battery.critical:not(.charging) { - color: @base09; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: steps(12); - animation-iteration-count: infinite; - animation-direction: alternate; - } - #power-profiles-daemon.performance { - color: @base0D; - } - #power-profiles-daemon.balanced { - color: @base0B; - } - #power-profiles-daemon.power-saver { - color: @base0A; - } - label:focus { - background-color: #000000; - } - #tray > .passive { - -gtk-icon-effect: dim; - } - #tray > .needs-attention { - -gtk-icon-effect: highlight; - background-color: @base08; - } - #privacy-item.screenshare { - color: @base0C; - } - #privacy-item.audio-in { - color: @base0E; - } - ''; - }; - programs.tofi = { - enable = true; - settings = { - drun-launch = true; - anchor = "bottom"; - width = "50%"; - height = 30; - padding-right = 6; - padding-left = 6; - padding-bottom = 0; - padding-top = 0; - margin-bottom = 2; - border-width = 0; - corner-radius = 12; - outline-width = 0; - min-input-width = 128; - result-spacing = 12; - require-match = false; - horizontal = true; - prompt-text = "~>"; - }; - }; - services.swaync = { - enable = true; - settings = { - cssPriority = "user"; - image-visibility = "when-available"; - keyboard-shortcut = true; - relative-timestamps = true; - timeout = 5; - timeout-low = 5; - timeout-critical = 0; - script-fail-notify = true; - transition-time = 200; - # Layer settings - layer-shell = true; - layer = "overlay"; - control-center-layer = "overlay"; + programs.walker = import ./programs/walker {inherit config inputs pkgs;}; + programs.waybar = import ./programs/waybar {inherit config colors getExe ifLaptop pkgs;}; + wayland.windowManager.hyprland = import ./hyprland.nix {inherit config osConfig perSystem launcher lockscreen;}; + services = import ./services {inherit pkgs lockscreen getExe perSystem;}; - # Notification settings - positionX = "right"; - positionY = "top"; - notification-2fa-action = true; - notification-inline-replies = false; - notification-icon-size = 32; - notification-body-image-height = 100; - notification-body-image-width = 200; - notification-window-width = 400; - - # Control center settings - control-center-positionX = "right"; - control-center-positionY = "top"; - control-center-width = 500; - control-center-exclusive-zone = true; - fit-to-screen = true; - hide-on-action = true; - hide-on-clear = false; - - # Widget settings - widgets = [ - "title" - "dnd" - "notifications" - "mpris" - ]; - - widget-config = { - title = { - text = "Notifications"; - clear-all-button = true; - button-text = "Clear All"; - }; - dnd = { - text = "Do Not Disturb"; - }; - mpris = { - image-size = 96; - image-radius = 12; - blur = true; - }; - }; - }; - style = '' - /*** Global ***/ - progress, - progressbar, - trough { - border-radius: 16px; - } - - .app-icon, - .image { - -gtk-icon-effect: none; - } - - .notification-action { - border-radius: 12px; - margin: 0.5rem; - } - - .close-button { - margin: 24px; - padding: 0.2rem; - border-radius: 16px; - } - - /*** Notifications ***/ - .notification-group.collapsed - .notification-row:not(:last-child) - .notification-action, - .notification-group.collapsed - .notification-row:not(:last-child) - .notification-default-action { - opacity: 0; - } - - .trough { - margin: 4px; - border-radius: 7px; - } - - .notification, - .notification.low, - .notification.normal, - .notification.critical, - .control-center { - margin: 16px; - border-radius: 7px; - } - - .floating-notifications, - .notification-content { - border-radius: 7px; - } - - .control-center-list { - background: transparent; - } - - /*** Widgets ***/ - /* Title widget */ - .widget-title { - margin: 0.5rem; - } - - .widget-title > label { - font-weight: bold; - } - - .widget-title > button { - border-radius: 16px; - padding: 0.5rem; - } - - /* DND Widget */ - .widget-dnd { - margin: 0.5rem; - } - - .widget-dnd > label { - font-weight: bold; - } - - .widget-dnd > switch { - border-radius: 16px; - } - - .widget-dnd > switch slider { - border-radius: 16px; - padding: 0.25rem; - } - - /* Mpris widget */ - .widget-mpris .widget-mpris-player { - border-radius: 16px; - margin: 0.5rem; - padding: 0.5rem; - } - - .widget-mpris .widget-mpris-player .widget-mpris-album-art { - border-radius: 16px; - } - - .widget-mpris .widget-mpris-player .widget-mpris-title { - font-weight: bold; - } - - .widget-mpris .widget-mpris-player .widget-mpris-subtitle { - font-weight: normal; - } - - .widget-mpris .widget-mpris-player > box > button { - border: 1px solid transparent; - border-radius: 16px; - padding: 0.25rem; - } - ''; - }; - services.dunst = { - enable = false; - settings = { - global = { - width = 300; - height = 300; - icon_theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; - corner_radius = mkDefault 9; - #corners = "top-right,bottom-left"; - offset = "16x16"; - origin = "bottom-right"; - timeout = 15; - frame_width = 3; - notification_limit = 5; - }; - rule-telegram = { - "desktop_entry" = "org.telegram.desktop"; - "urgency" = "normal"; - }; - }; - }; - programs.hyprlock = { - enable = true; - settings = { - general = { - disable_loading_bar = true; - #grace = 300; - hide_cursor = true; - no_fade_in = false; - }; - - background = [ - { - path = "screenshot"; - blur_passes = 4; - blur_size = 8; - } - ]; - - input-field = [ - { - size = "274, 50"; - rounding = 12; - outline_thickness = 3; - position = "0, 0"; - monitor = ""; - dots_center = true; - fade_on_empty = false; - font_family = "${config.stylix.fonts.serif.name}"; - font_color = "rgb(${colors.base05})"; - inner_color = "rgb(${colors.base00})"; - outer_color = "rgb(${colors.base0D})"; - check_color = "rgb(${colors.base0A})"; - fail_color = "rgb(${colors.base08})"; - placeholder_text = "locked..."; - fail_text = "wrong"; - shadow_passes = 0; - } - ]; - shape = [ - { - rounding = 12; - #border_size = 3; - size = "274, 50"; - color = "rgb(${colors.base00})"; - border_color = "rgb(${colors.base0D})"; - position = "0, 60"; - halign = "center"; - valign = "center"; - } - { - rounding = 12; - #border_size = 3; - size = "274, 50"; - color = "rgb(${colors.base00})"; - border_color = "rgb(${colors.base0D})"; - position = "0, -60"; - halign = "center"; - valign = "center"; - } - ]; - label = [ - { - monitor = ""; - text = "$LAYOUT"; #"cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +%H:%M:%S)"; - text_align = "center"; - font_size = 16; - font_family = "${config.stylix.fonts.serif.name}"; - outer_color = "rgb(${colors.base00})"; - color = "rgb(${colors.base05})"; - position = "0, 60"; - halign = "center"; - valign = "center"; - } - { - monitor = ""; - text = "cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +'%m/%d %a %T')"; - text_align = "center"; - font_size = 16; - font_family = "${config.stylix.fonts.serif.name}"; - outer_color = "rgb(${colors.base00})"; - color = "rgb(${colors.base05})"; - position = "0, -60"; - halign = "center"; - valign = "center"; - } - ]; - }; - }; - services.gammastep = { - enable = true; - provider = "manual"; - latitude = 49.6; - longitude = 36.1; - tray = true; - temperature = { - day = 6500; - night = 3000; - }; - }; - services.wlsunset = { - enable = false; - latitude = "49.6"; - longitude = "36.1"; - temperature = { - day = 6500; - night = 3000; - }; - systemdTarget = "graphical-session.target"; - }; - services.udiskie = { - enable = true; - automount = false; - notify = true; - tray = "auto"; - }; - home.packages = with pkgs; [ - brightnessctl - nautilus - helvum - loupe - evince - junction - celluloid - mission-center - dconf - hyprshot - grim - slurp - libnotify - playerctl - wdisplays - pwvucontrol - wl-clipboard-rs - libqalculate - ]; + home.packages = with pkgs; + [ + # gui libadwaita apps + celluloid # mpv gui in libadwaita + gnome-text-editor + helvum # pipewire patchbay in rust + junction # app chooser + loupe # image viewer and editor in rust + mission-center # task manager in rust (partly) + nautilus # file manager + overskride # bluetooth gui in rust + papers # pdf reader in rust + pika-backup # borg gui in rust + pwvucontrol # pipewire gui in rust + sonusmix # pipewire routing tool in rust + wdisplays # wlroots display configurator + ] + ++ [ + # misc utils + (ifLaptop brightnessctl) + grim + slurp + hyprshot + dconf + libnotify + playerctl + wl-clipboard-rs # wl-clipboard in rust + ]; xdg = { mime.enable = true; mimeApps = { enable = true; defaultApplications = let file_manager = ["org.gnome.Nautilus.desktop"]; - web_browser = ["re.sonny.Junction.desktop"]; image_viewer = ["org.gnome.Loupe.desktop"]; + pdf_reader = ["org.gnome.Papers.desktop"]; video_player = ["io.github.celluloid_player.Celluloid.desktop"]; - pdf_reader = ["org.gnome.Evince.desktop"]; + web_browser = ["re.sonny.Junction.desktop"]; in { + "application/pdf" = pdf_reader; + "image/jpeg" = image_viewer; + "image/png" = image_viewer; "inode/directory" = file_manager; - "video/x-matroska" = video_player; + "text/html" = web_browser; "video/mp4" = video_player; "video/mpeg" = video_player; + "video/x-matroska" = video_player; "video/x-mpeg" = video_player; - "image/png" = image_viewer; - "image/jpeg" = image_viewer; - "application/pdf" = pdf_reader; - "text/html" = web_browser; + "x-scheme-handler/about" = web_browser; "x-scheme-handler/http" = web_browser; "x-scheme-handler/https" = web_browser; - "x-scheme-handler/about" = web_browser; "x-scheme-handler/unknown" = web_browser; }; }; - desktopEntries = { - zen-browser-profile = { - name = "Zen Browser (Choose profile)"; - icon = "app.zen_browser.zen"; - exec = "flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding app.zen_browser.zen --ProfileManager @@u %u @@"; - }; - logseq-wayland = { - name = "Logseq Desktop (Wayland)"; - icon = "com.logseq.Logseq"; - exec = "flatpak run --branch=stable --arch=x86_64 --command=run.sh --file-forwarding com.logseq.Logseq @@u %U @@ --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations"; - }; - }; + # desktopEntries = { + # zen-browser-profile = { + # name = "Zen Browser (Choose profile)"; + # icon = "app.zen_browser.zen"; + # exec = "flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding app.zen_browser.zen --ProfileManager @@u %u @@"; + # }; + # logseq-wayland = { + # name = "Logseq Desktop (Wayland)"; + # icon = "com.logseq.Logseq"; + # exec = "flatpak run --branch=stable --arch=x86_64 --command=run.sh --file-forwarding com.logseq.Logseq @@u %U @@ --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations"; + # }; + # }; }; systemd.user = { settings.Manager.DefaultEnvironment = { @@ -1256,6 +189,7 @@ in { ExecStart = "${getExe perSystem.hyprsunset.hyprsunset} -t 6500"; }; }; + walker = mkGraphicalService {}; }; }; }; diff --git a/modules/home/desktop/hyprland/hyprland.nix b/modules/home/desktop/hyprland/hyprland.nix new file mode 100644 index 0000000..ef443cc --- /dev/null +++ b/modules/home/desktop/hyprland/hyprland.nix @@ -0,0 +1,458 @@ +{ + config, + osConfig, + perSystem, + launcher, + lockscreen, + # pkgs, + # lib, + ... +}: let + inherit (config.lib.stylix) colors; + # inherit (lib) mkIf; + hostname = osConfig.networking.hostName; + cursorSize = config.stylix.cursor.size; + fontName = config.stylix.fonts.sansSerif.name; + keyboard = + if hostname == "eldrid" + then "chromeos" + else "platform"; + xdgPictures = + config.xdg.userDirs.pictures; + # ifLaptop = mkIf (hostname != "dunamis"); +in { + enable = true; + systemd = { + enable = true; + variables = [ + "--all" + ]; + }; + package = perSystem.hyprland.hyprland; + portalPackage = perSystem.hyprland.xdg-desktop-portal-hyprland; + # plugins = with pkgs.hyprlandPlugins; [ + # hyprspace + # hy3 + # hyprscroller + # ]; + settings = { + input = { + kb_layout = "us,ua"; + resolve_binds_by_sym = + if hostname == "dunamis" + then 0 + else 1; + repeat_rate = 50; + repeat_delay = 300; + # mouse + accel_profile = "flat"; + sensitivity = 0; + }; + device = [ + { + name = "ite-tech.-inc.-ite-device(8910)-keyboard"; + kb_variant = "colemak_dh,"; + } + { + name = "at-translated-set-2-keyboard"; + kb_variant = "colemak_dh,"; + } + { + name = "keyd-virtual-keyboard"; + kb_variant = "colemak_dh,"; + } + ]; + xwayland.force_zero_scaling = true; + monitor = [ + ", preferred, auto, 1" + "desc:AOC 27V2G5 0x0000026C, addreserved, 0, 300, 0, 0" + "desc:Samsung Electric Company S24R65x H4TMA03291, preferred, 0x0, 1, bitdepth, 10, vrr, 1" + "desc:Philips Consumer Electronics Company 27M2N5500 UK02418033254, 2560x1440@180.00Hz, 0x0, 1.3333333, bitdepth, 10, vrr, 1" + "desc:BOE 0x08E8, preferred, 1920x0, 1.2, bitdepth, 10" + "desc:LG Display 0x068B, preferred, 1920x0, 1.2, bitdepth, 10" + "desc:Chimei Innolux Corporation 0x1406, preferred, 1920x0, 1.2" + "desc:KDC 0x0000, preferred, 1920x0, 1.25" + ]; + env = [ + "ELECTRON_OZONE_PLATFORM_HINT,auto" + "QT_QPA_PLATFORM,wayland" + "QT_QPA_PLATFORMTHEME,gtk3" + "XCURSORSIZE,${toString cursorSize}" + "GSK_RENDERER,ngl" + ]; + decoration = { + shadow.enabled = false; + # drop_shadow = false; + blur = { + size = 8; + passes = 3; + }; + # shadow_offset = "0 5"; + # "col.shadow" = "rgba(00000099)"; + rounding = 12; + }; + misc = { + font_family = fontName; + disable_splash_rendering = true; + disable_hyprland_logo = true; + # vfr = true; + }; + bezier = [ + "easeOutQuad, 0.25, 0.46, 0.45, 0.94" + "easeOutExpo, 0.19, 1, 0.22, 1" + ]; + animation = [ + "workspaces, 1, 3, easeOutExpo, slidefade 20%" + "windows, 1, 3, easeOutExpo, popin 80%" + "layers, 1, 2, easeOutExpo, fade" + ]; + plugin = [ + { + overview = { + gapsIn = 12; + gapsOut = 24; + exitOnClick = true; + centerAligned = true; + showNewWorkspace = false; + showEmptyWorkspace = false; + affectStrut = false; + }; + hyprexpo = { + columns = 3; + gap_size = 8; + #bg_col = "rgb(111111)"; + workspace_method = "first 1"; # [center/first] [workspace] e.g. first 1 or center m+1 + enable_gesture = true; # laptop touchpad + gesture_fingers = 3; # 3 or 4 + gesture_distance = 400; # how far is the "max" + gesture_positive = false; # positive = swipe down. Negative = swipe up.; + }; + } + { + hy3 = { + autotile = true; + tab_first_window = false; + tabs = { + render_text = true; + height = 24; + padding = 8; + rounding = 8; + text_height = 14; + text_center = true; + text_font = fontName; + + "col.active" = "0xff${colors.base00}"; + "col.inactive" = "0xff${colors.base00}"; + "col.urgent" = "0xff${colors.base00}"; + "col.active.text" = "0xff${colors.base0D}"; + "col.inactive.text" = "0xff${colors.base05}"; + "col.urgent.text" = "0xff${colors.base09}"; + "col.active.border" = "0xff${colors.base00}"; + "col.inactive.border" = "0xff${colors.base00}"; + "col.urgent.border" = "0xff${colors.base00}"; + }; + }; + } + { + scroller = { + column_widths = "onethird onehalf twothirds one"; + window_heights = "onethird onehalf twothirds one"; + gesture_scroll_fingers = 3; + gesture_overview_fingers = 3; + jump_labels_font = fontName; + jump_labels_color = "0xff${colors.base0A}"; + }; + } + ]; + + dwindle = { + force_split = 2; + default_split_ratio = 1.2; + }; + master = { + mfact = 0.6; + }; + + "$mod" = "SUPER"; + "$modShift" = "$mod SHIFT"; + "$modCtrl" = "$mod CTRL"; + "$modShiftCtrl" = "$mod SHIFT CTRL"; + + "$left" = "N"; + "$down" = "E"; + "$up" = "I"; + "$right" = "O"; + + "$terminal" = "ghostty"; + "$launcher" = launcher; + "$screenLocker" = lockscreen; + "$webBrowser" = "io.github.zen_browser.zen"; + "$clipboardManager" = "copyq menu"; + + general = { + "col.active_border" = "0xff${colors.base0D}"; + "col.inactive_border" = "0xff${colors.base03}"; + gaps_in = 4; + gaps_out = 8; + border_size = 3; + allow_tearing = true; + layout = "dwindle"; + }; + group = { + "col.border_active" = "0xff${colors.base0D}"; + "col.border_inactive" = "0xff${colors.base03}"; + "col.border_locked_active" = "0xff${colors.base0A}"; + "col.border_locked_inactive" = "0xff${colors.base0F}"; + groupbar = { + height = 16; + rounding = 0; + indicator_height = 0; + gradient_rounding = 4; + font_size = 14; + gradients = true; + font_family = fontName; + "text_color" = "0xff${colors.base00}"; + "col.active" = "0xff${colors.base0D}"; + "col.inactive" = "0xff${colors.base03}"; + }; + }; + binds.scroll_event_delay = 0; + cursor.persistent_warps = true; + + bind = [ + "$mod, Return, exec, $terminal" + "$mod, Space, exec, $launcher" + # "$modShift, Space, exec, $launcher" + "$modCtrl, Q, killactive" + "$modCtrl, M, fullscreen" + "$modCtrl, G, togglefloating" + "$mod, G, pin" + + "$mod, T, togglegroup" + "$mod, period, changegroupactive, f" + "$mod, comma, changegroupactive, b" + "$modCtrl, period, movewindoworgroup, r" + "$modCtrl, comma, movewindoworgroup, l" + + "$mod, Tab, cyclenext," + "$modShift, Tab, cyclenext, prev" + "$mod, Tab, bringactivetotop," + + "$modShift, U, focusurgentorlast" + + "$modCtrl, L, exec, $screenLocker" + "$modCtrl, B, exec, $webBrowser" + "$modCtrl, V, exec, $clipboardManager" + "$modCtrl, K, focuswindow, title:(Meet:.*)" + + # ", Print, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -o -r -c '\#\#00000000')\" -t ppm - | ${pkgs.satty}/bin/satty --filename - --fullscreen --output-filename ${xdgPictures}/screenshots/satty-$(date '+%Y%m%d-%H:%M:%S').png" + ", Print, exec, hyprshot -z -m region -o ${xdgPictures}/screenshots -f screenshot-$(date '+%Y%m%d-%H:%M:%S').png" + "CTRL, Print, exec, hyprshot -z -m window -o ${xdgPictures}/screenshots -f screenshot-$(date '+%Y%m%d-%H:%M:%S').png" + "SHIFT, Print, exec, hyprshot -z -m output -o ${xdgPictures}/screenshots -f screenshot-$(date '+%Y%m%d-%H:%M:%S').png" + ## navigation + "$mod, $left, movefocus, l" + "$mod, $down, movefocus, d" + "$mod, $up, movefocus, u" + "$mod, $right, movefocus, r" + "$modShift, $left, workspace, e-1" + "$modShift, $right, workspace, e+1" + "$mod, left, movefocus, l" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "$mod, right, movefocus, r" + "$modShift, W, focuscurrentorlast" + "$mod, mouse_down, workspace, e-1" + "$mod, mouse_up, workspace, e+1" + "$modShift, left, workspace, e-1" + "$modShift, right, workspace, e+1" + + "$modCtrl, $left, movewindow, l" + "$modCtrl, $down, movewindow, d" + "$modCtrl, $up, movewindow, u" + "$modCtrl, $right, movewindow, r" + "$modCtrl, left, movewindow, l" + "$modCtrl, up, movewindow, u" + "$modCtrl, down, movewindow, d" + "$modCtrl, right, movewindow, r" + # workspaces + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, togglespecialworkspace" + + "$modShiftCtrl, 1, movetoworkspace, 1" + "$modShiftCtrl, 2, movetoworkspace, 2" + "$modShiftCtrl, 3, movetoworkspace, 3" + "$modShiftCtrl, 4, movetoworkspace, 4" + "$modShiftCtrl, 5, movetoworkspace, 5" + "$modShiftCtrl, 6, movetoworkspace, 6" + "$modShiftCtrl, 7, movetoworkspace, 7" + "$modShiftCtrl, 8, movetoworkspace, 8" + "$modShiftCtrl, 9, movetoworkspace, 9" + "$modShiftCtrl, 0, movetoworkspace, special" + + "$mod, Q, workspace, 1" + "$mod, W, workspace, 2" + "$mod, F, workspace, 3" + "$mod, P, workspace, 4" + "$mod, B, workspace, 5" + "$mod, J, workspace, 6" + "$mod, L, workspace, 7" + "$mod, U, workspace, 8" + "$mod, Y, workspace, 9" + "$mod, apostrophe, togglespecialworkspace" + + "$modShiftCtrl, Q, movetoworkspace, 1" + "$modShiftCtrl, W, movetoworkspace, 2" + "$modShiftCtrl, F, movetoworkspace, 3" + "$modShiftCtrl, P, movetoworkspace, 4" + "$modShiftCtrl, B, movetoworkspace, 5" + "$modShiftCtrl, J, movetoworkspace, 6" + "$modShiftCtrl, L, movetoworkspace, 7" + "$modShiftCtrl, U, movetoworkspace, 8" + "$modShiftCtrl, Y, movetoworkspace, 9" + "$modShiftCtrl, apostrophe, movetoworkspace, special" + + "$modShiftCtrl, $left, movetoworkspace, e-1" + "$modShiftCtrl, $right, movetoworkspace, e+1" + "$modShiftCtrl, left, movetoworkspace, e-1" + "$modShiftCtrl, right, movetoworkspace, e+1" + + ''$mod ALT, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 1.25}')"'' + ''$mod ALT, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 1.25}')"'' + "$mod ALT, mouse:274, exec, hyprctl keyword cursor:zoom_factor 1" # middle wheel click + ]; + # binde = [ + # "$mod, comma, resizeactive, -10 0" + # "$mod, period, resizeactive, 10 0" + # "$modShift, comma, resizeactive, 0 -10" + # "$modShift, period, resizeactive, 0 10" + # ]; + bindl = [ + "$mod, Escape, exec, hyprctl switchxkblayout all next" + ", switch:on:Lid Switch, exec, hyprctl keyword monitor 'eDP-1, disable'" + ", switch:off:Lid Switch, exec, hyprctl keyword monitor 'eDP-1, preferred, 1920x0, 1.2'" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ", XF86AudioNext, exec, playerctl next" + "$modShiftCtrl ALT, Q, exit" + ]; + binde = [ + ", XF86MonBrightnessUp, exec, brightnessctl s 5%+" + ", XF86MonBrightnessDown, exec, brightnessctl s 5%-" + "ALT, XF86MonBrightnessUp, exec, brightnessctl s 5%+ -d ${keyboard}::kbd_backlight" + "ALT, XF86MonBrightnessDown, exec, brightnessctl s 5%- -d ${keyboard}::kbd_backlight" + ", XF86KbdBrightnessUp, exec, brightnessctl s 5%+ -d ${keyboard}::kbd_backlight" + ", XF86KbdBrightnessDown, exec, brightnessctl s 5%- -d ${keyboard}::kbd_backlight" + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ]; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod ALT, mouse:272, resizewindow" + ]; + gestures = { + workspace_swipe = true; + workspace_swipe_fingers = 3; + workspace_swipe_distance = 300; + }; + + workspace = [ + "1, defaultName:general" + "2, defaultName:web" + "3, defaultName:chat" + "4, defaultName:code" + "5, defaultName:uni" + "6, defaultName:games" + "7, defaultName:system" + "8, defaultName:media" + "9, defaultName:tray" + # "10, defaultName:" + ]; + windowrulev2 = [ + ## tray/misc utilities + # file picker + "float, class:xdg-desktop-portal-gtk" + "size <50% <90%, class:xdg-desktop-portal-gtk" + "center 1, class:xdg-desktop-portal-gtk" + # xdp-hyprland stream picker + "float, initialTitle:MainPicker" + # general apps + "float, class:(com.saivert.pwvucontrol)" + "float, class:(re.sonny.Junction)" + "float, class:(com.github.hluk.copyq)" + "float, class:(nm-connection-editor)" + "float, class:(.blueman-manager-wrapped)" + # telegram + "maximize, initialTitle:Медіапереглядач" + "noborder, title:TelegramDesktop" + "keepaspectratio, title:TelegramDesktop" + "noblur, title:TelegramDesktop" + "float, title:TelegramDesktop" + "pin, title:TelegramDesktop" + # any chromium-based + "noborder, title:Картинка в картинці" + "keepaspectratio, title:Картинка в картинці" + "noblur, title:Картинка в картинці" + "float, title:Картинка в картинці" + "pin, title:Картинка в картинці" + # and firefox + "noborder, title:Picture-in-Picture" + "keepaspectratio, title:Picture-in-Picture" + "noblur, title:Picture-in-Picture" + "float, title:Picture-in-Picture" + "pin, title:Picture-in-Picture" + # screenshot editor + "noanim, class:com.gabm.satty" + "float, class:com.gabm.satty" + "rounding 0, class:com.gabm.satty" + "size 100% 100%, class:com.gabm.satty" + "move 0 0, class:com.gabm.satty" + "pin, class:com.gabm.satty" + ## games + "float, class:(com.mojang.minecraft.java-edition)" + "immediate, class:(com.mojang.minecraft.java-edition)" + # cs2 + "immediate, class:(cs2)" + # deadlock + # "float, class:(steam_app_1422450)" + "fullscreen, class:(steam_app_1422450)" + "immediate, class:(steam_app_1422450)" + "immediate, initialTitle:(Ghostrunner)" + # dead by daylight + "immediate, class:deadbydaylight-egs-shipping.exe" + ## workspace assignments + "workspace name:chat, class:org.telegram.desktop" + "workspace name:chat, class:org.signal.Signal" + "workspace name:chat, class:im.riot.Riot" + "workspace name:chat, class:WebCord" + + "workspace name:games, class:com.heroicgameslauncher.hgl" + "workspace name:games, class:net.lutris.Lutris" + "workspace name:games, class:steam" + # "workspace name:game, class:" + ]; + }; + extraConfig = '' + bind = $modShift, R, submap, resize + submap = resize + binde = , right, resizeactive, 10 0 + binde = , left, resizeactive, -10 0 + binde = , up, resizeactive, 0 -10 + binde = , down, resizeactive, 0 10 + binde = , $right, resizeactive, 10 0 + binde = , $left, resizeactive, -10 0 + binde = , $up, resizeactive, 0 -10 + binde = , $down, resizeactive, 0 10 + bind = , escape, submap, reset + submap = reset + ''; +} diff --git a/modules/home/desktop/hyprland/programs/default.nix b/modules/home/desktop/hyprland/programs/default.nix new file mode 100644 index 0000000..7c2a5d0 --- /dev/null +++ b/modules/home/desktop/hyprland/programs/default.nix @@ -0,0 +1,23 @@ +{ + osConfig, + config, + inputs, + pkgs, + lib, + ... +}: let + inherit (lib) mkIf mkDefault getExe; + inherit (config.lib.stylix) colors; + inherit (osConfig.networking) hostName; + ifLaptop = mkIf (hostName != "dunamis"); +in { + imports = with inputs; [ + walker.homeManagerModules.default + ]; + options = config.desktop.hyprland.enable { + # programs.fuzzel = import ./fuzzel {inherit config mkDefault;}; + programs.walker = import ./walker {inherit config inputs pkgs;}; + programs.waybar = import ./waybar {inherit colors config getExe ifLaptop pkgs;}; + programs.hyprlock = import ./hyprlock {inherit config pkgs;}; + }; +} diff --git a/modules/home/desktop/hyprland/programs/fuzzel/default.nix b/modules/home/desktop/hyprland/programs/fuzzel/default.nix new file mode 100644 index 0000000..392d616 --- /dev/null +++ b/modules/home/desktop/hyprland/programs/fuzzel/default.nix @@ -0,0 +1,23 @@ +{ + config, + mkDefault, +}: { + enable = true; + settings = { + main = { + terminal = "$TERMINAL -e"; + fields = "filename,name,generic,keywords,categories,exec"; + dpi-aware = false; + width = 20; + horizontal-pad = 12; + vertical-pad = 12; + show-actions = true; + match-mode = "fuzzy"; + icon-theme = config.dconf.settings."org/gnome/desktop/interface".icon-theme; + }; + border = mkDefault { + width = 3; + radius = 12; + }; + }; +} diff --git a/modules/home/desktop/hyprland/programs/hyprlock/default.nix b/modules/home/desktop/hyprland/programs/hyprlock/default.nix new file mode 100644 index 0000000..be8ce29 --- /dev/null +++ b/modules/home/desktop/hyprland/programs/hyprlock/default.nix @@ -0,0 +1,94 @@ +{ + config, + pkgs, + ... +}: let + inherit (config.stylix) colors; +in { + enable = true; + settings = { + general = { + disable_loading_bar = true; + #grace = 300; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 4; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "274, 50"; + rounding = 12; + outline_thickness = 3; + position = "0, 0"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_family = "${config.stylix.fonts.serif.name}"; + font_color = "rgb(${colors.base05})"; + inner_color = "rgb(${colors.base00})"; + outer_color = "rgb(${colors.base0D})"; + check_color = "rgb(${colors.base0A})"; + fail_color = "rgb(${colors.base08})"; + placeholder_text = "locked..."; + fail_text = "wrong"; + shadow_passes = 0; + } + ]; + shape = [ + { + rounding = 12; + #border_size = 3; + size = "274, 50"; + color = "rgb(${colors.base00})"; + border_color = "rgb(${colors.base0D})"; + position = "0, 60"; + halign = "center"; + valign = "center"; + } + { + rounding = 12; + #border_size = 3; + size = "274, 50"; + color = "rgb(${colors.base00})"; + border_color = "rgb(${colors.base0D})"; + position = "0, -60"; + halign = "center"; + valign = "center"; + } + ]; + label = [ + { + monitor = ""; + text = "$LAYOUT"; #"cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +%H:%M:%S)"; + text_align = "center"; + font_size = 16; + font_family = "${config.stylix.fonts.serif.name}"; + outer_color = "rgb(${colors.base00})"; + color = "rgb(${colors.base05})"; + position = "0, 60"; + halign = "center"; + valign = "center"; + } + { + monitor = ""; + text = "cmd[update:1000] ${pkgs.uutils-coreutils-noprefix}/bin/echo $(${pkgs.uutils-coreutils-noprefix}/bin/date +'%m/%d %a %T')"; + text_align = "center"; + font_size = 16; + font_family = "${config.stylix.fonts.serif.name}"; + outer_color = "rgb(${colors.base00})"; + color = "rgb(${colors.base05})"; + position = "0, -60"; + halign = "center"; + valign = "center"; + } + ]; + }; +} diff --git a/modules/home/desktop/hyprland/programs/walker/default.nix b/modules/home/desktop/hyprland/programs/walker/default.nix new file mode 100644 index 0000000..a318f7b --- /dev/null +++ b/modules/home/desktop/hyprland/programs/walker/default.nix @@ -0,0 +1,307 @@ +{ + config, + pkgs, + ... +}: { + enable = true; + package = pkgs.walker; + runAsService = true; + config = { + activation_mode.labels = "neiotsra"; + as_window = false; + disabled = [ + "bookmarks" + "clipboard" + "custom_commands" + "translation" + "websearch" + ]; + builtins = { + applications = { + actions.enabled = true; + context_aware = true; + name = "applications"; + placeholder = "Applications"; + prioritize_new = true; + refresh = true; + show_generic = true; + show_icon_when_single = true; + show_sub_when_single = true; + weight = 10; + }; + calc = { + icon = "accessories-calculator"; + min_chars = 4; + name = "calc"; + placeholder = "Calculator"; + weight = 5; + }; + clipboard = { + image_height = 300; + max_entries = 10; + name = "clipboard"; + placeholder = "Clipboard"; + switcher_only = true; + weight = 5; + }; + commands = { + icon = "utilities-terminal"; + name = "commands"; + placeholder = "Commands"; + switcher_only = true; + weight = 8; + }; + custom_commands = { + icon = "utilities-terminal"; + name = "custom_commands"; + placeholder = "Custom Commands"; + weight = 5; + }; + dmenu = { + name = "dmenu"; + placeholder = "Dmenu"; + switcher_only = true; + weight = 5; + }; + emojis = { + history = true; + name = "emojis"; + placeholder = "Emojis"; + switcher_only = true; + typeahead = true; + weight = 5; + }; + finder = { + concurrency = 8; + icon = "folder"; + ignore_gitignore = true; + name = "finder"; + placeholder = "Finder"; + refresh = true; + switcher_only = true; + weight = 5; + }; + runner = { + generic_entry = false; + history = true; + icon = "utilities-terminal"; + name = "runner"; + placeholder = "Runner"; + refresh = true; + typeahead = true; + weight = 5; + }; + ssh = { + history = true; + icon = "preferences-system-network"; + name = "ssh"; + placeholder = "SSH"; + refresh = true; + switcher_only = true; + weight = 5; + }; + switcher = { + name = "switcher"; + placeholder = "Switcher"; + prefix = "/"; + weight = 5; + }; + websearch = { + icon = "applications-internet"; + name = "websearch"; + placeholder = "Websearch"; + weight = 5; + }; + windows = { + icon = "view-restore"; + name = "windows"; + placeholder = "Windows"; + weight = 10; + }; + }; + disable_click_to_close = false; + force_keyboard_focus = true; + list = { + max_entries = 50; + show_initial_entries = true; + single_click = true; + }; + search = { + delay = 0; + force_keyboard_focus = true; + history = true; + placeholder = "Search..."; + }; + }; + theme = { + layout = { + ui = { + anchors = { + bottom = false; + left = false; + right = false; + top = false; + }; + window = { + h_align = "center"; + v_align = "center"; + box = { + width = 450; + h_align = "center"; + v_align = "center"; + # spacing = 12; + orientation = "vertical"; + search = { + margins = { + start = 8; + top = 8; + end = 8; + bottom = 0; + }; + h_align = "top"; + }; + scroll = { + overlay_scrolling = true; + list = { + margins = { + bottom = 8; + top = 4; + start = 8; + end = 8; + }; + item = { + icon.theme = "${config.gtk.iconTheme.name}"; + spacing = 4; + activation_label = { + x_align = 0.5; + y_align = 0.5; + width = 32; + }; + text = { + h_align = "start"; + h_expand = true; + revert = true; + wrap = true; + }; + }; + }; + }; + }; + }; + }; + }; + style = let + inherit (config.lib.stylix) colors; + in '' + @define-color base00 #${colors.base00}; + @define-color base01 #${colors.base01}; + @define-color base02 #${colors.base02}; + @define-color base03 #${colors.base03}; + @define-color base04 #${colors.base04}; + @define-color base05 #${colors.base05}; + @define-color base06 #${colors.base06}; + @define-color base07 #${colors.base07}; + @define-color base08 #${colors.base08}; + @define-color base09 #${colors.base09}; + @define-color base0A #${colors.base0A}; + @define-color base0B #${colors.base0B}; + @define-color base0C #${colors.base0C}; + @define-color base0D #${colors.base0D}; + @define-color base0E #${colors.base0E}; + @define-color base0F #${colors.base0F}; + + #window, + #box, + #search, + #password, + #input, + #typeahead, + #spinner, + #list, + child, + scrollbar, + slider, + #item, + #text, + #label, + #sub, + #activationlabel { + all: unset; + } + + #window { + background: @base00; + color: @base05; + border-radius: 20px; + border: 3px solid @base0D; + } + + #box { + background: @base00; + } + + #search { + background: @base01; + border-radius: 12px 12px 6px 6px; + padding: 8px; + } + + #password, + #input, + #typeahead { + background: none; + box-shadow: none; + border-radius: 12px; + } + + #input > *:first-child, + #typeahead > *:first-child { + margin-right: 12px; + border-radius: 0px; + } + + #typeahead { + color: @base05; + } + + #input placeholder { + opacity: 0.5; + } + + #list { + padding: 8px; + border-radius: 6px 6px 12px 12px; + background: @base01; + } + + child { + box-shadow: none; + } + + child:selected, + child:hover { + box-shadow: none; + border-radius: 8px; + background: @base02; + } + + #item { + padding: 4px; + } + + #sub { + font-size: smaller; + opacity: 0.5; + } + + #activationlabel { + opacity: 0.5; + } + + .activation #activationlabel { + opacity: 1; + color: @base05; + } + ''; + }; +} diff --git a/modules/home/desktop/hyprland/programs/waybar/default.nix b/modules/home/desktop/hyprland/programs/waybar/default.nix new file mode 100644 index 0000000..637b735 --- /dev/null +++ b/modules/home/desktop/hyprland/programs/waybar/default.nix @@ -0,0 +1,331 @@ +{ + colors, + config, + getExe, + ifLaptop, + pkgs, + ... +}: { + enable = true; + systemd = { + enable = true; + target = "graphical-session.target"; + }; + settings = { + bar-0 = { + # layer = "top"; + position = "bottom"; + height = 24; + spacing = 6; + # margin-left = 33 + 3; + # margin-right = 33 + 3; + margin-left = 8; + margin-right = 8; + margin-bottom = 8; + reload_style_on_change = true; + modules-left = [ + "hyprland/language" + "hyprland/workspaces" + "wlr/taskbar" + ]; + modules-center = ["clock"]; + modules-right = [ + (ifLaptop "group/laptop") + "wireplumber" + "tray" + "privacy" + (ifLaptop "power-profiles-daemon") + "idle_inhibitor" + "custom/notification" + ]; + "niri/workspaces" = { + format = "{icon}"; + format-icons = { + "1" = "൧"; + "2" = "൨"; + "3" = "൩"; + "4" = "൪"; + "5" = "൫"; + "6" = "൬"; + "7" = "൭"; + "8" = "൮"; + "9" = "൯"; + "10" = "൰"; + general = "󰘧"; + web = "󰖟"; + chat = "󰻞"; + code = "󰅩"; + uni = "󱆀"; + games = "󰺶"; + system = "󰢻"; + media = "󱜐"; + tray = "󱊖"; + }; + }; + "niri/language" = { + format = "{}"; + format-en = "🇺🇸"; + format-uk = "🇺🇦"; + }; + "custom/separator" = { + format = "󰝠"; + interval = "once"; + tooltip = false; + }; + "group/laptop" = { + orientation = "inherit"; + modules = [ + "battery" + "backlight" + ]; + }; + "backlight" = { + format = "{icon} {percent}%"; + format-icons = [ + "󰃚" + "󰃛" + "󰃜" + "󰃝" + "󰃞" + "󰃟" + "󰃠" + ]; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = "󰅶"; + deactivated = "󰾪"; + }; + }; + "tray" = { + icon-size = 20; + spacing = 6; + }; + "clock" = { + interval = 1; + format = "{:%H:%M:%S}"; + tooltip-format = "{:%d.%m.%Y}"; + }; + battery = { + states = { + good = 95; + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-full = "󱟢 {capacity}%"; + format-charging = "󰂄 {capacity}%"; + format-plugged = "󰚥 {capacity}%"; + format-alt = "{icon} {time}"; + format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; + }; + mpris = { + format = "{player_icon} {dynamic}"; + format-paused = "{status_icon} {dynamic}"; + playing-len = 30; + playing-paused = 30; + player-icons = { + default = "▶"; + mpv = "🎵"; + }; + status-icons = {paused = "⏸";}; + }; + "upower" = { + icon-size = 16; + format = "{percentage}"; + hide-if-empty = true; + tooltip = true; + tooltip-spacing = 20; + }; + "power-profiles-daemon" = { + format = "{icon}"; + tooltip-format = "Power profile: {profile}\nDriver: {driver}"; + tooltip = true; + format-icons = { + default = "󱡮"; + performance = "󱡮"; + balanced = ""; + power-saver = ""; + }; + }; + "wireplumber" = { + scroll-step = 3; + format = "{icon} {volume}%"; + format-muted = "󰖁"; + format-icons = ["󰕿" "󰖀" "󰕾"]; + on-click = getExe pkgs.pwvucontrol; + on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle"; + }; + "custom/notification" = { + tooltip = false; + format = "{icon}"; + format-icons = { + notification = "󱅫"; + none = "󰂚"; + dnd-notification = "󰂛"; + dnd-none = "󰂛"; + }; + return-type = "json"; + exec-if = "which swaync-client"; + exec = "swaync-client -swb"; + on-click = "swaync-client -t -sw"; + on-click-right = "swaync-client -d -sw"; + escape = true; + }; + "privacy" = { + icon-spacing = 2; + icon-size = 16; + transition-duration = 250; + screenshare = { + type = "screenshare"; + tooltip = true; + tooltip-icon-size = 24; + }; + audio-in = { + type = "audio-in"; + tooltip = true; + tooltip-icon-size = 24; + }; + }; + "wlr/taskbar" = { + format = "{icon}"; + icon-size = 20; + icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}"; + tooltip-format = "{title}"; + on-click = "activate"; + }; + }; + }; + style = '' + @define-color base00 #${colors.base00}; + @define-color base01 #${colors.base01}; + @define-color base02 #${colors.base02}; + @define-color base03 #${colors.base03}; + @define-color base04 #${colors.base04}; + @define-color base05 #${colors.base05}; + @define-color base06 #${colors.base06}; + @define-color base07 #${colors.base07}; + @define-color base08 #${colors.base08}; + @define-color base09 #${colors.base09}; + @define-color base0A #${colors.base0A}; + @define-color base0B #${colors.base0B}; + @define-color base0C #${colors.base0C}; + @define-color base0D #${colors.base0D}; + @define-color base0E #${colors.base0E}; + @define-color base0F #${colors.base0F}; + * { + font-family: ${config.stylix.fonts.sansSerif.name}, FontAwesome; + font-weight: 500; + font-size: 100%; + } + window#waybar { + background-color: transparent; + color: @base05; + } + .modules-center { + background-color: transparent; + } + .mpris.stopped { + background-color: transparent; + } + .modules-left, + .modules-center, + .modules-right { + /* border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; + border-top-left-radius: 0px; + border-top-right-radius: 0px; */ + background-color: @base00; + border-radius: 24px; + border: 3px solid @base0D; + color: @base05; + padding: 0 0.4em; + } + tooltip { + background: @base01; + border: 1px solid @base0E; + } + tooltip label { + color: @base05; + } + button { + box-shadow: inset 0 -3px transparent; + border-radius: 16px; + } + button:hover { + background: inherit; + box-shadow: inset 0 -3px transparent; + } + #mode { + background-color: rgba(0, 0, 0, 0.2); + box-shadow: inset 0 -3px @base05; + } + #battery, + #backlight, + /* #workspaces, + #taskbar, + #privacy, */ + #taskbar button, + #language, + #clock, + #battery, + #backlight, + #wireplumber, + #workspaces button, + #custom-notification, + #idle_inhibitor, + #power-profiles-daemon, + #privacy-item, + #custom-separator { + padding: 0 0.3em; + } + #tray button { + padding: 0 0.3em; + margin: 0 0.2em; + } + #workspaces button.active { + color: @base0D; + } + #taskbar button:hover { + box-shadow: transparent; + } + #taskbar.empty, + window#empty { + background-color: transparent; + } + #battery.critical:not(.charging) { + color: @base09; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; + } + #power-profiles-daemon.performance { + color: @base0D; + } + #power-profiles-daemon.balanced { + color: @base0B; + } + #power-profiles-daemon.power-saver { + color: @base0A; + } + label:focus { + background-color: #000000; + } + #tray > .passive { + -gtk-icon-effect: dim; + } + #tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: @base08; + } + #privacy-item.screenshare { + color: @base0C; + } + #privacy-item.audio-in { + color: @base0E; + } + ''; +} diff --git a/modules/home/desktop/hyprland/services/default.nix b/modules/home/desktop/hyprland/services/default.nix new file mode 100644 index 0000000..b974069 --- /dev/null +++ b/modules/home/desktop/hyprland/services/default.nix @@ -0,0 +1,65 @@ +{ + # getExe, + perSystem, + # pkgs, + lockscreen, + ... +}: { + swaync = import ./swaync; + network-manager-applet.enable = true; + blueman-applet.enable = true; + playerctld.enable = true; + wpaperd.enable = true; + hyprpaper.enable = true; + copyq = { + enable = true; + package = perSystem.nixpkgs-stable.copyq; + }; + gnome-keyring = { + enable = true; + components = ["secrets"]; + }; + gammastep = { + enable = true; + provider = "manual"; + latitude = 49.6; + longitude = 36.1; + tray = true; + temperature = { + day = 6500; + night = 3000; + }; + }; + swayosd = { + enable = true; + topMargin = 0.8; + }; + udiskie = { + enable = true; + automount = false; + notify = true; + tray = "auto"; + }; + hypridle = { + enable = true; + settings = { + general = { + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + lock_cmd = "pidof hyprlock || hyprlock"; + # unlock_cmd = "loginctl unlock-session"; + }; + listener = [ + { + timeout = 600; + on-timeout = "pidof ${lockscreen} || ${lockscreen}"; + } + { + timeout = 601; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; +} diff --git a/modules/home/desktop/hyprland/services/swaync/default.nix b/modules/home/desktop/hyprland/services/swaync/default.nix new file mode 100644 index 0000000..fc2b35c --- /dev/null +++ b/modules/home/desktop/hyprland/services/swaync/default.nix @@ -0,0 +1,177 @@ +{ + enable = true; + settings = { + cssPriority = "user"; + image-visibility = "when-available"; + keyboard-shortcut = true; + relative-timestamps = true; + timeout = 5; + timeout-low = 5; + timeout-critical = 0; + script-fail-notify = true; + transition-time = 200; + + # Layer settings + layer-shell = true; + layer = "overlay"; + control-center-layer = "overlay"; + + # Notification settings + positionX = "right"; + positionY = "top"; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 32; + notification-body-image-height = 100; + notification-body-image-width = 200; + notification-window-width = 400; + + # Control center settings + control-center-positionX = "right"; + control-center-positionY = "top"; + control-center-width = 500; + control-center-exclusive-zone = true; + fit-to-screen = true; + hide-on-action = true; + hide-on-clear = false; + + # Widget settings + widgets = [ + "title" + "dnd" + "notifications" + "mpris" + ]; + + widget-config = { + title = { + text = "Notifications"; + clear-all-button = true; + button-text = "Clear All"; + }; + dnd = { + text = "Do Not Disturb"; + }; + mpris = { + image-size = 96; + image-radius = 12; + blur = true; + }; + }; + }; + style = '' + /*** Global ***/ + progress, + progressbar, + trough { + border-radius: 16px; + } + + .app-icon, + .image { + -gtk-icon-effect: none; + } + + .notification-action { + border-radius: 12px; + margin: 0.5rem; + } + + .close-button { + margin: 24px; + padding: 0.2rem; + border-radius: 16px; + } + + /*** Notifications ***/ + .notification-group.collapsed + .notification-row:not(:last-child) + .notification-action, + .notification-group.collapsed + .notification-row:not(:last-child) + .notification-default-action { + opacity: 0; + } + + .trough { + margin: 4px; + border-radius: 7px; + } + + .notification, + .notification.low, + .notification.normal, + .notification.critical, + .control-center { + margin: 16px; + border-radius: 7px; + } + + .floating-notifications, + .notification-content { + border-radius: 7px; + } + + .control-center-list { + background: transparent; + } + + /*** Widgets ***/ + /* Title widget */ + .widget-title { + margin: 0.5rem; + } + + .widget-title > label { + font-weight: bold; + } + + .widget-title > button { + border-radius: 16px; + padding: 0.5rem; + } + + /* DND Widget */ + .widget-dnd { + margin: 0.5rem; + } + + .widget-dnd > label { + font-weight: bold; + } + + .widget-dnd > switch { + border-radius: 16px; + } + + .widget-dnd > switch slider { + border-radius: 16px; + padding: 0.25rem; + } + + /* Mpris widget */ + .widget-mpris .widget-mpris-player { + border-radius: 16px; + margin: 0.5rem; + padding: 0.5rem; + } + + .widget-mpris .widget-mpris-player .widget-mpris-album-art { + border-radius: 16px; + } + + .widget-mpris .widget-mpris-player .widget-mpris-title { + font-weight: bold; + } + + .widget-mpris .widget-mpris-player .widget-mpris-subtitle { + font-weight: normal; + } + + .widget-mpris .widget-mpris-player > box > button { + border: 1px solid transparent; + border-radius: 16px; + padding: 0.25rem; + } + ''; +}