From c4f8ef92349892bf2540d3fe8987ac5b58938dc0 Mon Sep 17 00:00:00 2001 From: pagedmov Date: Mon, 21 Oct 2024 11:01:06 -0400 Subject: [PATCH 1/2] altered some laptop specific settings to fit the new configuration settings from desktop --- flake.nix | 1 + hosts/laptop/default.nix | 2 +- hosts/laptop/environment.nix | 1 - hosts/laptop/hardware.nix | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 55e7ffa..0b565ab 100644 --- a/flake.nix +++ b/flake.nix @@ -90,6 +90,7 @@ stylix.nixosModules.stylix nixvim.nixosModules.nixvim nur.nixosModules.nur + nixvim.nixosModules.nixvim ]; }; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 831eeee..d7f7bf1 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -8,7 +8,7 @@ ... }: { imports = [ - ./../../modules/sys + ./../../modules/sys/configuration.nix ./hardware.nix ./boot.nix ./services.nix diff --git a/hosts/laptop/environment.nix b/hosts/laptop/environment.nix index f467e1d..aca3a1b 100644 --- a/hosts/laptop/environment.nix +++ b/hosts/laptop/environment.nix @@ -1,7 +1,6 @@ {pkgs, ...}: { environment = { variables = { - XCURSOR_SIZE = "24"; PATH = "${pkgs.clang-tools}/bin:$PATH"; }; shells = with pkgs; [ diff --git a/hosts/laptop/hardware.nix b/hosts/laptop/hardware.nix index 1c21635..4fec50b 100644 --- a/hosts/laptop/hardware.nix +++ b/hosts/laptop/hardware.nix @@ -18,23 +18,23 @@ boot.extraModulePackages = []; fileSystems."/" = { - device = "/dev/disk/by-partlabel/disk-main-root"; + device = "/dev/sda4"; fsType = "ext4"; }; fileSystems."/nix" = { - device = "/dev/disk/by-partlabel/disk-main-nix"; + device = "/dev/sda3"; fsType = "ext4"; }; fileSystems."/boot" = { - device = "/dev/disk/by-partlabel/disk-main-ESP"; + device = "/dev/sda2"; fsType = "vfat"; options = ["fmask=0077" "dmask=0077"]; }; fileSystems."/home" = { - device = "/dev/disk/by-partlabel/disk-main-home"; + device = "/dev/sda5"; fsType = "ext4"; }; From 04a704c74dce8cfa0427133d640022e7766c2e62 Mon Sep 17 00:00:00 2001 From: pagedmov Date: Mon, 21 Oct 2024 12:33:54 -0400 Subject: [PATCH 2/2] added brightness slider and battery monitor to laptop version of sidebar --- flake.nix | 1 - modules/home/environment/waybar/settings.nix | 44 +++++++++++++++++--- modules/home/environment/waybar/style.nix | 25 +++++++++++ 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 0b565ab..55e7ffa 100644 --- a/flake.nix +++ b/flake.nix @@ -90,7 +90,6 @@ stylix.nixosModules.stylix nixvim.nixosModules.nixvim nur.nixosModules.nur - nixvim.nixosModules.nixvim ]; }; diff --git a/modules/home/environment/waybar/settings.nix b/modules/home/environment/waybar/settings.nix index a129c80..7a81406 100644 --- a/modules/home/environment/waybar/settings.nix +++ b/modules/home/environment/waybar/settings.nix @@ -11,6 +11,7 @@ host, # secondary monitor will have a vertical bar on the left side # Can contain more info with two bars let + desktop = (host == "oganesson"); workspaces = { format = "{icon}"; format-icons = { @@ -21,14 +22,14 @@ let "5" = "五"; "6" = "六"; }; - persistent-workspaces = if (host == "oganesson") then { + persistent-workspaces = if desktop then { "HDMI-A-1" = [ 1 2 3 ]; "DP-1" = [ 4 5 6 ]; } else { "eDP-1" = [ 1 2 3 4 ]; }; }; - monitors = if (host == "oganesson") then [ + monitors = if desktop then [ "DP-1" "HDMI-A-1" ] else [ @@ -44,7 +45,7 @@ in name = "mainBar"; margin-left = 8; margin-top = 5; - margin-right = 8; + margin-right = if desktop then 8 else 5; mode = "dock"; modules-left = [ @@ -168,7 +169,7 @@ in programs.waybar.settings.sideBar = { layer = "bottom"; - output = if (host == "oganesson") then builtins.elemAt monitors 1 else ""; + output = if desktop then builtins.elemAt monitors 1 else builtins.elemAt monitors 0; position = "right"; margin-top = 8; margin-right = 5; @@ -176,8 +177,11 @@ in name = "sideBar"; mode = "dock"; - modules-left = [ + modules-left = if desktop then [ "hyprland/workspaces" + ] else [ + "group/brightness" + "battery" ]; modules-center = [ ]; @@ -223,5 +227,35 @@ in tooltip-format-disconnected = "Disconnected"; on-click = "hyprctl dispatch exec '[float;size 40% 55%] kitty nmtui'"; }; + + battery = { + bat = "BAT1"; + interval = 1; + tooltip-format = "{capacity}%\nTil empty: {time}"; + tooltip-format-charging = "{capacity}%\nTil full: {time}"; + format = "{icon}"; + format-icons = [ + "󰁺" "󰁻" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" + ]; + format-charging = "󰂄"; + }; + + "group/brightness" = { + orientation = "vertical"; + modules = [ + "backlight" + "backlight/slider" + ]; + }; + backlight = { + format = "󰃠"; + tooltip = "{percentage}%"; + }; + "backlight/slider" = { + min = 10; + max = 100; + orientation = "vertical"; + rotate = 180; + }; }; } diff --git a/modules/home/environment/waybar/style.nix b/modules/home/environment/waybar/style.nix index ddfedad..d585180 100644 --- a/modules/home/environment/waybar/style.nix +++ b/modules/home/environment/waybar/style.nix @@ -146,12 +146,14 @@ in font-size: 18px; } + #backlight-slider slider, #pulseaudio-slider slider { background: #${colors.color4}; background-color: transparent; box-shadow: none; } + #backlight-slider trough, #pulseaudio-slider trough { min-width: 9px; min-height: 90px; @@ -159,6 +161,7 @@ in background: #343434; } + #backlight-slider highlight, #pulseaudio-slider highlight { border-radius: 8px; background-color: #2096C0; @@ -172,5 +175,27 @@ in margin: 3px; padding: 5px 0 5px 6px; } + + #brightness { + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 10px 0px 5px 0; + } + + #backlight { + color: #${colors.color2}; + font-size: 18px; + padding: 0 4px 0 0; + } + + #battery { + color: #${colors.color4}; + font-size: 20px; + background: #${bg.dark}; + border-radius: 20px; + margin: 3px; + padding: 5px 0 5px 0px; + } ''; }