From de87c67a25cc9bd3275485729fca8013d1ca74e8 Mon Sep 17 00:00:00 2001 From: muon Date: Fri, 18 Oct 2024 09:12:38 +0000 Subject: [PATCH] Fix monitor name --- hosts/muho/configuration.nix | 7 ++-- hosts/muho/home.nix | 46 +++++++-------------- modules/home/desktop/i3.nix | 80 +++++++++++++++++++----------------- 3 files changed, 59 insertions(+), 74 deletions(-) diff --git a/hosts/muho/configuration.nix b/hosts/muho/configuration.nix index 34c2130..d741c2d 100644 --- a/hosts/muho/configuration.nix +++ b/hosts/muho/configuration.nix @@ -50,13 +50,13 @@ in { ## Monitors mods.monitors = { primary = { - name = "DVI-D-1"; + name = "DVI-I-1"; config = { enable = true; mode = "1920x1080"; position = "0x0"; primary = true; - rate = "60.00"; + rate = "59.93"; }; }; secondary = { @@ -65,8 +65,7 @@ in { enable = true; mode = "1280x768"; position = "1920x312"; - primary = false; - rate = "60.00"; + rate = "59.99"; }; }; }; diff --git a/hosts/muho/home.nix b/hosts/muho/home.nix index 6e9f137..72a9f7d 100644 --- a/hosts/muho/home.nix +++ b/hosts/muho/home.nix @@ -16,10 +16,16 @@ in { # Hardware preferences ## Monitors - xsession.windowManager.i3.config.workspaceOutputAssign = [{ - workspace = "1"; - output = "${cfg.monitors.primary.name}"; - }]; + xsession.windowManager.i3.config.workspaceOutputAssign = [ + { + workspace = "1"; + output = "${cfg.monitors.primary.name}"; + } + { + workspace = "2"; + output = "${cfg.monitors.secondary.name}"; + } + ]; services.autorandr.enable = true; programs.autorandr = { enable = true; @@ -31,34 +37,10 @@ in { }; profiles.default = { fingerprint = { - "${cfg.monitors.primary.name}" = '' - 00ffffffffffff004c2d850433324d43 - 1a120103803420782aee91a3544c9926 - 0f5054bfef80714f8100814081809500 - a940b30001011a3680a070381f403020 - 350006202000001a000000fd00384b1e - 5111000a202020202020000000fc0053 - 796e634d61737465720a2020000000ff - 004831414b3530303030300a202000e9 - ''; - "${cfg.monitors.secondary.name}" = '' - 00ffffffffffff00410cca1401010101 - 34100103804728788a288e9e55489724 - 16484badce0031594559615981800101 - 010101010101a91a00a0500016303020 - 3700c48e21000018662150b051001b30 - 40703600c48e21000018000000fc0050 - 68696c697073545620283529000000fd - 002f551f500e000a2020202020200156 - 020323714f930414051f101211030201 - 16150706230907078301000066030c00 - 100080011d00bc52d01e20b8285540c4 - 8e2100001a011d007251d01e206e2855 - 00c48e2100001e011d80d0721c162010 - 2c2580c48e2100009e011d8018711c16 - 20582c2500c48e2100009ef33980d072 - 382d40102c4580c48e2100001e0000f2 - ''; + "${cfg.monitors.primary.name}" = + "00ffffffffffff004c2d850433324d431a120103803420782aee91a3544c99260f5054bfef80714f8100814081809500a940b30001011a3680a070381f403020350006202000001a000000fd00384b1e5111000a202020202020000000fc0053796e634d61737465720a2020000000ff004831414b3530303030300a202000e9"; + "${cfg.monitors.secondary.name}" = + "00ffffffffffff00410cca140101010134100103804728788a288e9e5548972416484badce0031594559615981800101010101010101a91a00a05000163030203700c48e21000018662150b051001b3040703600c48e21000018000000fc005068696c697073545620283529000000fd002f551f500e000a2020202020200156020323714f930414051f10121103020116150706230907078301000066030c00100080011d00bc52d01e20b8285540c48e2100001a011d007251d01e206e285500c48e2100001e011d80d0721c1620102c2580c48e2100009e011d8018711c1620582c2500c48e2100009ef33980d072382d40102c4580c48e2100001e0000f2"; }; config = { "${cfg.monitors.primary.name}" = cfg.monitors.primary.config; diff --git a/modules/home/desktop/i3.nix b/modules/home/desktop/i3.nix index 9722e60..2807fb6 100644 --- a/modules/home/desktop/i3.nix +++ b/modules/home/desktop/i3.nix @@ -14,29 +14,30 @@ separator = ""; }; icons = "awesome5"; - blocks = [{ - block = "sound"; - format = " $icon $volume "; - click = [{ - button = "left"; - cmd = "pavucontrol"; - }]; - } { + blocks = [ + { + block = "sound"; + format = " $icon $volume "; + click = [{ + button = "left"; + cmd = "pavucontrol"; + }]; + } + { block = "time"; format = "$icon $timestamp.datetime(f:'%Y-%m-%d %a %H:%M:%S') "; interval = 1; - }]; + } + ]; }; }; xsession.windowManager.i3 = let modifier = "Mod4"; wsAmount = 10; - genSpaces = f: map builtins.toString ( - builtins.genList f wsAmount - ); - workspaces = genSpaces (x: x+1); - + genSpaces = f: map builtins.toString (builtins.genList f wsAmount); + workspaces = genSpaces (x: x + 1); + in { enable = true; config = { @@ -53,38 +54,43 @@ workspaceAutoBackAndForth = true; focus.wrapping = "yes"; + startup = [ ] ++ lib.optionals config.mods.social.enable [{ + command = "exec vesktop"; + }]; + + assigns = { + "2" = [{ class = "^electron$"; }]; + "3" = [{ class = "^Steam$"; }]; + }; + keybindings = let # modKeyComb: string -> valueAction: string # -> keys: [string] -> values: [string] # -> keybindings: attrSet { string -> string } - zipBinds = comb: action: keys: values: ( - builtins.listToAttrs (lib.zipListsWith (k: v: { + zipBinds = comb: action: keys: values: + (builtins.listToAttrs (lib.zipListsWith (k: v: { name = "${modifier}${comb}${k}"; value = "${action} ${v}"; - }) keys values) - ); + }) keys values)); - moveKeys = ["h" "j" "k" "l"]; - moveDirs = ["left" "down" "up" "right"]; + moveKeys = [ "h" "j" "k" "l" ]; + moveDirs = [ "left" "down" "up" "right" ]; - workspKeys = genSpaces (x: lib.mod (x+1) wsAmount); + workspKeys = genSpaces (x: lib.mod (x + 1) wsAmount); - in lib.mkOptionDefault ( - (zipBinds "+" "focus" moveKeys moveDirs) // - (zipBinds "+Shift+" "move" moveKeys moveDirs) // - (zipBinds "+" "workspace number" workspKeys workspaces) // - (zipBinds "+Shift+" "move container to workspace number" - workspKeys workspaces) // - { - "XF86AudioRaiseVolume" = - "exec --no-startup-id pactl set-sink-volume 0 +2%"; - "XF86AudioLowerVolume" = - "exec --no-startup-id pactl set-sink-volume 0 -2%"; - } - ); + in lib.mkOptionDefault ((zipBinds "+" "focus" moveKeys moveDirs) + // (zipBinds "+Shift+" "move" moveKeys moveDirs) + // (zipBinds "+" "workspace number" workspKeys workspaces) + // (zipBinds "+Shift+" "move container to workspace number" workspKeys + workspaces) // { + "XF86AudioRaiseVolume" = + "exec --no-startup-id pactl set-sink-volume 0 +2%"; + "XF86AudioLowerVolume" = + "exec --no-startup-id pactl set-sink-volume 0 -2%"; + }); bars = let - status_conf = + status_conf = "${config.xdg.configHome}/i3status-rust/config-default.toml"; stylix_bar = { mode = "dock"; @@ -96,9 +102,7 @@ workspaceNumbers = true; trayOutput = "primary"; } // config.lib.stylix.i3.bar; - in [ - stylix_bar - ]; + in [ stylix_bar ]; }; }; };