From 84da86bb1776415ae9c4031b8fd1a2d8d5e1cb25 Mon Sep 17 00:00:00 2001 From: Mans Ziesel Date: Thu, 8 Jun 2023 15:11:21 +0200 Subject: [PATCH] try and fix monitors --- home-manager/home.nix | 1 + home-manager/i3.nix | 60 ++++++++++++--------------------- home-manager/i3status-rust.toml | 2 -- nixos/configuration.nix | 2 +- nixos/i3.nix | 7 ++++ update.sh | 2 ++ 6 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 home-manager/i3status-rust.toml create mode 100755 update.sh diff --git a/home-manager/home.nix b/home-manager/home.nix index 33a1777..1f1f24d 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -45,6 +45,7 @@ home.packages = with pkgs; [ steam librewolf + kitty ]; # Enable home-manager and git diff --git a/home-manager/i3.nix b/home-manager/i3.nix index 9a72f70..8f26a38 100644 --- a/home-manager/i3.nix +++ b/home-manager/i3.nix @@ -1,45 +1,29 @@ { config, lib, pkgs, ... }: -let - mod = "Mod1"; -in { - xsession = { +{ + xsession.windowManager.i3 = { enable = true; - windowManager.i3 = { - enable = true; - config = { - modifier = mod; + config = { + bars = [ + { + position = "top"; + statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-top.toml"; + } + ]; + }; + }; - # fonts = ["DejaVu Sans Mono, FontAwesome 6"]; - - # keybindings = lib.mkOptionDefault { - # "${mod}+p" = "exec ${pkgs.dmenu}/bin/dmenu_run"; - # "${mod}+x" = "exec sh -c '${pkgs.maim}/bin/maim -s | xclip -selection clipboard -t image/png'"; - # "${mod}+Shift+x" = "exec sh -c '${pkgs.i3lock}/bin/i3lock -c 222222 & sleep 5 && xset dpms force of'"; - - # # Focus - # "${mod}+j" = "focus left"; - # "${mod}+k" = "focus down"; - # "${mod}+l" = "focus up"; - # "${mod}+semicolon" = "focus right"; - - # # Move - # "${mod}+Shift+j" = "move left"; - # "${mod}+Shift+k" = "move down"; - # "${mod}+Shift+l" = "move up"; - # "${mod}+Shift+semicolon" = "move right"; - - # # My multi monitor setup - # # "${mod}+m" = "move workspace to output DP-2"; - # # "${mod}+Shift+m" = "move workspace to output DP-5"; - # }; - - # bars = [ - # { - # position = "bottom"; - # statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${./i3status-rust.toml}"; - # } - # ]; + programs.i3status-rust = { + enable = true; + bars = { + top = { + blocks = [ + { + block = "time"; + interval = 60; + format = "%a %d/%m %k:%M %p"; + } + ]; }; }; }; diff --git a/home-manager/i3status-rust.toml b/home-manager/i3status-rust.toml deleted file mode 100644 index 8555dff..0000000 --- a/home-manager/i3status-rust.toml +++ /dev/null @@ -1,2 +0,0 @@ -theme = "gruvgox-dark" -icons = "awesome" diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 3adfe85..fd5c963 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -12,7 +12,7 @@ # You can also split up your configuration and import pieces of it here: # ./users.nix ./network.nix - # ./i3.nix + ./i3.nix # Import home-manager's NixOS module inputs.home-manager.nixosModules.home-manager diff --git a/nixos/i3.nix b/nixos/i3.nix index 48da632..d65c213 100644 --- a/nixos/i3.nix +++ b/nixos/i3.nix @@ -4,6 +4,13 @@ environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw # Define the i3 window manager configuration services.xserver = { + xrandrHeads = { + [ + "HDMI-1 --auto --left-of DP-1" + "DP-1 --auto --primary --right-of HDMI-1" + ]; + }; + enable = true; desktopManager = { diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..5578337 --- /dev/null +++ b/update.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sudo nixos-rebuild switch --flake .#nixos-mans