Compare commits
2 Commits
3c4e85d951
...
2989870873
Author | SHA1 | Date | |
---|---|---|---|
2989870873 | |||
e212225ff2 |
@ -1,7 +1,7 @@
|
||||
{...}:
|
||||
{
|
||||
imports = [
|
||||
./wm.nix
|
||||
./wm
|
||||
./nodm.nix
|
||||
./nix.nix
|
||||
];
|
||||
|
@ -14,6 +14,10 @@ in
|
||||
example = [ "steam -silent" ];
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./keybinds.nix
|
||||
];
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Common options for standalone window managers; many of these (or
|
||||
# alternatives thereof) are pulled in by desktop environments.
|
||||
@ -33,6 +37,8 @@ in
|
||||
swayidle
|
||||
libsForQt5.qtstyleplugin-kvantum
|
||||
|
||||
playerctl
|
||||
|
||||
pcmanfm-qt
|
||||
pcmanfm-qt-shim
|
||||
|
||||
@ -79,6 +85,8 @@ in
|
||||
};
|
||||
|
||||
services = {
|
||||
playerctld.enable = mkDefault true;
|
||||
|
||||
udiskie = {
|
||||
enable = mkDefault true;
|
||||
automount = mkDefault false;
|
47
home/common/wm/keybinds.nix
Normal file
47
home/common/wm/keybinds.nix
Normal file
@ -0,0 +1,47 @@
|
||||
{ pkgs, config, lib, outputs, ... }:
|
||||
let
|
||||
df = lib.mkDefault;
|
||||
mkxf = with lib; mapAttrs' (name: value: nameValuePair ("XF86" + name) (value));
|
||||
|
||||
# not rewriting this rn
|
||||
keysetting = "${outputs.packages.${pkgs.system}.wm-helpers}/bin/keysetting";
|
||||
in
|
||||
{
|
||||
options.nixfiles.common.wm = {
|
||||
keybinds = lib.mkOption {
|
||||
description = ''
|
||||
Attribute set containing wm-independent XF86 keysyms and associated
|
||||
commands (without the XF86 prefix)
|
||||
'';
|
||||
type = with lib.types; attrsOf str;
|
||||
default = {};
|
||||
example = {
|
||||
XF86AudioPlay = "playerctl play-pause";
|
||||
};
|
||||
};
|
||||
|
||||
finalKeybinds = lib.mkOption {
|
||||
description = "Keysyms with XF86 prefix";
|
||||
type = with lib.types; attrsOf str;
|
||||
default = mkxf config.nixfiles.common.wm.keybinds;
|
||||
readOnly = true;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
nixfiles.common.wm.keybinds = {
|
||||
AudioRaiseVolume = df "${keysetting} volumeup";
|
||||
AudioLowerVolume = df "${keysetting} volumedown";
|
||||
AudioMute = df "${keysetting} mute";
|
||||
AudioMicMute = df "${keysetting} micmute";
|
||||
|
||||
KbdBrightnessDown = df "${keysetting} keydown";
|
||||
KbdBrightnessUp = df "${keysetting} keyup";
|
||||
MonBrightnessDown = df "${keysetting} mondown";
|
||||
MonBrightnessUp = df "${keysetting} monup";
|
||||
|
||||
AudioPlay = df "playerctl play-pause";
|
||||
AudioPrev = df "playerctl previous";
|
||||
AudioNext = df "playerctl next";
|
||||
};
|
||||
};
|
||||
}
|
@ -322,19 +322,8 @@ in
|
||||
];
|
||||
|
||||
# repeat, ignore mods
|
||||
bindei = [
|
||||
# Volume controls
|
||||
",XF86AudioRaiseVolume, exec, ${keysetting} volumeup"
|
||||
",XF86AudioLowerVolume, exec, ${keysetting} volumedown"
|
||||
",XF86AudioMute, exec, ${keysetting} mute"
|
||||
",XF86AudioMicMute, exec, ${keysetting} micmute"
|
||||
|
||||
# brightness
|
||||
",XF86KbdBrightnessDown, exec, ${keysetting} keydown"
|
||||
",XF86KbdBrightnessUp, exec, ${keysetting} keyup"
|
||||
",XF86MonBrightnessDown, exec, ${keysetting} mondown"
|
||||
",XF86MonBrightnessUp, exec, ${keysetting} monup"
|
||||
|
||||
bindei = lib.mapAttrsToList (keysym: command: ",${keysym}, exec, ${command}") config.nixfiles.common.wm.finalKeybinds
|
||||
++ [
|
||||
];
|
||||
|
||||
bindm = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user