From a74bf20876b3ca6623646786be10eb9593d17046 Mon Sep 17 00:00:00 2001 From: Ittihadyya Date: Sun, 24 Nov 2024 15:12:20 +0200 Subject: [PATCH] Started moving the (external) sway config into sway.hod.nix --- locale.mod.nix | 3 +- sway.mod.nix | 94 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 86 insertions(+), 11 deletions(-) diff --git a/locale.mod.nix b/locale.mod.nix index c6d5466..8250550 100644 --- a/locale.mod.nix +++ b/locale.mod.nix @@ -10,7 +10,7 @@ services.xserver.xkb.extraLayouts = { rulemak = { description = "Rulemak, Colemak based Russian phonetic layout"; - languages = ["ru"]; + languages = [ "ru" ]; symbolsFile = pkgs.fetchurl { url = "https://geert.hendrickx.be/colemak/rulemak.xkb"; hash = "sha256-S91aAlOllcpw9NWYf/vkZksfe4miZgx3BahswPWDWhU="; @@ -32,6 +32,7 @@ #┃ Ctrl ┃ Meta ┃ Alt ┃ Space ┃AltGr ⇮┃ Menu ┃ Ctrl ┃ #┗━━━━━━━┻━━━━━━━┻━━━━━━━┹───────────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┛ # monospace has fallen + # this might (should) be changed to actually fit our keyboard !!!!!!!!1 }; }; } diff --git a/sway.mod.nix b/sway.mod.nix index 375b288..d3cff21 100644 --- a/sway.mod.nix +++ b/sway.mod.nix @@ -9,16 +9,6 @@ }; environment.systemPackages = with pkgs; [ swayrbar - ]; - } - ) - ]; - personal.home_modules = [ - - ( - { pkgs, ... }: - { - home.packages = with pkgs; [ slurp grim rofi-wayland @@ -28,4 +18,88 @@ } ) ]; + personal.home_modules = [ + ( + { lib, pkgs, ... }: + wayland.windowManager.sway.config { + modifier = "Mod4"; + fonts = { + names = [ "pango" ]; + style = "monospace"; + size = 8.0; + }; + terminal = "$\{pkgs.terminator}/bin/terminator"; + + keybindings = + let + mod = wayland.windowManager.sway.config.modifier; + term = wayland.windowManager.sway.config.terminal; + in + lib.mkOptionDefault { + "${mod}+Return" = "exec ${term}"; # opens a terminal window + "${mod}+Shift+q" = "kill"; # kills the active window + "${mod}+s" = ''exec --no-startup-id rofi -run-command "/bin/sh -i -c '{cmd}'" -show combi''; + "${mod}+Tab" = "exec --no-startup-id rofi -show window"; + + }; + + assigns = { + "1:说" = [ { title = "^Signal$|Discord$"; } ]; + "2:main" = [ ]; + "3:browsing" = [ { title = "Librewolf$"; } ]; + "4:misc" = [ ]; + "5:5" = [ ]; + "6:6" = [ ]; + "7:7" = [ ]; + "8:8" = [ ]; + "9:9" = [ ]; + "0:audio" = [ { title = "pwvucontrol$|noisetorch$"; } ]; + }; + + bars = [ + { + statusCommand = "\${pkgs.swayrbar}/bin/swayrbar"; + position = "bottom"; + trayOutput = "primary"; + separatorSymbol = "·"; + workspaceButtons = true; + workspaceNumbers = false; + + colors = { + + }; + + } + ]; + output = { + DP-3 = { + mode = "3440x1440@144.000Hz"; + }; + }; + + input = { + "10429:2335:UGTABLET_11.6_inch_PenDisplay" = { + map_to_output = "UGD Artist 12 pro 0x19201012"; + }; + "type:keyboard" = { + xkb_layout = [ + "us(colemak_dh)" + "us" + # "rulemak" + ]; + xkb_options = "grp:rctrl_toggle"; + }; + }; + + gaps = { + smartGaps = true; + inner = 8.0; + outer = 2.0; + }; + + workspaceAutoBackAndForth = true; + workspaceLayout = "tabbed"; + } + ) + ]; }