From 2a39fe30ecee53baf8b3916c95672d2da84221f6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 20 Sep 2024 02:07:32 +0200 Subject: [PATCH] Add scripts for handling HiDPI --- lib/modules/valhalla.nix | 6 +++++ .../machines/manuel/ManuSurface/config.nix | 1 + scripts/Arch/Scripts/deploy.fish | 2 +- scripts/Arch/Software/steam/main.fish | 24 +++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 scripts/Arch/Software/steam/main.fish diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index 2bf2bea3..cb0a618f 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -72,6 +72,12 @@ description = "The X11 keyboard layout of the system."; default = null; }; + + hidpi = mkOption { + type = types.bool; + description = "A value indicating whether the screen is hidpi."; + default = false; + }; }; }; } diff --git a/profiles/machines/manuel/ManuSurface/config.nix b/profiles/machines/manuel/ManuSurface/config.nix index c9e56677..827ae7d9 100644 --- a/profiles/machines/manuel/ManuSurface/config.nix +++ b/profiles/machines/manuel/ManuSurface/config.nix @@ -6,6 +6,7 @@ config = { valhalla = { hostname = "manu-surface"; + hidpi = true; linux.secureBoot = true; hardware = { diff --git a/scripts/Arch/Scripts/deploy.fish b/scripts/Arch/Scripts/deploy.fish index 2441b7c6..fd7e2810 100644 --- a/scripts/Arch/Scripts/deploy.fish +++ b/scripts/Arch/Scripts/deploy.fish @@ -276,7 +276,6 @@ function deploySoftware -d "Deploys a the specified software action" -a action and if collectionActive gaming if $isInstall yayinst \ - steam \ chiaki-ng \ osu-lazer-bin \ libretro \ @@ -287,6 +286,7 @@ function deploySoftware -d "Deploys a the specified software action" -a action end and source "$dir/../Software/Lutris/main.fish" $argv + and source "$dir/../Software/steam/main.fish" $argv end and if collectionActive essential && $isInstall diff --git a/scripts/Arch/Software/steam/main.fish b/scripts/Arch/Software/steam/main.fish new file mode 100644 index 00000000..f645bc2c --- /dev/null +++ b/scripts/Arch/Software/steam/main.fish @@ -0,0 +1,24 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + + function installSW + yayinst steam + end + + + function configureSW -V dir + . "$dir/../../../Common/Scripts/config.fish" + + if isEnabled valhalla.hidpi + begin + printf %s\n \ + "#!/bin/bash" \ + "export STEAM_FORCE_DESKTOPUI_SCALING=2.0" + end | sudo tee /etc/profile.d/steam.sh > /dev/null + end + end + + runInstaller $argv +end