dotfiles

My PC Dotfiles & Website

modules/desktop/hyprland/_settings/plugins.nix (1669B)


 1## Compositor Plugins
 2_: {
 3  lib,
 4  pkgs,
 5  osConfig ? null,
 6  ...
 7}:
 8lib.mkIf (osConfig != null) (
 9  let
10    inherit (osConfig.gui) fancy;
11
12    lua = import ./_lib.nix lib;
13    inherit (lua) inline;
14    luaBool = b:
15      if b
16      then "true"
17      else "false";
18
19    cursorMode =
20      if fancy
21      then "tilt"
22      else "none";
23  in {
24    # Workspaces per Monitor
25    xdg.configFile."hypr/hyprsplit/init.lua".source = "${pkgs.custom.hypr-split}/init.lua";
26    wayland.windowManager.hyprland = {
27      settings.hs = {
28        _var = inline ''(function() local hs = require("hyprsplit"); hs.config({ num_workspaces = 9 }); return hs end)()'';
29      };
30
31      plugins = with pkgs; [hyprlandPlugins.hypr-dynamic-cursors custom.hypr-overview];
32      extraConfig = ''
33        -- Cursor Effects
34        if hl.plugin.dynamic_cursors then
35          hl.config({ plugin = { dynamic_cursors = {
36            enabled = true,
37            mode = "${cursorMode}",
38            hyprcursor = { enabled = true, nearest = 1 },
39            shake = { enabled = true, effects = false, ipc = false },
40            tilt = { activation = "negative_quadratic" },
41          } } })
42        end
43
44        -- Workspace Overview
45        if hl.plugin.scrolloverview then
46          hl.config({ plugin = { scrolloverview = {
47            gesture_distance = 300,
48            scale = 0.5,
49            workspace_gap = 100,
50            layout = "vertical",
51            wallpaper = 2,
52            blur = ${luaBool fancy},
53            shadow = { enabled = ${luaBool fancy} },
54          } } })
55
56          hl.plugin.scrolloverview.gesture({ fingers = 4, direction = "up" })
57        end
58      '';
59    };
60  }
61)