mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 08:28:11 +09:00
keybind
This commit is contained in:
@@ -2,19 +2,39 @@
|
|||||||
let
|
let
|
||||||
systemctl = lib.getExe' pkgs.systemd "systemctl";
|
systemctl = lib.getExe' pkgs.systemd "systemctl";
|
||||||
|
|
||||||
action = key: name: {
|
keybind = key: actionAttrs: {
|
||||||
"@key" = key;
|
"@key" = key;
|
||||||
action = {
|
action = actionAttrs;
|
||||||
"@name" = name;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
execute = key: command: {
|
action =
|
||||||
"@key" = key;
|
key: name:
|
||||||
action = {
|
keybind key {
|
||||||
|
"@name" = name;
|
||||||
|
};
|
||||||
|
|
||||||
|
execute =
|
||||||
|
key: command:
|
||||||
|
keybind key {
|
||||||
"@name" = "Execute";
|
"@name" = "Execute";
|
||||||
"@command" = command;
|
"@command" = command;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
snapToEdge =
|
||||||
|
key: direction:
|
||||||
|
keybind key {
|
||||||
|
"@name" = "SnapToEdge";
|
||||||
|
"@direction" = direction;
|
||||||
|
"@combine" = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
|
confirmAction = key: message: name: {
|
||||||
|
"@key" = key;
|
||||||
|
action = {
|
||||||
|
"@name" = "If";
|
||||||
|
prompt."@message" = message;
|
||||||
|
"then".action."@name" = name;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -40,6 +60,7 @@ in
|
|||||||
default = true;
|
default = true;
|
||||||
numlock = "on";
|
numlock = "on";
|
||||||
keybind = [
|
keybind = [
|
||||||
|
# labwc window management
|
||||||
(action "W-q" "Close")
|
(action "W-q" "Close")
|
||||||
(action "W-f" "ToggleMaximize")
|
(action "W-f" "ToggleMaximize")
|
||||||
(action "W-c" "Iconify")
|
(action "W-c" "Iconify")
|
||||||
@@ -49,56 +70,36 @@ in
|
|||||||
(action "W-Down" "Raise")
|
(action "W-Down" "Raise")
|
||||||
(action "W-Left" "NextWindow")
|
(action "W-Left" "NextWindow")
|
||||||
(action "W-Right" "PreviousWindow")
|
(action "W-Right" "PreviousWindow")
|
||||||
{
|
(snapToEdge "W-C-Left" "left")
|
||||||
"@key" = "W-C-Left";
|
(snapToEdge "W-C-Right" "right")
|
||||||
action = {
|
(snapToEdge "W-C-Up" "up")
|
||||||
"@name" = "SnapToEdge";
|
(snapToEdge "W-C-Down" "down")
|
||||||
"@direction" = "left";
|
(confirmAction "W-S-e" "Exit labwc?" "Exit")
|
||||||
"@combine" = "yes";
|
|
||||||
};
|
# spawn applications (sync with niri modules/applications/niri/home.nix)
|
||||||
}
|
|
||||||
{
|
|
||||||
"@key" = "W-C-Right";
|
|
||||||
action = {
|
|
||||||
"@name" = "SnapToEdge";
|
|
||||||
"@direction" = "right";
|
|
||||||
"@combine" = "yes";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
"@key" = "W-C-Up";
|
|
||||||
action = {
|
|
||||||
"@name" = "SnapToEdge";
|
|
||||||
"@direction" = "up";
|
|
||||||
"@combine" = "yes";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
"@key" = "W-C-Down";
|
|
||||||
action = {
|
|
||||||
"@name" = "SnapToEdge";
|
|
||||||
"@direction" = "down";
|
|
||||||
"@combine" = "yes";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
(execute "W-t" "ghostty")
|
(execute "W-t" "ghostty")
|
||||||
(execute "W-d" "vicinae toggle")
|
(execute "W-d" "vicinae toggle")
|
||||||
|
(execute "W-s" "noctalia msg panel-toggle launcher")
|
||||||
(execute "W-e" "nautilus --new-window")
|
(execute "W-e" "nautilus --new-window")
|
||||||
(execute "W-l" "loginctl lock-session")
|
(execute "W-l" "loginctl lock-session")
|
||||||
(execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true")
|
(execute "W-v" "vicinae vicinae://launch/clipboard/history?toggle=true")
|
||||||
(execute "W-space" "ghostty +toggle-quick-terminal")
|
(execute "W-space" "ghostty +toggle-quick-terminal")
|
||||||
(execute "W-p" "wdisplays")
|
(execute "W-p" "wdisplays")
|
||||||
(execute "W-s" "noctalia msg panel-toggle launcher")
|
|
||||||
(execute "W-comma" "noctalia msg settings-toggle")
|
# Function keys (sync with niri modules/applications/niri/home.nix)
|
||||||
(action "W-S-e" "Exit")
|
|
||||||
]
|
|
||||||
++ [
|
|
||||||
(execute "XF86AudioRaiseVolume" "noctalia msg volume-up")
|
(execute "XF86AudioRaiseVolume" "noctalia msg volume-up")
|
||||||
(execute "XF86AudioLowerVolume" "noctalia msg volume-down")
|
(execute "XF86AudioLowerVolume" "noctalia msg volume-down")
|
||||||
(execute "XF86AudioMute" "noctalia msg volume-mute")
|
(execute "XF86AudioMute" "noctalia msg volume-mute")
|
||||||
(execute "XF86AudioMicMute" "noctalia msg mic-mute")
|
(execute "XF86AudioMicMute" "noctalia msg mic-mute")
|
||||||
(execute "XF86MonBrightnessUp" "noctalia msg brightness-up")
|
(execute "XF86MonBrightnessUp" "noctalia msg brightness-up")
|
||||||
(execute "XF86MonBrightnessDown" "noctalia msg brightness-down")
|
(execute "XF86MonBrightnessDown" "noctalia msg brightness-down")
|
||||||
|
(execute "XF86Favorites" "noctalia msg caffeine-toggle")
|
||||||
|
(execute "XF86AudioPlay" "playerctl play-pause")
|
||||||
|
(execute "XF86AudioPause" "playerctl play-pause")
|
||||||
|
(execute "XF86AudioStop" "playerctl stop")
|
||||||
|
(execute "XF86AudioPrev" "playerctl previous")
|
||||||
|
(execute "XF86AudioNext" "playerctl next")
|
||||||
|
(execute "XF86Display" "wdisplays")
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,42 @@ in
|
|||||||
programs.niri.settings = {
|
programs.niri.settings = {
|
||||||
|
|
||||||
binds = keybindings // {
|
binds = keybindings // {
|
||||||
|
# niri window or focus move
|
||||||
|
"Mod+Shift+Left" = {
|
||||||
|
action.focus-monitor-left = [ ];
|
||||||
|
hotkey-overlay.title = "Focus Monitor Left";
|
||||||
|
};
|
||||||
|
"Mod+Shift+Right" = {
|
||||||
|
action.focus-monitor-right = [ ];
|
||||||
|
hotkey-overlay.title = "Focus Monitor Right";
|
||||||
|
};
|
||||||
|
"Mod+Shift+Up" = {
|
||||||
|
action.focus-monitor-up = [ ];
|
||||||
|
hotkey-overlay.title = "Focus Monitor Up";
|
||||||
|
};
|
||||||
|
"Mod+Shift+Down" = {
|
||||||
|
action.focus-monitor-down = [ ];
|
||||||
|
hotkey-overlay.title = "Focus Monitor Down";
|
||||||
|
};
|
||||||
|
|
||||||
|
"Mod+Shift+Ctrl+Left" = {
|
||||||
|
action.move-window-to-monitor-left = [ ];
|
||||||
|
hotkey-overlay.title = "Move Window to Monitor Left";
|
||||||
|
};
|
||||||
|
"Mod+Shift+Ctrl+Right" = {
|
||||||
|
action.move-window-to-monitor-right = [ ];
|
||||||
|
hotkey-overlay.title = "Move Window to Monitor Right";
|
||||||
|
};
|
||||||
|
"Mod+Shift+Ctrl+Up" = {
|
||||||
|
action.move-window-to-monitor-up = [ ];
|
||||||
|
hotkey-overlay.title = "Move Window to Monitor Up";
|
||||||
|
};
|
||||||
|
"Mod+Shift+Ctrl+Down" = {
|
||||||
|
action.move-window-to-monitor-down = [ ];
|
||||||
|
hotkey-overlay.title = "Move Window to Monitor Down";
|
||||||
|
};
|
||||||
|
|
||||||
|
# spawn applications (sync with labwc modules/applications/labwc/home.nix)
|
||||||
"Mod+T" = {
|
"Mod+T" = {
|
||||||
action.spawn = "ghostty";
|
action.spawn = "ghostty";
|
||||||
hotkey-overlay.title = "Open a Terminal: ghostty";
|
hotkey-overlay.title = "Open a Terminal: ghostty";
|
||||||
@@ -54,41 +90,12 @@ in
|
|||||||
];
|
];
|
||||||
hotkey-overlay.title = "Toggle Quick Terminal: ghostty";
|
hotkey-overlay.title = "Toggle Quick Terminal: ghostty";
|
||||||
};
|
};
|
||||||
|
"Mod+P" = {
|
||||||
"Mod+Shift+Left" = {
|
action.spawn = "wdisplays";
|
||||||
action.focus-monitor-left = [ ];
|
hotkey-overlay.title = "Display Settings: wdisplays";
|
||||||
hotkey-overlay.title = "Focus Monitor Left";
|
|
||||||
};
|
|
||||||
"Mod+Shift+Right" = {
|
|
||||||
action.focus-monitor-right = [ ];
|
|
||||||
hotkey-overlay.title = "Focus Monitor Right";
|
|
||||||
};
|
|
||||||
"Mod+Shift+Up" = {
|
|
||||||
action.focus-monitor-up = [ ];
|
|
||||||
hotkey-overlay.title = "Focus Monitor Up";
|
|
||||||
};
|
|
||||||
"Mod+Shift+Down" = {
|
|
||||||
action.focus-monitor-down = [ ];
|
|
||||||
hotkey-overlay.title = "Focus Monitor Down";
|
|
||||||
};
|
|
||||||
|
|
||||||
"Mod+Shift+Ctrl+Left" = {
|
|
||||||
action.move-window-to-monitor-left = [ ];
|
|
||||||
hotkey-overlay.title = "Move Window to Monitor Left";
|
|
||||||
};
|
|
||||||
"Mod+Shift+Ctrl+Right" = {
|
|
||||||
action.move-window-to-monitor-right = [ ];
|
|
||||||
hotkey-overlay.title = "Move Window to Monitor Right";
|
|
||||||
};
|
|
||||||
"Mod+Shift+Ctrl+Up" = {
|
|
||||||
action.move-window-to-monitor-up = [ ];
|
|
||||||
hotkey-overlay.title = "Move Window to Monitor Up";
|
|
||||||
};
|
|
||||||
"Mod+Shift+Ctrl+Down" = {
|
|
||||||
action.move-window-to-monitor-down = [ ];
|
|
||||||
hotkey-overlay.title = "Move Window to Monitor Down";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Function keys (sync with labwc modules/applications/labwc/home.nix)
|
||||||
"XF86AudioRaiseVolume".action.spawn = [
|
"XF86AudioRaiseVolume".action.spawn = [
|
||||||
"noctalia"
|
"noctalia"
|
||||||
"msg"
|
"msg"
|
||||||
@@ -124,6 +131,29 @@ in
|
|||||||
"msg"
|
"msg"
|
||||||
"caffeine-toggle"
|
"caffeine-toggle"
|
||||||
];
|
];
|
||||||
|
"XF86AudioPlay".action.spawn = [
|
||||||
|
"playerctl"
|
||||||
|
"play-pause"
|
||||||
|
];
|
||||||
|
"XF86AudioPause".action.spawn = [
|
||||||
|
"playerctl"
|
||||||
|
"play-pause"
|
||||||
|
];
|
||||||
|
"XF86AudioStop".action.spawn = [
|
||||||
|
"playerctl"
|
||||||
|
"stop"
|
||||||
|
];
|
||||||
|
"XF86AudioPrev".action.spawn = [
|
||||||
|
"playerctl"
|
||||||
|
"previous"
|
||||||
|
];
|
||||||
|
"XF86AudioNext".action.spawn = [
|
||||||
|
"playerctl"
|
||||||
|
"next"
|
||||||
|
];
|
||||||
|
"XF86Display".action.spawn = [
|
||||||
|
"wdisplays"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
|
|||||||
Reference in New Issue
Block a user