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..0fb40a0 100644 --- a/nixos95/keybinds.nix +++ b/nixos95/keybinds.nix @@ -9,6 +9,50 @@ in { options.nixos95.keybinds = { + default_commands = lib.mkOption { + internal = true; + description = '' + INTERNAL: additional default keyboard shortcuts to add + ''; + type = t.listOf t.attrs; + default = let + # relies on pulseaudio + pactl = lib.getExe' pkgs.pulseaudio "pactl"; + in [ + { + 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"; + } + { + key = "Super_L"; + pkg = pkgs.xfce.xfce4-whiskermenu-plugin; # open whiskermenu with a press on SUPER like on windows + } + { + key = "XF86AudioMute"; + exe = "${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; + } + { + key = "XF86AudioLowerVolume"; + exe = "${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; + } + { + key = "XF86AudioRaiseVolume"; + exe = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + } + ]; + }; commands = lib.mkOption { description = '' Keyboard shortcuts that should be made available. @@ -30,18 +74,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 +108,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 +121,7 @@ in { + ${default_commands_xml} ${commands_xml}