diff --git a/flake.lock b/flake.lock index da9d7b3..b91ec3a 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1739552424, - "narHash": "sha256-64bBQo821rZGJ3AT2+7d+aM+JGTJlmeKISVVV7j5258=", + "lastModified": 1739553792, + "narHash": "sha256-W/VqlGtMXv4cQ1V5j1Sbfu59x8DWntEkTJWJNHo9P+Q=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "9262057cc86e7512d742a1c1ae9d7d118bb82d48", + "rev": "3a93a0a8f94fd52260b39aefc05e7bc667ded0ab", "type": "github" }, "original": { @@ -323,11 +323,11 @@ ] }, "locked": { - "lastModified": 1739470101, - "narHash": "sha256-NxNe32VB4XI/xIXrsKmIfrcgtEx5r/5s52pL3CpEcA4=", + "lastModified": 1739559906, + "narHash": "sha256-iK5BXN5uDXVe76ssYTkFHl7oNZe+hhwcO3N7EN9yxqQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "5031c6d2978109336637977c165f82aa49fa16a7", + "rev": "9daae9a67af7b4d341e2c806fa274a9c0925d7cf", "type": "github" }, "original": { diff --git a/homes/emenel/default.nix b/homes/emenel/default.nix index 3117739..05dec62 100644 --- a/homes/emenel/default.nix +++ b/homes/emenel/default.nix @@ -17,6 +17,7 @@ langs emacs swaync + shikane ]; home = { @@ -137,18 +138,6 @@ XCURSOR_SIZE = 32; XCURSOR_THEME = "Bibata-Modern-Classic"; }; - - # mounts = { - # home-emenel-filez-media = { - # Unit = { - # Description = "Filez:Media (NAS)"; - # }; - # Mount = { - # What = "/mnt/filez/media"; - # Where = "/home/emenel/filez/media"; - # }; - # }; - # }; }; # moving files! diff --git a/homes/emenel/dotfiles/dot_config/fish/functions/dim-screen.fish b/homes/emenel/dotfiles/dot_config/fish/functions/dim-screen.fish new file mode 100644 index 0000000..53bf08d --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/fish/functions/dim-screen.fish @@ -0,0 +1 @@ +#!/usr/bin/env fish diff --git a/homes/emenel/dotfiles/dot_config/fish/functions/lock-power-off-monitors.fish b/homes/emenel/dotfiles/dot_config/fish/functions/lock-power-off-monitors.fish new file mode 100644 index 0000000..3065767 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/fish/functions/lock-power-off-monitors.fish @@ -0,0 +1,5 @@ +#!/usr/bin/env fish + +function lock-power-off-monitors + loginctl lock-session && niri msg action power-off-monitors +end diff --git a/homes/emenel/dotfiles/dot_config/fish/functions/lock-suspend.fish b/homes/emenel/dotfiles/dot_config/fish/functions/lock-suspend.fish new file mode 100644 index 0000000..0dd02f8 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/fish/functions/lock-suspend.fish @@ -0,0 +1,5 @@ +#!/usr/bin/env fish + +function lock-suspend + loginctl lock-session && systemctl suspend +end diff --git a/homes/emenel/dotfiles/dot_config/shikane/config.toml b/homes/emenel/dotfiles/dot_config/shikane/config.toml index 8cecc9e..daa1ee9 100644 --- a/homes/emenel/dotfiles/dot_config/shikane/config.toml +++ b/homes/emenel/dotfiles/dot_config/shikane/config.toml @@ -1,20 +1,3 @@ -[[profile]] -name = "desk-clam" -exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] - [[profile.output]] - enable = false - search = ["m=TL140ADXP04-0", "s=", "v=Thermotrex Corporation"] - - [[profile.output]] - enable = true - search = ["m=BenQ PD2725U", "s=N2N00414019", "v=PNP(BNQ)"] - mode = "3840x2160@59.997Hz" - position = "0,0" - scale = 1.0 - transform = "normal" - adaptive_sync = false - - [[profile]] name = "desk-dual" exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] @@ -51,24 +34,7 @@ exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\"" [[profile]] -name = "projector" - -[[profile.output]] -enable = true -search = ["m=ViewSonic PJ", "s=0x01010101", "v=ViewSonic Corporation"] -mode = "1920x1200@59.95Hz" -position = "0,0" -scale = 1.0 -transform = "normal" -adaptive_sync = false - -[[profile.output]] -enable = true -search = ["m=TL140ADXP04-0", "s=", "v=Thermotrex Corporation"] - - -[[profile]] -name = "laptop-misc" +name = "misc" exec = ["notify-send shikane \"Profile $SHIKANE_PROFILE_NAME has been applied\""] [[profile.output]] enable = true diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index 81a0ac7..2da2df9 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -155,6 +155,8 @@ password=${config.sops.placeholder.filez} xwayland-satellite xwayland-run cifs-utils + ddcutil + ddcui ]; # Bootloader. @@ -165,6 +167,7 @@ password=${config.sops.placeholder.filez} efi.canTouchEfiVariables = true; }; kernelPackages = pkgs.linuxPackages_latest; + kernelModules = [ "i2c-dev" "ddcci_backlight" ]; initrd.systemd.enable = true; initrd.kernelModules = [ "nvidia" @@ -190,6 +193,8 @@ password=${config.sops.placeholder.filez} }; hardware = { + i2c.enable = true; + openrazer = { enable = true; users = [ "emenel" ]; @@ -258,10 +263,16 @@ password=${config.sops.placeholder.filez} services.udev = { extraRules = '' DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" + ACTION=="add", SUBSYSTEM=="i2c-dev", ATTR{name}=="AMDGPU DM*", TAG+="ddcci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service" + ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="ddcci*", RUN+="${pkgs.coreutils-full}/bin/chgrp video /sys/class/backlight/%k/brightness" + ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="ddcci*", RUN+="${pkgs.coreutils-full}/bin/chmod a+w /sys/class/backlight/%k/brightness" + ACTION=="add", SUBSYSTEM=="i2c-dev", ATTR{name}=="NVIDIA i2c adapter*", TAG+="ddcci", TAG+="systemd", ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service" ''; packages = [ pkgs.via pkgs.vial + pkgs.ddcutil + (pkgs.writeTextFile { name = "on-battery"; text = '' @@ -680,6 +691,7 @@ password=${config.sops.placeholder.filez} "cups" "openrazer" "plugdev" + "i2c-dev" ]; packages = with pkgs; [ git diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index e3d1e4a..e3b6fce 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -174,11 +174,6 @@ swayosd = { enable = true; }; - - kanshi = { - enable = true; - - }; }; diff --git a/modules/home/hypridle.nix b/modules/home/hypridle.nix index 8d7db55..b4875e1 100644 --- a/modules/home/hypridle.nix +++ b/modules/home/hypridle.nix @@ -7,51 +7,33 @@ general = { lock_cmd = "pidof hyprlock || hyprlock"; before_sleep_cmd = "loginctl lock-session"; + ignore_dbus_inhibit = false; + ignore_systemd_inhibit = false; }; + + # TODO add screen dimming and test configurations with different monitors listener = [ # battery timers - { - timeout = "30"; - on-timeout = "systemd-ac-power || light -O && light -S 0 && light -s razer/0003:1532:02B6.0003/backlight -S 0"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; - } - { timeout = "120"; - on-timeout = "systemd-ac-power || light -O && loginctl lock-session && niri msg action power-off-monitors"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; + on-timeout = "systemd-ac-power || lock-power-off-monitors"; } { timeout = "300"; - on-timeout = "systemd-ac-power || light -O && loginctl lock-session && systemctl suspend"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; + on-timeout = "systemd-ac-power || lock-suspend"; } # ac power timers - { - timeout = "60"; - on-timeout = "systemd-ac-power && light -O && light -S 0 && light -s razer/0003:1532:02B6.0003/backlight -S 0"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; - } - { timeout = "180"; on-timeout = "systemd-ac-power && loginctl lock-session"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; } { - timeout = "300"; - on-timeout = "systemd-ac-power && light -O && loginctl lock-session && niri msg action power-off-monitors"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; - } - - { - timeout = "900"; - on-timeout = "systemd-ac-power && light -O && loginctl lock-session && systemctl suspend"; - on-resume = "light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; + timeout = "600"; + on-timeout = "systemd-ac-power && loginctl lock-session && systemctl suspend"; } ]; diff --git a/modules/home/niri.nix b/modules/home/niri.nix index 9c8c2fc..fd15ceb 100644 --- a/modules/home/niri.nix +++ b/modules/home/niri.nix @@ -13,7 +13,7 @@ in { spawn-at-startup = [ { command = ["maestral_qt"]; } { command = ["clipse" "-listen"]; } - # { command = ["waybar"]; } + { command = ["waybar"]; } { command = [ "systemctl" "--user" "restart" "xwayland-satellite.service" ]; } ]; @@ -179,10 +179,10 @@ in { } ]; - # switch-events = with config.lib.niri.actions; { - # lid-close.action = spawn "niri msg output eDP-1 off && shikanectl switch desk-clam"; - # lid-open.action = spawn "niri msg output eDP-1 on"; - # }; + switch-events = with config.lib.niri.actions; { + lid-close.action = spawn "shikanectl switch desk-clam"; + lid-open.action = spawn "niri msg output eDP-1 on"; + }; binds = with config.lib.niri.actions; let wez = spawn "wezterm" "--config-file" "/home/emenel/.config/wezterm/launcher.lua" "start" "--always-new-process"; @@ -349,7 +349,7 @@ in { # Powers off the monitors. To turn them back on, do any input like # moving the mouse or pressing any other key. "Mod+Shift+P".action = power-off-monitors; - + "Mod+Shift+Alt+P".action = spawn "niri msg output eDP-1 on"; }; }; }; diff --git a/modules/home/waybar.nix b/modules/home/waybar.nix index ef3a28f..3e8e5d0 100644 --- a/modules/home/waybar.nix +++ b/modules/home/waybar.nix @@ -6,7 +6,7 @@ in { programs.waybar = { enable = true; package = pkgs.waybar; - systemd.enable = true; + systemd.enable = false; style = '' * { border: none;