From 19e11f46291cb76003b762ed793dbf65d4e3ad4d Mon Sep 17 00:00:00 2001
From: fqbn207 <fqbn207>
Date: Tue, 14 Jan 2025 21:46:52 +0100
Subject: [PATCH] kekl

---
 configuration.nix                    |   6 ++
 modules/nix/default.nix              |   3 +-
 modules/nix/editors/nvim/default.nix |  26 +-----
 modules/nix/editors/nvim/lualine.nix |  10 +++
 modules/nix/editors/nvim/opts.nix    |  10 ---
 modules/nix/wm/i3/alacritty.nix      |  28 +++++++
 modules/nix/wm/i3/default.nix        |  11 +++
 modules/nix/wm/i3/i3.nix             | 114 +++++++++++++++++++++++++++
 modules/nix/wm/i3/raw/i3status.conf  |  55 +++++++++++++
 9 files changed, 227 insertions(+), 36 deletions(-)
 create mode 100644 modules/nix/editors/nvim/lualine.nix
 create mode 100644 modules/nix/wm/i3/alacritty.nix
 create mode 100644 modules/nix/wm/i3/default.nix
 create mode 100644 modules/nix/wm/i3/i3.nix
 create mode 100644 modules/nix/wm/i3/raw/i3status.conf

