Set up wluma

This commit is contained in:
Kiana Sheibani 2024-06-18 22:20:22 -04:00
parent e763b564f0
commit da26a63998
4 changed files with 59 additions and 18 deletions

View file

@ -52,8 +52,8 @@ in
users.users.${username} = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
description = fullname; description = fullname;
extraGroups = [ "wheel" "networkmanager" ] extraGroups = [ "wheel" "networkmanager" "video" ]
++ lib.optionals isMobile [ "dialout" "feedbackd" "video" ]; ++ lib.optionals isMobile [ "dialout" "feedbackd" ];
shell = pkgs.fish; shell = pkgs.fish;
inherit hashedPassword; inherit hashedPassword;
}; };

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
environment.systemPackages = with pkgs; environment.systemPackages = with pkgs;
let aspell' = aspellWithDicts.override { let aspell' = aspellWithDicts.override {
@ -35,6 +35,7 @@
graphviz graphviz
texlive.combined.scheme-full texlive.combined.scheme-full
aspell' aspell'
nil
]; ];
@ -58,4 +59,13 @@
keep-derivations = true keep-derivations = true
keep-outputs = 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"
# '';
} }

View file

@ -47,7 +47,7 @@ in {
Unit = { Unit = {
Description = "Inhibit Wayland idling when media is played through pipewire"; 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" ]; After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ]; PartOf = [ "graphical-session.target" ];
ConditionEnvironment = "WAYLAND_DISPLAY"; ConditionEnvironment = "WAYLAND_DISPLAY";

View file

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { pkgs, lib, config, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
wl-clipboard wl-clipboard
@ -9,8 +9,7 @@
imv imv
]; ];
xdg.configFile = { xdg.configFile."swaynag/config".text = ''
"swaynag/config".text = ''
font=JetBrainsMono 10 font=JetBrainsMono 10
layer=top layer=top
@ -22,7 +21,6 @@
button-background=282E49F0 button-background=282E49F0
button-border-size=2 button-border-size=2
''; '';
};
# Hyprlock # Hyprlock
@ -142,4 +140,37 @@
progress-color=source #a08348 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"
# '';
} }