From da26a639984dd1c319b34c5e6822b7e7e4a4b9d8 Mon Sep 17 00:00:00 2001 From: kiana-S Date: Tue, 18 Jun 2024 22:20:22 -0400 Subject: [PATCH] Set up wluma --- config/config.nix | 4 +-- config/packages.nix | 12 ++++++- home-manager/wayland/idle.nix | 2 +- home-manager/wayland/wltools.nix | 59 ++++++++++++++++++++++++-------- 4 files changed, 59 insertions(+), 18 deletions(-) diff --git a/config/config.nix b/config/config.nix index b38a28a..e627e18 100644 --- a/config/config.nix +++ b/config/config.nix @@ -52,8 +52,8 @@ in users.users.${username} = { isNormalUser = true; description = fullname; - extraGroups = [ "wheel" "networkmanager" ] - ++ lib.optionals isMobile [ "dialout" "feedbackd" "video" ]; + extraGroups = [ "wheel" "networkmanager" "video" ] + ++ lib.optionals isMobile [ "dialout" "feedbackd" ]; shell = pkgs.fish; inherit hashedPassword; }; diff --git a/config/packages.nix b/config/packages.nix index 6239f15..2391a23 100644 --- a/config/packages.nix +++ b/config/packages.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { environment.systemPackages = with pkgs; let aspell' = aspellWithDicts.override { @@ -35,6 +35,7 @@ graphviz texlive.combined.scheme-full aspell' + nil ]; @@ -58,4 +59,13 @@ keep-derivations = true keep-outputs = true ''; + + # WLuma + + # services.udev.extraRules = let core = exe: lib.getExe' pkgs.coreutils exe; in '' + # ACTION=="add", SUBSYSTEM=="backlight", RUN+="${core "chgrp"} video /sys/class/backlight/%k/brightness" + # ACTION=="add", SUBSYSTEM=="backlight", RUN+="${core "chmod"} g+w /sys/class/backlight/%k/brightness" + # ACTION=="add", SUBSYSTEM=="leds", RUN+="${core "chgrp"} video /sys/class/leds/%k/brightness" + # ACTION=="add", SUBSYSTEM=="leds", RUN+="${core "chmod"} g+w /sys/class/leds/%k/brightness" + # ''; } diff --git a/home-manager/wayland/idle.nix b/home-manager/wayland/idle.nix index 7014e21..5bec860 100644 --- a/home-manager/wayland/idle.nix +++ b/home-manager/wayland/idle.nix @@ -47,7 +47,7 @@ in { Unit = { Description = "Inhibit Wayland idling when media is played through pipewire"; - Documentation= "https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit"; + Documentation = "https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit"; After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; ConditionEnvironment = "WAYLAND_DISPLAY"; diff --git a/home-manager/wayland/wltools.nix b/home-manager/wayland/wltools.nix index 7926f26..a417f06 100644 --- a/home-manager/wayland/wltools.nix +++ b/home-manager/wayland/wltools.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, lib, config, ... }: { home.packages = with pkgs; [ wl-clipboard @@ -9,20 +9,18 @@ imv ]; - xdg.configFile = { - "swaynag/config".text = '' - font=JetBrainsMono 10 - layer=top + xdg.configFile."swaynag/config".text = '' + font=JetBrainsMono 10 + layer=top - [exit] - background=111320D0 - text=a9b1d6 - border-bottom=7BC5E4 - border-bottom-size=1 - button-background=282E49F0 - button-border-size=2 - ''; - }; + [exit] + background=111320D0 + text=a9b1d6 + border-bottom=7BC5E4 + border-bottom-size=1 + button-background=282E49F0 + button-border-size=2 + ''; # Hyprlock @@ -142,4 +140,37 @@ progress-color=source #a08348 ''; }; + + # WLuma + + # systemd.user.services.wluma = lib.mkIf (config.platform == "laptop") { + # Install.WantedBy = [ "graphical-session.target" ]; + + # Unit = { + # Description = "Adjust screen brightness based on screen contents and ambient lighting"; + # Documentation = "https://github.com/maximbaz/wluma"; + # After = [ "graphical-session-pre.target" ]; + # PartOf = [ "graphical-session.target" ]; + # ConditionEnvironment = "WAYLAND_DISPLAY"; + # }; + + # Service = { + # ExecStart = "${lib.getExe pkgs.wluma}"; + # Restart = "always"; + # RestartSec = "5"; + # PrivateNetwork = "true"; + # PrivateMounts = "false"; + # }; + # }; + + # xdg.configFile."wluma/config.toml".text = '' + # [als.iio] + # path = "/sys/bus/iio/devices" + # thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" } + + # [[output.backlight]] + # name = "eDP-1" + # path = "/sys/class/backlight/intel_backlight" + # capturer = "wlroots" + # ''; }