diff --git a/configuration.nix b/configuration.nix
index 7ae25d8..061e864 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -72,6 +72,11 @@ in
   };
 
   services = {
+    xserver = {
+      enable = true;
+      displayManager.startx.enable = true;
+      windowManager.i3.enable = true;
+    };
     libinput = {
       enable = true;
     };
@@ -221,6 +226,7 @@ in
     cava
     vesktop
     pacman
+    wf-recorder
 
   ];
 
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
index f5db0f6..446e08b 100644
--- a/modules/nix/default.nix
+++ b/modules/nix/default.nix
@@ -2,7 +2,8 @@
 {
   imports = [
     ./editors/nvim/default.nix
-    ./wm/sway/default.nix
+    #./wm/sway/default.nix
+    ./wm/i3/default.nix
     ./bash.nix
     ./git.nix
     ./tmux.nix
diff --git a/modules/nix/editors/nvim/default.nix b/modules/nix/editors/nvim/default.nix
index 6eb09be..3fba9e5 100644
--- a/modules/nix/editors/nvim/default.nix
+++ b/modules/nix/editors/nvim/default.nix
@@ -18,38 +18,14 @@ in
     ./lsp.nix
     ./neotree.nix
     ./opts.nix
-    ./lualine.nix
     ./dev.nix
     ./nonels.nix
     ./treesitter.nix
   ];
   programs.nixvim = {
     enable = true;
+    colorschemes.oxocarbon.enable = true;
     plugins = {
-      transparent = {
-        enable = false;
-        settings = {
-          groups = [
-            "Normal"
-            "NormalNC"
-            "CursorLine"
-            "StatusLine"
-            "StatusLineNC"
-            "EndOfBuffer"
-
-          ];
-          exclude_groups = [ ];
-          extra_groups = [
-            "BufferLineTabClose"
-            "BufferLineBufferSelected"
-            "BufferLineFill"
-            "BufferLineBackground"
-            "BufferLineSeparator"
-            "BufferLineIndicatorSelected"
-          ];
-        };
-      };
-
       neocord = {
         enable = true;
         settings = {
diff --git a/modules/nix/editors/nvim/lualine.nix b/modules/nix/editors/nvim/lualine.nix
new file mode 100644
index 0000000..6a69eaf
--- /dev/null
+++ b/modules/nix/editors/nvim/lualine.nix
@@ -0,0 +1,10 @@
+{ config, pkgs, ... }:
+{
+  programs.nixvim = {
+    plugins = {
+      lualine = {
+        enable = true;
+      };
+    };
+  };
+}
diff --git a/modules/nix/editors/nvim/opts.nix b/modules/nix/editors/nvim/opts.nix
index 2408289..64f0b8e 100644
--- a/modules/nix/editors/nvim/opts.nix
+++ b/modules/nix/editors/nvim/opts.nix
@@ -16,13 +16,6 @@
       map('v', '<Tab>', '>gv', opts)
       map('v', '<S-Tab>', '<gv', opts)
 
-      vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
-      vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
-      vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'none' })
-      vim.api.nvim_set_hl(0, 'Pmenu', { bg = 'none' })
-
-      vim.cmd("highlight Pmenu guibg=NONE")
-
       vim.opt.shiftwidth = 2
       vim.opt.tabstop = 2 
       vim.opt.softtabstop = 2
@@ -37,9 +30,6 @@
       })
 
       vim.cmd [[
-        hi VertSplit guibg=NONE guifg=#000000
-        set laststatus=0 ruler
-        set notermguicolors
         cnoreabbrev W! w!
         cnoreabbrev Q! q!
         cnoreabbrev Qall! qall!
diff --git a/modules/nix/wm/i3/alacritty.nix b/modules/nix/wm/i3/alacritty.nix
new file mode 100644
index 0000000..55fa4ea
--- /dev/null
+++ b/modules/nix/wm/i3/alacritty.nix
@@ -0,0 +1,28 @@
+{ config, pkgs, ... }:
+{
+  programs.alacritty = {
+    enable = true;
+    settings = {
+      window.dimensions = {
+        lines = 4;
+        columns = 200;
+      };
+      font = {
+        size = 17;
+        normal = {
+          family = "FantasqueSansMono";
+          style = "Regular";
+        };
+      };
+      terminal = {
+        shell = "tmux";
+      };
+      colors = {
+        primary = {
+          foreground = "#FFFFFF";
+          background = "#161616";
+        };
+      };
+    };
+  };
+}
diff --git a/modules/nix/wm/i3/default.nix b/modules/nix/wm/i3/default.nix
new file mode 100644
index 0000000..f4f8c2d
--- /dev/null
+++ b/modules/nix/wm/i3/default.nix
@@ -0,0 +1,11 @@
+{ config, pkgs, ... }:
+{
+  imports = [
+    ./i3.nix
+    ./alacritty.nix
+  ];
+
+  home.file = {
+    ".config/i3/i3status.conf".source = ./raw/i3status.conf;
+  };
+}
diff --git a/modules/nix/wm/i3/i3.nix b/modules/nix/wm/i3/i3.nix
new file mode 100644
index 0000000..0841626
--- /dev/null
+++ b/modules/nix/wm/i3/i3.nix
@@ -0,0 +1,114 @@
+{ config, pkgs, ... }:
+{
+  xsession.windowManager.i3 = {
+    enable = true;
+    package = pkgs.i3-gaps;
+    config = {
+      gaps = {
+        inner = 5;
+        outer = 5;
+      };
+      bars = [
+        {
+          command = "${pkgs.feh}/bin/feh --bg-fill ~/.wp/gruvbox-dark-blue.png; i3status -c ~/.config/i3/i3status.conf";
+        }
+      ];
+      keybindings = {
+
+        # IMPORTANT STUFF #
+        "Mod4+Return" = "exec alacritty ";
+        "Mod4+space" = "exec ${pkgs.rofi}/bin/rofi -show run";
+        "Mod4+Q" = "kill";
+        "Mod4+Shift+R" = "restart";
+        "Mod4+Shift+S" = "exec ${pkgs.flameshot}/bin/flameshot gui";
+
+        # WINDOW STUFF #
+        "Mod4+Shift+space" = "floating toggle";
+        "Mod4+Shift+F" = "fullscreen toggle";
+        "Mod4+Left" = "focus left";
+        "Mod4+Down" = "focus down";
+        "Mod4+Up" = "focus up";
+        "Mod4+Right" = "focus right";
+
+        "Mod4+Ctrl+Right" = "resize shrink width 3 px or 3 ppt";
+        "Mod4+Ctrl+Down" = "resize grow height 3 px or 3 ppt";
+        "Mod4+Ctrl+Up" = "resize shrink height 3 px or 3 ppt";
+        "Mod4+Ctrl+Left" = "resize grow width 3 px or 3 ppt";
+
+        "Mod4+Shift+Left" = "move left";
+        "Mod4+Shift+Down" = "move down";
+        "Mod4+Shift+Up" = "move up";
+        "Mod4+Shift+Right" = "move right";
+
+        # WORKSPACES #
+        "Mod4+1" = "workspace number 1";
+        "Mod4+2" = "workspace number 2";
+        "Mod4+3" = "workspace number 3";
+        "Mod4+4" = "workspace number 4";
+        "Mod4+5" = "workspace number 5";
+        "Mod4+6" = "workspace number 6";
+        "Mod4+7" = "workspace number 7";
+        "Mod4+8" = "workspace number 8";
+        "Mod4+9" = "workspace number 9";
+
+        # MOVE WINDOW TO OTHER WS #
+        "Mod4+Shift+1" = "move container to workspace number 1";
+        "Mod4+Shift+2" = "move container to workspace number 2";
+        "Mod4+Shift+3" = "move container to workspace number 3";
+        "Mod4+Shift+4" = "move container to workspace number 4";
+        "Mod4+Shift+5" = "move container to workspace number 5";
+        "Mod4+Shift+6" = "move container to workspace number 6";
+        "Mod4+Shift+7" = "move container to workspace number 7";
+        "Mod4+Shift+8" = "move container to workspace number 8";
+        "Mod4+Shift+9" = "move container to workspace number 9";
+
+        # Audio
+        "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
+        "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
+        "XF86AudioMute" = "exec set-volume toggle-mute";
+
+        "XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop";
+        "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
+        "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
+        "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
+
+        "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
+        "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set   5%+";
+
+      };
+    };
+    extraConfig = ''
+      bar {
+        position top
+        status_command i3status -c /home/fabian/.config/i3/i3status.conf
+        colors {
+          background #161616
+          statusline #FFFFFF
+          separator  #FFFFFF
+
+          focused_workspace  #458588 #458588 #ebdbb2
+          active_workspace   #83a598 #83a598 #ebdbb2
+          inactive_workspace #504945 #504945 #ebdbb2
+          urgent_workspace   #cc241d #cc241d #504945
+        } 
+      }
+
+      set $bg #161616
+      set $red #cc241d
+      set $green #98971a
+      set $yellow #101010
+      set $blue #458588
+      set $purple #b16286
+      set $aqua #689d68
+      set $gray #a89984
+      set $darkgray #161616
+
+      floating_modifier Mod4
+
+      client.focused          $green $green $darkgray $yellow $yellow
+      client.focused_inactive $darkgray $darkgray $yellow $purple $darkgray
+      client.unfocused        $darkgray $darkgray $yellow $purple $darkgray
+      for_window [class="^.*"] border pixel 1
+    '';
+  };
+}
diff --git a/modules/nix/wm/i3/raw/i3status.conf b/modules/nix/wm/i3/raw/i3status.conf
new file mode 100644
index 0000000..af239b0
--- /dev/null
+++ b/modules/nix/wm/i3/raw/i3status.conf
@@ -0,0 +1,55 @@
+general {
+        colors = true
+        color_good = "#98971a"
+        color_bad = "#cc241d"
+        color_degraded = "#fabd2f"
+        interval = 2
+}
+
+#order += "wireless wlp4s0"
+order += "ethernet enp2s0f0u1"
+#order += "battery all"
+order += "memory"
+order += "cpu_usage"
+order += "volume master"
+order += "tztime local"
+
+volume master {
+        #format = "♪%volume" 
+        device = "default"
+        mixer = "Master"
+        mixer_idx = 0
+        # termsyn font
+        format = "🔊 %volume"
+}
+
+cpu_usage {
+        format = "%usage CPU"
+}
+
+
+wireless wlp4s0 {
+        format_up = " (%quality) %ip "
+        format_down = " ☡ WiFi "
+}
+
+ethernet enp4s0 {
+        # termsyn font
+        format_up =  "%ip"
+        #format_down = "eth0 "
+}
+
+memory {
+        format = "%used"
+        threshold_degraded = "10%"
+        format_degraded = "MEMORY: %free"
+}
+
+battery all {
+        format = "%percentage/%remaining"
+}
+
+tztime local {
+        # termsyn font
+        format = "%H:%M"
+}