From 9e56739cc4cfc417299d8c3a487942520853e564 Mon Sep 17 00:00:00 2001 From: gytic <149968794+gytic@users.noreply.github.com> Date: Wed, 17 Sep 2025 09:30:20 +0200 Subject: [PATCH 1/4] feat: add screenshot utility --- nixos95/core.nix | 4 ++++ nixos95/keybinds.nix | 39 +++++++++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/nixos95/core.nix b/nixos95/core.nix index 5786d43..e390236 100644 --- a/nixos95/core.nix +++ b/nixos95/core.nix @@ -22,4 +22,8 @@ in lib.mkIf cfg.enable { xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + environment.systemPackages = [ + pkgs.xfce.xfce4-screenshooter + ]; + } diff --git a/nixos95/keybinds.nix b/nixos95/keybinds.nix index f9a735c..8a8d571 100644 --- a/nixos95/keybinds.nix +++ b/nixos95/keybinds.nix @@ -9,6 +9,31 @@ in { options.nixos95.keybinds = { + default_commands = lib.mkOption { + internal = true; + description = '' + INTERNAL: additional default keyboard shortcuts to add + ''; + type = t.listOf t.attrs; + default = [ + { + key = "XF86WWW"; + exe = "exo-open --launch WebBrowser"; + } + { + key = "XF86Mail"; + exe = "exo-open --launch MailReder"; + } + { + key = "Print"; + exe = "xfce4-screenshooter"; + } + { + key = "s"; + exe = "xfce4-screenshooter --fullscreen"; + } + ]; + }; commands = lib.mkOption { description = '' Keyboard shortcuts that should be made available. @@ -30,18 +55,6 @@ in { key = "r"; exe = "xfce4-appfinder --collapsed"; } - { - key = "XF86WWW"; - exe = "exo-open --launch WebBrowser"; - } - { - key = "XF86Mail"; - exe = "exo-open --launch MailReder"; - } - { - key = "Print"; - exe = "xfce4-screenshooter"; - } ]; }; xfwm4 = lib.mkOption { @@ -76,6 +89,7 @@ in { exe = lib.escapeXML (slib.getExe elm); in '' '') |> lib.concatStringsSep "\n"; + default_commands_xml = to_xml cfg.default_commands; commands_xml = to_xml cfg.commands; xfwm4_xml = to_xml cfg.xfwm4; in { @@ -88,6 +102,7 @@ in { + ${default_commands_xml} ${commands_xml} From 933b0f7ff1a7472775e20b3686dd3294aa225b83 Mon Sep 17 00:00:00 2001 From: gytic <149968794+gytic@users.noreply.github.com> Date: Wed, 17 Sep 2025 09:39:02 +0200 Subject: [PATCH 2/4] feat: add windows like whiskermenu open keybind --- nixos95/keybinds.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos95/keybinds.nix b/nixos95/keybinds.nix index 8a8d571..b67f40b 100644 --- a/nixos95/keybinds.nix +++ b/nixos95/keybinds.nix @@ -32,6 +32,10 @@ in { key = "s"; exe = "xfce4-screenshooter --fullscreen"; } + { + key = "Super_L"; + pkg = pkgs.xfce.xfce4-whiskermenu-plugin; # open whiskermenu with a press on SUPER like on windows + } ]; }; commands = lib.mkOption { From ff23d37b5c3aaa2b6b33c433a25d14bc79d14755 Mon Sep 17 00:00:00 2001 From: gytic <149968794+gytic@users.noreply.github.com> Date: Wed, 17 Sep 2025 11:25:35 +0200 Subject: [PATCH 3/4] feat: add volume control keys --- nixos95/keybinds.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nixos95/keybinds.nix b/nixos95/keybinds.nix index b67f40b..2e682c1 100644 --- a/nixos95/keybinds.nix +++ b/nixos95/keybinds.nix @@ -15,7 +15,9 @@ in { INTERNAL: additional default keyboard shortcuts to add ''; type = t.listOf t.attrs; - default = [ + default = let + amixer = lib.getExe' pkgs.alsa-utils; + in [ { key = "XF86WWW"; exe = "exo-open --launch WebBrowser"; @@ -36,6 +38,18 @@ in { key = "Super_L"; pkg = pkgs.xfce.xfce4-whiskermenu-plugin; # open whiskermenu with a press on SUPER like on windows } + { + key = "XF86AudioMute"; + exe = "${amixer} set Master toggle"; + } + { + key = "XF86AudioLowerVolume"; + exe = "${amixer} set Master 5%-"; + } + { + key = "XF86AudioRaiseVolume"; + exe = "${amixer} set Master 5%+"; + } ]; }; commands = lib.mkOption { From 8a30d60c6793ba0c1ee5a84fab43a519ac3c5567 Mon Sep 17 00:00:00 2001 From: gytic <149968794+gytic@users.noreply.github.com> Date: Wed, 17 Sep 2025 11:33:39 +0200 Subject: [PATCH 4/4] fix: switch to pactl i guess it has a wider adpotion because it just relies on pulseaudio? --- nixos95/keybinds.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos95/keybinds.nix b/nixos95/keybinds.nix index 2e682c1..0fb40a0 100644 --- a/nixos95/keybinds.nix +++ b/nixos95/keybinds.nix @@ -16,7 +16,8 @@ in { ''; type = t.listOf t.attrs; default = let - amixer = lib.getExe' pkgs.alsa-utils; + # relies on pulseaudio + pactl = lib.getExe' pkgs.pulseaudio "pactl"; in [ { key = "XF86WWW"; @@ -40,15 +41,15 @@ in { } { key = "XF86AudioMute"; - exe = "${amixer} set Master toggle"; + exe = "${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; } { key = "XF86AudioLowerVolume"; - exe = "${amixer} set Master 5%-"; + exe = "${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; } { key = "XF86AudioRaiseVolume"; - exe = "${amixer} set Master 5%+"; + exe = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; } ]; };