Files
nixos-config/home/packages/wayland/niri/_binds.nix
T

76 lines
3.6 KiB
Nix

{pkgs}: {
"XF86AudioPlay" = {
_props.allow-when-locked = true;
spawn._args = ["playerctl" "play-pause"];
};
"XF86AudioStop" = {
_props.allow-when-locked = true;
spawn._args = ["playerctl" "stop"];
};
"XF86AudioNext" = {
_props.allow-when-locked = true;
spawn._args = ["playerctl" "next"];
};
"XF86AudioPrev" = {
_props.allow-when-locked = true;
spawn._args = ["playerctl" "previous"];
};
"XF86AudioMute" = {
_props.allow-when-locked = true;
spawn._args = ["sh" "-c" "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && notify-send -e -h string:x-canonical-private-synchronous:volume -h \"int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}')\" -c osd \"Volume\""];
};
"XF86AudioMicMute" = {
_props.allow-when-locked = true;
spawn._args = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"];
};
"XF86AudioRaiseVolume" = {
_props.allow-when-locked = true;
spawn._args = ["sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ && notify-send -e -h string:x-canonical-private-synchronous:volume -h \"int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}')\" -c osd \"Volume\""];
};
"XF86AudioLowerVolume" = {
_props.allow-when-locked = true;
spawn._args = ["sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && notify-send -e -h string:x-canonical-private-synchronous:volume -h \"int:value:$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}')\" -c osd \"Volume\""];
};
"XF86MonBrightnessUp" = {
_props.allow-when-locked = true;
spawn._args = ["sh" "-c" "brightnessctl set 10%+ && notify-send -e -h string:x-canonical-private-synchronous:brightness -h \"int:value:$(brightnessctl -m | cut -d, -f4 | tr -d '%')\" -c osd \"Brightness\""];
};
"XF86MonBrightnessDown" = {
_props.allow-when-locked = true;
spawn._args = ["sh" "-c" "brightnessctl set 10%- && notify-send -e -h string:x-canonical-private-synchronous:brightness -h \"int:value:$(brightnessctl -m | cut -d, -f4 | tr -d '%')\" -c osd \"Brightness\""];
};
"Print".spawn._args = ["sh" "-c" "grim -g \"$(slurp)\" - | satty --filename - --output-filename ~/Pictures/Screenshots/satty-$(date +%Y%m%d-%H%M%S).png"];
"Mod+B".spawn._args = ["zen"];
"Mod+Return".spawn._args = ["alacritty"];
"Mod+Q".close-window = {};
"Mod+Shift+P".spawn._args = ["rofi-powermenu"];
"Mod+S".switch-preset-column-width = {};
"Mod+F".fullscreen-window = {};
"Mod+1".set-column-width = "25%";
"Mod+2".set-column-width = "50%";
"Mod+3".set-column-width = "75%";
"Mod+4".set-column-width = "100%";
"Mod+Shift+F".expand-column-to-available-width = {};
"Mod+Space".spawn._args = ["walker"];
"Mod+Shift+Space".toggle-window-floating = {};
"Mod+W".toggle-column-tabbed-display = {};
"Mod+Comma".consume-window-into-column = {};
"Mod+Period".expel-window-from-column = {};
"Mod+C".center-visible-columns = {};
"Mod+Tab".switch-focus-between-floating-and-tiling = {};
"Mod+Minus".set-column-width = "-10%";
"Mod+Plus".set-column-width = "+10%";
"Mod+Shift+Minus".set-window-height = "-10%";
"Mod+Shift+Plus".set-window-height = "+10%";
"Mod+Left".focus-column-left = {};
"Mod+Right".focus-column-right = {};
"Mod+Down".focus-workspace-down = {};
"Mod+Up".focus-workspace-up = {};
"Mod+Shift+Left".move-column-left = {};
"Mod+Shift+Right".move-column-right = {};
"Mod+Shift+Up".move-column-to-workspace-up = {};
"Mod+Shift+Down".move-column-to-workspace-down = {};
"Mod+P" = {spawn-sh = "wl-mirror $(niri msg --json focused-output | jq -r .name)";};
# "Mod+Alt".toggle-overview = { repeat=false; };
}