From 52144e42abf1f6d522f3cc964335d7d7e4111535 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Mon, 16 Dec 2024 07:06:42 +0300 Subject: [PATCH] Max: Add sway fan control steps. --- home/file/sway/module/Mod.nix | 1 + home/file/sway/module/System.nix | 29 ++++++++++++++--------------- host/x86_64-linux/max/default.nix | 16 +++++++++++++++- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/home/file/sway/module/Mod.nix b/home/file/sway/module/Mod.nix index 82e040fc..726b34e7 100644 --- a/home/file/sway/module/Mod.nix +++ b/home/file/sway/module/Mod.nix @@ -2,5 +2,6 @@ text = '' # Meta key. Use Mod1 for Alt. set $mod Mod4 + set $sysmod print ''; } diff --git a/home/file/sway/module/System.nix b/home/file/sway/module/System.nix index e2952c89..aed2ebd7 100644 --- a/home/file/sway/module/System.nix +++ b/home/file/sway/module/System.nix @@ -1,24 +1,23 @@ { ... }: let brstep = 5; - mod = "print"; in { text = '' - bindsym ${mod} input * xkb_switch_layout 0 - bindsym --to-code ${mod}+a exec 'swayscript network' - bindsym --to-code ${mod}+c exec 'systemctl reboot -i' - bindsym --to-code ${mod}+d exec 'swayscript dnd' - bindsym --to-code ${mod}+g exec 'swayscript gaming' - bindsym --to-code ${mod}+l exec 'powerlimit toggle' - bindsym --to-code ${mod}+m exec 'swayscript monitor' - bindsym --to-code ${mod}+p exec 'powersave toggle' - bindsym --to-code ${mod}+r exec 'swayscript reload' - bindsym --to-code ${mod}+v exec 'swayscript vpn' - bindsym --to-code ${mod}+x exec 'systemctl poweroff -i' - bindsym --to-code ${mod}+z exec 'systemctl suspend -i' + bindsym $sysmod input * xkb_switch_layout 0 + bindsym --to-code $sysmod+a exec 'swayscript network' + bindsym --to-code $sysmod+c exec 'systemctl reboot -i' + bindsym --to-code $sysmod+d exec 'swayscript dnd' + bindsym --to-code $sysmod+g exec 'swayscript gaming' + bindsym --to-code $sysmod+l exec 'powerlimit toggle' + bindsym --to-code $sysmod+m exec 'swayscript monitor' + bindsym --to-code $sysmod+p exec 'powersave toggle' + bindsym --to-code $sysmod+r exec 'swayscript reload' + bindsym --to-code $sysmod+v exec 'swayscript vpn' + bindsym --to-code $sysmod+x exec 'systemctl poweroff -i' + bindsym --to-code $sysmod+z exec 'systemctl suspend -i' - bindsym --to-code ${mod}+w exec light -A ${toString brstep} + bindsym --to-code $sysmod+w exec light -A ${toString brstep} bindsym XF86MonBrightnessUp exec light -A ${toString brstep} - bindsym --to-code ${mod}+s exec light -U ${toString brstep} + bindsym --to-code $sysmod+s exec light -U ${toString brstep} bindsym XF86MonBrightnessDown exec light -U ${toString brstep} ''; } diff --git a/host/x86_64-linux/max/default.nix b/host/x86_64-linux/max/default.nix index 1139d842..0e3f0e5e 100644 --- a/host/x86_64-linux/max/default.nix +++ b/host/x86_64-linux/max/default.nix @@ -1,5 +1,9 @@ # SEE: https://github.com/Sabrina-Fox/WM2-Help -{ ... }: { +{ + __findFile, + pkgs, + ... +}: { home.nixos.enable = true; user = { root = true; @@ -22,6 +26,16 @@ }; sway.extraConfig = [ "output eDP-1 scale 1.75" + "bindsym $sysmod+0 exec /run/wrappers/bin/wm2fc 0" + "bindsym $sysmod+9 exec /run/wrappers/bin/wm2fc a" + "bindsym $sysmod+1 exec /run/wrappers/bin/wm2fc 23" + "bindsym $sysmod+2 exec /run/wrappers/bin/wm2fc 46" + "bindsym $sysmod+3 exec /run/wrappers/bin/wm2fc 69" + "bindsym $sysmod+4 exec /run/wrappers/bin/wm2fc 92" + "bindsym $sysmod+5 exec /run/wrappers/bin/wm2fc 115" + "bindsym $sysmod+6 exec /run/wrappers/bin/wm2fc 138" + "bindsym $sysmod+7 exec /run/wrappers/bin/wm2fc 161" + "bindsym $sysmod+8 exec /run/wrappers/bin/wm2fc 184" ]; hwmon = { file = "temp1_input";