From a7a7e090d751613b9af14d6e176b8757b5a19722 Mon Sep 17 00:00:00 2001 From: randomuser Date: Sat, 20 Jan 2024 08:30:31 -0600 Subject: [PATCH] selectively disable one display --- boxes/x230t/default.nix | 6 ++++++ builds/utils/sh/disp | 46 ++++++++++++++++++++++++++--------------- flake.lock | 4 ++-- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/boxes/x230t/default.nix b/boxes/x230t/default.nix index d4a85d2..e2a89c8 100644 --- a/boxes/x230t/default.nix +++ b/boxes/x230t/default.nix @@ -16,8 +16,14 @@ environment.systemPackages = with pkgs; [ xscreensaver thunderbird + hue-cli + bluetuith ]; + hardware.bluetooth = { + enable = true; + }; + services.udev.extraRules = '' ACTION=="add", SUBSYSTEM=="input", KERNEL=="event[0-20]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", MODE:="0666" GROUP="usr", SYMLINK+="input/touchscreen" ''; diff --git a/builds/utils/sh/disp b/builds/utils/sh/disp index af4f988..32411e0 100755 --- a/builds/utils/sh/disp +++ b/builds/utils/sh/disp @@ -29,22 +29,34 @@ case "$(hostname)" in ;; "x230t") echo "x230t" - if - assert_edid "VGA-1" "35737dc483d2c3b1b20ea2343ce13c6c42d115febdc9634f8437e1b9f7fd3f5c" && - assert_edid "HDMI-A-1" "01887cbd23d74201e489a6334656f7db73a7b7f732a738a9f1ee2d53389f7817"; - then - echo "docked" - xrandr --output LVDS-1 --primary --mode 1366x768 --pos 1194x1080 --rotate normal \ - --output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal \ - --output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal \ - --output DP-1 --off \ - --output HDMI-2 --off \ - --output DP-2 --off - bspc monitor LVDS-1 -d 1 4 7 - bspc monitor VGA-1 -d 2 5 8 - bspc monitor HDMI-1 -d 3 6 9 - else - bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9 - fi + case "$1" in + "dockedtwo") + # assume we're connected to the two external displays + xrandr --output VGA-1 --primary --mode 1920x1080 --rotate normal \ + --output HDMI-1 --mode 1920x1080 --rotate normal --right-of VGA-1 \ + --output LVDS-1 --off + bspc monitor VGA-1 -d 1 3 5 7 9 + bspc monitor HDMI-1 -d 2 4 6 8 + ;; + *) + if + assert_edid "VGA-1" "35737dc483d2c3b1b20ea2343ce13c6c42d115febdc9634f8437e1b9f7fd3f5c" && + assert_edid "HDMI-A-1" "01887cbd23d74201e489a6334656f7db73a7b7f732a738a9f1ee2d53389f7817"; + then + echo "docked" + xrandr --output LVDS-1 --primary --mode 1366x768 --pos 1194x1080 --rotate normal \ + --output VGA-1 --mode 1920x1080 --pos 0x0 --rotate normal \ + --output HDMI-1 --mode 1920x1080 --pos 1920x0 --rotate normal \ + --output DP-1 --off \ + --output HDMI-2 --off \ + --output DP-2 --off + bspc monitor LVDS-1 -d 1 4 7 + bspc monitor VGA-1 -d 2 5 8 + bspc monitor HDMI-1 -d 3 6 9 + else + bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9 + fi + ;; + esac ;; esac diff --git a/flake.lock b/flake.lock index eb830b4..b3fb119 100644 --- a/flake.lock +++ b/flake.lock @@ -210,11 +210,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-wGl3ZnqjhpAEpTkzgjWxgsbmGX9c7TPCM4I0okuOYFE=", - "path": "/nix/store/z62lv62z8yn2vfgxk06aqdr7i6wmk2v0-source/builds", + "path": "/nix/store/6nljlgsf56x9pglryla3l480awympq84-source/builds", "type": "path" }, "original": { - "path": "/nix/store/z62lv62z8yn2vfgxk06aqdr7i6wmk2v0-source/builds", + "path": "/nix/store/6nljlgsf56x9pglryla3l480awympq84-source/builds", "type": "path" } },