hotplug for autorandr
This commit is contained in:
parent
8b2d8949fb
commit
3aa2d0fea6
3 changed files with 44 additions and 40 deletions
|
@ -1,50 +1,52 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
services.autorandr.enable = true;
|
||||||
programs.autorandr = {
|
home-manager.users.cyryl = {...}: {
|
||||||
enable = true;
|
programs.autorandr = {
|
||||||
hooks.postswitch = {
|
enable = true;
|
||||||
"change-dpi" = ''
|
hooks.postswitch = {
|
||||||
|
"change-dpi" = ''
|
||||||
case "$AUTORANDR_CURRENT_PROFILE" in
|
case "$AUTORANDR_CURRENT_PROFILE" in
|
||||||
foureighty-docked)
|
foureighty-docked)
|
||||||
DPI=144
|
DPI=144
|
||||||
;;
|
;;
|
||||||
foureighty)
|
foureighty)
|
||||||
DPI=144
|
DPI=144
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE"
|
echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
echo "changing DPI to $DPI"
|
echo "changing DPI to $DPI"
|
||||||
${pkgs.xorg.xrandr}/bin/xrandr --dpi $DPI
|
${pkgs.xorg.xrandr}/bin/xrandr --dpi $DPI
|
||||||
'';
|
'';
|
||||||
"restart-i3" = "sudo ${pkgs.i3}/bin/i3-msg restart";
|
"restart-i3" = "sudo ${pkgs.i3}/bin/i3-msg restart";
|
||||||
};
|
|
||||||
profiles = {
|
|
||||||
"foureighty" = {
|
|
||||||
fingerprint = {
|
|
||||||
eDP-1 = "00ffffffffffff0006af362300000000001b0104a51f117802f4f5a4544d9c270f505400000001010101010101010101010101010101e65f00a0a0a040503020350035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343051414e30322e33200a00b2";
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
eDP-1 = {
|
|
||||||
enable = true;
|
|
||||||
mode = "2560x1440";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
"foureighty-docked" = {
|
profiles = {
|
||||||
fingerprint = {
|
"foureighty" = {
|
||||||
eDP-1 = "00ffffffffffff0006af362300000000001b0104a51f117802f4f5a4544d9c270f505400000001010101010101010101010101010101e65f00a0a0a040503020350035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343051414e30322e33200a00b2";
|
fingerprint = {
|
||||||
DP-1 = "00ffffffffffff0026cd4e66f3030000271d0104b53c22783ef6d5a7544b9e250d5054bfef80714f8140818081c09500b300d1c001014dd000a0f0703e8030203500544f2100001a000000ff0031313636333933393031303131000000fd00184c1fa03c000a202020202020000000fc00504c3237393255480a202020200176020320f15390050403020716011f121314201511065d5e5f2309070783010000023a801871382d40582c4500544f2100001f011d8018711c1620582c2500544f2100009fa76600a0f0701f8030205500544f2100001ff45100a0f070198030203500544f2100001f565e00a0a0a0295030203500544f2100001b000000000059";
|
eDP-1 = "00ffffffffffff0006af362300000000001b0104a51f117802f4f5a4544d9c270f505400000001010101010101010101010101010101e65f00a0a0a040503020350035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343051414e30322e33200a00b2";
|
||||||
};
|
|
||||||
config = {
|
|
||||||
eDP-1 = {
|
|
||||||
enable = false;
|
|
||||||
};
|
};
|
||||||
DP-1 = {
|
config = {
|
||||||
enable = true;
|
eDP-1 = {
|
||||||
mode = "3840x2160";
|
enable = true;
|
||||||
|
mode = "2560x1440";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"foureighty-docked" = {
|
||||||
|
fingerprint = {
|
||||||
|
eDP-1 = "00ffffffffffff0006af362300000000001b0104a51f117802f4f5a4544d9c270f505400000001010101010101010101010101010101e65f00a0a0a040503020350035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343051414e30322e33200a00b2";
|
||||||
|
DP-1 = "00ffffffffffff0026cd4e66f3030000271d0104b53c22783ef6d5a7544b9e250d5054bfef80714f8140818081c09500b300d1c001014dd000a0f0703e8030203500544f2100001a000000ff0031313636333933393031303131000000fd00184c1fa03c000a202020202020000000fc00504c3237393255480a202020200176020320f15390050403020716011f121314201511065d5e5f2309070783010000023a801871382d40582c4500544f2100001f011d8018711c1620582c2500544f2100009fa76600a0f0701f8030205500544f2100001ff45100a0f070198030203500544f2100001f565e00a0a0a0295030203500544f2100001b000000000059";
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
eDP-1 = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
DP-1 = {
|
||||||
|
enable = true;
|
||||||
|
mode = "3840x2160";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./autorandr.nix
|
||||||
|
];
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
gnome3.dconf
|
gnome3.dconf
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./autorandr.nix
|
|
||||||
./i3.nix
|
./i3.nix
|
||||||
./i3-status.nix
|
./i3-status.nix
|
||||||
./dunst.nix
|
./dunst.nix
|
||||||
|
|
Loading…
Reference in a new issue