From 7bca03fe4874a5d78e11ee39edb9a43ddb018df6 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sun, 23 Jun 2024 18:49:50 +0300 Subject: [PATCH] Gnome : Add system controls. --- module/common/nvim/module/key/Navigation.nix | 4 +-- module/desktop/dconf/Key.nix | 37 +++++++++++++++++++- part/Setting.nix | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/module/common/nvim/module/key/Navigation.nix b/module/common/nvim/module/key/Navigation.nix index c1fa7f6..a2d381d 100644 --- a/module/common/nvim/module/key/Navigation.nix +++ b/module/common/nvim/module/key/Navigation.nix @@ -16,8 +16,8 @@ in { rekey_normal("q", "BufferLineCyclePrev") -- Splits. - rekey_normal("-", "vsplit") - rekey_normal("\\", "split") + rekey_normal("\\", "vsplit") + rekey_normal("-", "split") rekey_normal("=", "=") -- Equalize split sizes. rekey_normal("c", "q") -- Close split. diff --git a/module/desktop/dconf/Key.nix b/module/desktop/dconf/Key.nix index b37c261..2a018e1 100644 --- a/module/desktop/dconf/Key.nix +++ b/module/desktop/dconf/Key.nix @@ -1,4 +1,4 @@ -{ ... }: let +{ setting, ... }: let mod = ""; in { "org/gnome/desktop/wm/keybindings" = { @@ -62,6 +62,11 @@ in { "org/gnome/settings-daemon/plugins/media-keys" = { custom-keybindings = [ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/" ]; magnifier = [ "" ]; magnifier-zoom-in = [ "" ]; @@ -76,6 +81,36 @@ in { name = "gnome-terminal"; }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "${setting.sysctrl}z"; + command = "systemctl suspend -i"; + name = "System Sleep"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = { + binding = "${setting.sysctrl}x"; + command = "systemctl poweroff -i"; + name = "System Poweroff"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3" = { + binding = "${setting.sysctrl}c"; + command = "systemctl reboot -i"; + name = "System Reboot"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4" = { + binding = "${setting.sysctrl}p"; + command = "powersave toggle"; + name = "Toggle Powersave"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5" = { + binding = "${setting.sysctrl}l"; + command = "powerlimit toggle"; + name = "Toggle Powerlimit"; + }; + "org/gnome/shell/keybindings" = { focus-active-notification = [ "" ]; open-application-menu = [ "" ]; diff --git a/part/Setting.nix b/part/Setting.nix index e142a88..20fc84e 100644 --- a/part/Setting.nix +++ b/part/Setting.nix @@ -5,7 +5,7 @@ browser.bin = "firefox-esr"; terminal.bin = "foot"; dpiAware = false; - sysctrl = "print"; + sysctrl = "Print"; keyboard = { layouts = "us,ru";