hyprland config update
This commit is contained in:
parent
321a440ba9
commit
3b750b8010
3 changed files with 18 additions and 64 deletions
|
|
@ -2,46 +2,7 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, lib, agenix, ... }:
|
||||
|
||||
let
|
||||
xrandrPrimaryFix = pkgs.writeShellScript "xrandr-primary-fix" ''
|
||||
set -euo pipefail
|
||||
|
||||
if [ -z "''${DISPLAY:-}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
runtime_dir="''${XDG_RUNTIME_DIR:-/tmp}"
|
||||
lock_path="$runtime_dir/xrandr-primary-fix.$UID.lock"
|
||||
mkdir -p "$runtime_dir" 2>/dev/null || true
|
||||
|
||||
exec 9>"$lock_path"
|
||||
if ! ${pkgs.util-linux}/bin/flock -n 9; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
XRANDR="${pkgs.xorg.xrandr}/bin/xrandr"
|
||||
AWK="${pkgs.gawk}/bin/awk"
|
||||
|
||||
pick_connected() {
|
||||
prefix="$1"
|
||||
"$XRANDR" --query | "$AWK" -v p="$prefix" '
|
||||
$2 == "connected" && $1 ~ ("^" p "(-[0-9]+)+$|^" p "[0-9]+$") { print $1; exit }
|
||||
'
|
||||
}
|
||||
|
||||
sleep 15
|
||||
|
||||
for _ in 1 2 3 4 5; do
|
||||
dp="$(pick_connected "DP" || true)"
|
||||
if [ -n "$dp" ]; then
|
||||
"$XRANDR" --output "$dp" --primary --auto >/dev/null 2>&1 && exit 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
'';
|
||||
in {
|
||||
{ config, pkgs, lib, agenix, ... }: {
|
||||
imports = [ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
|
@ -167,7 +128,7 @@ in {
|
|||
|
||||
gamescope = {
|
||||
enable = true;
|
||||
# capSysNice = true;
|
||||
capSysNice = true;
|
||||
};
|
||||
|
||||
virt-manager.enable = true;
|
||||
|
|
@ -214,7 +175,7 @@ in {
|
|||
nano.enable = false;
|
||||
steam = {
|
||||
enable = true;
|
||||
# gamescopeSession.enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
starship.enable = true;
|
||||
java.enable = true;
|
||||
|
|
@ -473,6 +434,7 @@ in {
|
|||
# sound.enable = true;
|
||||
services.pulseaudio.enable = false;
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.uinput.enable = true;
|
||||
security.rtkit.enable = true;
|
||||
|
||||
environment.sessionVariables = { };
|
||||
|
|
@ -575,16 +537,6 @@ in {
|
|||
|
||||
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;
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
|
@ -597,6 +549,7 @@ in {
|
|||
hyfetch
|
||||
cacert
|
||||
fragments
|
||||
antimicrox
|
||||
kitty
|
||||
lutris
|
||||
protonup-qt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue