From 8865577c38852726c2aed4429b600383886e6364 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 5 Aug 2023 22:57:54 -0600 Subject: [PATCH] [NixOS] Try a bunch of things to make autorandr work --- dotfiles/config/autorandr/postswitch | 3 +++ nixos/desktop.nix | 13 ++++++++----- nixos/flake.nix | 2 +- nixos/home-manager.nix | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) mode change 100644 => 100755 dotfiles/config/autorandr/postswitch diff --git a/dotfiles/config/autorandr/postswitch b/dotfiles/config/autorandr/postswitch old mode 100644 new mode 100755 index 161bfa6a..633541f0 --- a/dotfiles/config/autorandr/postswitch +++ b/dotfiles/config/autorandr/postswitch @@ -1 +1,4 @@ +#!/usr/bin/env bash +notify-send -i display "Display profile" "$AUTORANDR_CURRENT_PROFILE" systemctl --user restart random-background + diff --git a/nixos/desktop.nix b/nixos/desktop.nix index 6bff692c..ed026b2c 100644 --- a/nixos/desktop.nix +++ b/nixos/desktop.nix @@ -19,6 +19,10 @@ sessionCommands = '' systemctl --user import-environment GDK_PIXBUF_MODULE_FILE DBUS_SESSION_BUS_ADDRESS PATH ''; + setupCommands = '' + autorandr -c + systemctl restart autorandr.service + ''; }; }; @@ -26,16 +30,15 @@ enable = true; }; - systemd.services.autorandr-startup = { - partOf = [ "graphical-session.target" ]; - description = "autorandr"; + systemd.services.autorandr-startup-after-dm = { + wantedBy = [ "display-manager.service" ]; + after = [ "display-manager.service" ]; + description = "autorandr after display manager"; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.autorandr}/bin/autorandr --change"; }; - - wantedBy = [ "graphical-session.target" ]; }; # This is for the benefit of VSCODE running natively in wayland diff --git a/nixos/flake.nix b/nixos/flake.nix index daebd050..51b7f58e 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -7,7 +7,7 @@ }; home-manager = { - url = "github:nix-community/home-manager"; + url = "github:IvanMalison/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/nixos/home-manager.nix b/nixos/home-manager.nix index 40740e02..8d4add2c 100644 --- a/nixos/home-manager.nix +++ b/nixos/home-manager.nix @@ -28,7 +28,7 @@ inputs: { pkgs, config, ... }: { }; services.blueman-applet = { - enable = false; + enable = true; }; services.taffybar = {