Run xrandr primary fix via systemd user service
This commit is contained in:
parent
19543b5675
commit
dac6f1d220
1 changed files with 12 additions and 5 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
{ config, pkgs, lib, agenix, ... }:
|
{ config, pkgs, lib, agenix, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
tf2XrandrPrimaryFix = pkgs.writeShellScriptBin "tf2-xrandr-primary-fix" ''
|
xrandrPrimaryFix = pkgs.writeShellScript "xrandr-primary-fix" ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [ -z "''${DISPLAY:-}" ]; then
|
if [ -z "''${DISPLAY:-}" ]; then
|
||||||
|
|
@ -13,7 +13,7 @@ let
|
||||||
fi
|
fi
|
||||||
|
|
||||||
runtime_dir="''${XDG_RUNTIME_DIR:-/tmp}"
|
runtime_dir="''${XDG_RUNTIME_DIR:-/tmp}"
|
||||||
lock_path="$runtime_dir/tf2-xrandr-primary-fix.$UID.lock"
|
lock_path="$runtime_dir/xrandr-primary-fix.$UID.lock"
|
||||||
mkdir -p "$runtime_dir" 2>/dev/null || true
|
mkdir -p "$runtime_dir" 2>/dev/null || true
|
||||||
|
|
||||||
exec 9>"$lock_path"
|
exec 9>"$lock_path"
|
||||||
|
|
@ -290,9 +290,6 @@ in {
|
||||||
# desktopManager.gnome.enable = true;
|
# desktopManager.gnome.enable = true;
|
||||||
# evaluation warning: The option `services.xserver.displayManager.gdm.enable'
|
# evaluation warning: The option `services.xserver.displayManager.gdm.enable'
|
||||||
# defined in `/etc/nixos/configuration.nix' has been renamed to `services.displayManager.gdm.enable'.
|
# defined in `/etc/nixos/configuration.nix' has been renamed to `services.displayManager.gdm.enable'.
|
||||||
displayManager.sessionCommands = lib.mkAfter ''
|
|
||||||
${tf2XrandrPrimaryFix}/bin/tf2-xrandr-primary-fix &
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
ollama = {
|
ollama = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -578,6 +575,16 @@ in {
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
systemd.user.services.xrandr-primary-fix = {
|
||||||
|
description = "Fix primary display via xrandr after login";
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
after = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = xrandrPrimaryFix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# nixpkgs.config.cudaSupport = true;
|
# nixpkgs.config.cudaSupport = true;
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue