diff --git a/modules/home/workstation/hyprland/settings/options/default.nix b/modules/home/workstation/hyprland/settings/options/default.nix index a7d5605..d59c620 100644 --- a/modules/home/workstation/hyprland/settings/options/default.nix +++ b/modules/home/workstation/hyprland/settings/options/default.nix @@ -67,6 +67,7 @@ title = mkRuleOption str "Window title matcher"; initialClass = mkRuleOption str "Initial window class matcher"; initialTitle = mkRuleOption str "Initial window title matcher"; + tag = mkRuleOption str "Window tag matcher"; xwayland = mkRuleOption bool "Match XWayland windows"; floating = mkRuleOption bool "Match floating windows"; fullscreen = mkRuleOption bool "Match fullscreen windows"; @@ -137,4 +138,3 @@ in { flatten (map formatWindowRule cfg.windowRules); }; } - diff --git a/modules/home/workstation/hyprland/settings/options/rules.nix b/modules/home/workstation/hyprland/settings/options/rules.nix index 24040a1..99b5356 100644 --- a/modules/home/workstation/hyprland/settings/options/rules.nix +++ b/modules/home/workstation/hyprland/settings/options/rules.nix @@ -230,6 +230,10 @@ name = "minsize"; regex = ["${patterns.int} ${patterns.int}"]; }; + animation = mkRegexTarget { + name = "animation"; + regex = ["(slide)( (left|right|up|down|top|bottom))?|(popin)( ([0-9]+%))?"]; + }; } // toggleTargets; in { diff --git a/modules/home/workstation/hyprland/settings/rules.nix b/modules/home/workstation/hyprland/settings/rules.nix index 0edfa89..5296acd 100644 --- a/modules/home/workstation/hyprland/settings/rules.nix +++ b/modules/home/workstation/hyprland/settings/rules.nix @@ -1,9 +1,37 @@ -{ +{osConfig, ...}: let + monitor = builtins.elemAt osConfig.ooknet.hardware.monitors 0; + + widthMinusGaps = toString (monitor.width - 23); +in { wayland.windowManager.hyprland.windowRules = [ # TODO tag games for immediate + { + matches = {class = "factorio";}; + rules = ["tag +games"]; + } + { + matches = {initialTitle = "World of Warcraft";}; + rules = ["tag +games"]; + } { matches = {title = "TEKKEN™8";}; - rules = ["immediate"]; + rules = ["tag +games"]; + } + { + matches = {initialTitle = "Dolphin";}; + rules = ["tag +games" "idleinhibit focus"]; + } + { + matches = {tag = "games";}; + rules = ["workspace 6" "immediate"]; + } + { + matches = {title = "Steam";}; + rules = ["workspace 5"]; + } + { + matches = {title = "Steam Settings";}; + rules = ["float" "size 50%" "center 1"]; } { matches = {class = "firefox";}; @@ -29,5 +57,15 @@ matches = {title = "^(Open Files)$";}; rules = ["center 1" "float" "size 50%"]; } + { + matches = {initialTitle = "foot-dropdown";}; + rules = [ + "monitor 0" + "animation slide down" + "float" + "move 12 46" + "size ${widthMinusGaps} 30%" + ]; + } ]; }