mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
feat(niri): XF86 keysym actions
This commit is contained in:
parent
40f9eeed47
commit
73c6e134ad
11 changed files with 478 additions and 306 deletions
|
|
@ -40,4 +40,16 @@
|
|||
description = "Default icon theme";
|
||||
};
|
||||
};
|
||||
options.currentHost = {
|
||||
keyboardBacklightDevice = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
description = "Device Identifier that used for brightnessctl, get the identifier via brightnessctl --list";
|
||||
};
|
||||
keyboardBacklightStep = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "34%";
|
||||
description = "Step to change keyboard backlight, integer or percentage accepted";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,4 @@ in {
|
|||
];
|
||||
|
||||
home.sessionVariables.TERMINAL = config.currentUser.defaultTerminal;
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,294 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
term = config.currentUser.defaultTerminal;
|
||||
termRunner = config.currentUser.defaultTerminalRunner;
|
||||
iconTheme = config.currentUser.iconTheme;
|
||||
explorer = config.currentUser.defaultExplorer;
|
||||
explorerTerm = config.currentUser.defaultTerminalExplorer;
|
||||
launcher = "rofi";
|
||||
in {
|
||||
imports = [
|
||||
./packages.nix
|
||||
];
|
||||
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri;
|
||||
|
||||
settings = {
|
||||
prefer-no-csd = true;
|
||||
screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png";
|
||||
|
||||
spawn-at-startup = [
|
||||
{argv = ["waybar"];}
|
||||
{argv = ["dunst"];}
|
||||
{argv = ["fcitx5"];}
|
||||
# polkit/portal helpers
|
||||
{argv = ["${pkgs.kdePackages.xdg-desktop-portal-kde}/libexec/xdg-desktop-portal-kde"];}
|
||||
{argv = ["${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"];}
|
||||
];
|
||||
|
||||
input = {
|
||||
keyboard = {
|
||||
xkb = {};
|
||||
numlock = true;
|
||||
};
|
||||
|
||||
touchpad = {
|
||||
tap = true;
|
||||
natural-scroll = true;
|
||||
};
|
||||
|
||||
mouse = {};
|
||||
trackpoint = {};
|
||||
};
|
||||
|
||||
layout = {
|
||||
gaps = 16;
|
||||
center-focused-column = "never";
|
||||
|
||||
preset-column-widths = [
|
||||
{proportion = 0.33333;}
|
||||
{proportion = 0.5;}
|
||||
{proportion = 0.66667;}
|
||||
];
|
||||
|
||||
default-column-width = {proportion = 0.5;};
|
||||
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
width = 4;
|
||||
active.color = "#7fc8ff";
|
||||
inactive.color = "#505050";
|
||||
};
|
||||
|
||||
border = {
|
||||
enable = false;
|
||||
width = 4;
|
||||
active.color = "#ffc87f";
|
||||
inactive.color = "#505050";
|
||||
urgent.color = "#9b0000";
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enable = false;
|
||||
softness = 30;
|
||||
spread = 5;
|
||||
offset = {
|
||||
x = 0;
|
||||
y = 5;
|
||||
};
|
||||
color = "#0007";
|
||||
};
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "firefox$";
|
||||
title = "^Picture-in-Picture$";
|
||||
}
|
||||
# Anki add new flashcard
|
||||
{
|
||||
app-id = "^anki$";
|
||||
title = "^Add$";
|
||||
}
|
||||
# Dolphin compressing files
|
||||
{
|
||||
app-id = "^org.kde.dolphin$";
|
||||
title = "^Compressing.*$";
|
||||
}
|
||||
{
|
||||
app-id = "^thunar$";
|
||||
title = "^File Operation Progress$";
|
||||
}
|
||||
### IM Medias
|
||||
{
|
||||
app-id = "^QQ$";
|
||||
title = "^图片查看器$";
|
||||
}
|
||||
{
|
||||
app-id = "^org.telegram.desktop$";
|
||||
title = "^Media viewer$";
|
||||
}
|
||||
{
|
||||
app-id = "^wechat$";
|
||||
title = "^图片和视频$";
|
||||
}
|
||||
{
|
||||
app-id = "^org.pulseaudio.pavucontrol$";
|
||||
title = "^Volume Control$";
|
||||
}
|
||||
];
|
||||
open-floating = true;
|
||||
}
|
||||
];
|
||||
|
||||
binds = with config.lib.niri.actions; {
|
||||
"Mod+Shift+Slash".action = show-hotkey-overlay;
|
||||
|
||||
"Mod+Return".hotkey-overlay.title = "Open a Terminal: ${term}";
|
||||
"Mod+Return".action = spawn "${term}";
|
||||
|
||||
"Mod+D".hotkey-overlay.title = "Run an Application: rofi";
|
||||
"Mod+D".action =
|
||||
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Alt+Space".hotkey-overlay.title = "Run an Application: rofi";
|
||||
"Alt+Space".action =
|
||||
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Mod+Shift+W".hotkey-overlay.title = "Search open Window: rofi";
|
||||
"Mod+Shift+W".action =
|
||||
spawn "${launcher}" "-show" "window" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Mod+E".hotkey-overlay.title = "Run file explorer";
|
||||
"Mod+E".action = spawn "${explorer}";
|
||||
"Mod+Shift+E".hotkey-overlay.title = "Run terminal explorer";
|
||||
"Mod+Shift+E".action = spawn "${termRunner}" "${explorerTerm}";
|
||||
|
||||
"XF86AudioRaiseVolume".allow-when-locked = true;
|
||||
"XF86AudioRaiseVolume".action =
|
||||
spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+";
|
||||
"XF86AudioLowerVolume".allow-when-locked = true;
|
||||
"XF86AudioLowerVolume".action =
|
||||
spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-";
|
||||
"XF86AudioMute".allow-when-locked = true;
|
||||
"XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
|
||||
"XF86AudioMicMute".allow-when-locked = true;
|
||||
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
|
||||
|
||||
"Mod+Tab".action = toggle-overview;
|
||||
"Mod+Q".action = close-window;
|
||||
|
||||
"Mod+Left".action = focus-column-left;
|
||||
"Mod+Down".action = focus-window-down;
|
||||
"Mod+Up".action = focus-window-up;
|
||||
"Mod+Right".action = focus-column-right;
|
||||
"Mod+H".action = focus-column-left;
|
||||
"Mod+J".action = focus-window-down;
|
||||
"Mod+K".action = focus-window-up;
|
||||
"Mod+L".action = focus-column-right;
|
||||
|
||||
"Mod+Shift+Left".action = move-column-left;
|
||||
"Mod+Shift+Down".action = move-window-down;
|
||||
"Mod+Shift+Up".action = move-window-up;
|
||||
"Mod+Shift+Right".action = move-column-right;
|
||||
"Mod+Shift+H".action = move-column-left;
|
||||
"Mod+Shift+J".action = move-window-down;
|
||||
"Mod+Shift+K".action = move-window-up;
|
||||
"Mod+Shift+L".action = move-column-right;
|
||||
|
||||
"Mod+Home".action = focus-column-first;
|
||||
"Mod+End".action = focus-column-last;
|
||||
"Mod+Ctrl+Home".action = move-column-to-first;
|
||||
"Mod+Ctrl+End".action = move-column-to-last;
|
||||
|
||||
"Mod+Alt+Left".action = focus-monitor-left;
|
||||
"Mod+Alt+Down".action = focus-monitor-down;
|
||||
"Mod+Alt+Up".action = focus-monitor-up;
|
||||
"Mod+Alt+Right".action = focus-monitor-right;
|
||||
"Mod+Alt+H".action = focus-monitor-left;
|
||||
"Mod+Alt+J".action = focus-monitor-down;
|
||||
"Mod+Alt+K".action = focus-monitor-up;
|
||||
"Mod+Alt+L".action = focus-monitor-right;
|
||||
|
||||
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down;
|
||||
"Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
|
||||
"Mod+Shift+Ctrl+H".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+J".action = move-column-to-monitor-down;
|
||||
"Mod+Shift+Ctrl+K".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+L".action = move-column-to-monitor-right;
|
||||
|
||||
"Mod+Page_Down".action = focus-workspace-down;
|
||||
"Mod+Page_Up".action = focus-workspace-up;
|
||||
"Mod+U".action = focus-workspace-down;
|
||||
"Mod+I".action = focus-workspace-up;
|
||||
"Mod+Ctrl+Page_Down".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+Page_Up".action = move-column-to-workspace-up;
|
||||
"Mod+Ctrl+U".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+I".action = move-column-to-workspace-up;
|
||||
|
||||
"Mod+Shift+Page_Down".action = move-workspace-down;
|
||||
"Mod+Shift+Page_Up".action = move-workspace-up;
|
||||
"Mod+Shift+U".action = move-workspace-down;
|
||||
"Mod+Shift+I".action = move-workspace-up;
|
||||
|
||||
"Mod+WheelScrollDown".cooldown-ms = 150;
|
||||
"Mod+WheelScrollDown".action = focus-workspace-down;
|
||||
"Mod+WheelScrollUp".cooldown-ms = 150;
|
||||
"Mod+WheelScrollUp".action = focus-workspace-up;
|
||||
"Mod+Ctrl+WheelScrollDown".cooldown-ms = 150;
|
||||
"Mod+Ctrl+WheelScrollDown".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+WheelScrollUp".cooldown-ms = 150;
|
||||
"Mod+Ctrl+WheelScrollUp".action = move-column-to-workspace-up;
|
||||
|
||||
"Mod+WheelScrollRight".action = focus-column-right;
|
||||
"Mod+WheelScrollLeft".action = focus-column-left;
|
||||
"Mod+Ctrl+WheelScrollRight".action = move-column-right;
|
||||
"Mod+Ctrl+WheelScrollLeft".action = move-column-left;
|
||||
|
||||
"Mod+Shift+WheelScrollDown".action = focus-column-right;
|
||||
"Mod+Shift+WheelScrollUp".action = focus-column-left;
|
||||
"Mod+Ctrl+Shift+WheelScrollDown".action = move-column-right;
|
||||
"Mod+Ctrl+Shift+WheelScrollUp".action = move-column-left;
|
||||
|
||||
"Mod+1".action = focus-workspace 1;
|
||||
"Mod+2".action = focus-workspace 2;
|
||||
"Mod+3".action = focus-workspace 3;
|
||||
"Mod+4".action = focus-workspace 4;
|
||||
"Mod+5".action = focus-workspace 5;
|
||||
"Mod+6".action = focus-workspace 6;
|
||||
"Mod+7".action = focus-workspace 7;
|
||||
"Mod+8".action = focus-workspace 8;
|
||||
"Mod+9".action = focus-workspace 9;
|
||||
"Mod+Shift+1".action.move-column-to-workspace = 1;
|
||||
"Mod+Shift+2".action.move-column-to-workspace = 2;
|
||||
"Mod+Shift+3".action.move-column-to-workspace = 3;
|
||||
"Mod+Shift+4".action.move-column-to-workspace = 4;
|
||||
"Mod+Shift+5".action.move-column-to-workspace = 5;
|
||||
"Mod+Shift+6".action.move-column-to-workspace = 6;
|
||||
"Mod+Shift+7".action.move-column-to-workspace = 7;
|
||||
"Mod+Shift+8".action.move-column-to-workspace = 8;
|
||||
"Mod+Shift+9".action.move-column-to-workspace = 9;
|
||||
|
||||
"Mod+BracketLeft".action = consume-or-expel-window-left;
|
||||
"Mod+BracketRight".action = consume-or-expel-window-right;
|
||||
"Mod+Comma".action = consume-window-into-column;
|
||||
"Mod+Period".action = expel-window-from-column;
|
||||
|
||||
"Mod+R".action = switch-preset-column-width;
|
||||
"Mod+Shift+R".action = switch-preset-window-height;
|
||||
"Mod+Ctrl+R".action = reset-window-height;
|
||||
"Mod+F".action = maximize-column;
|
||||
"Mod+Shift+M".action = fullscreen-window;
|
||||
"Mod+Ctrl+F".action = expand-column-to-available-width;
|
||||
"Mod+C".action = center-column;
|
||||
"Mod+Ctrl+C".action = center-visible-columns;
|
||||
"Mod+Minus".action = set-column-width "-10%";
|
||||
"Mod+Equal".action = set-column-width "+10%";
|
||||
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||
"Mod+Shift+Equal".action = set-window-height "+10%";
|
||||
"Mod+V".action = toggle-window-floating;
|
||||
"Mod+Shift+V".action = switch-focus-between-floating-and-tiling;
|
||||
"Mod+W".action = toggle-column-tabbed-display;
|
||||
|
||||
"Mod+Shift+S".action.screenshot = {show-pointer = true;};
|
||||
"Print".action.screenshot = {show-pointer = true;};
|
||||
# "Ctrl+Print".action.screenshot-screen = {true};
|
||||
"Alt+Print".action.screenshot-window = {write-to-disk = true;};
|
||||
|
||||
"Mod+Escape".allow-inhibiting = false;
|
||||
"Mod+Escape".action = toggle-keyboard-shortcuts-inhibit;
|
||||
|
||||
"Ctrl+Alt+Delete".action = quit;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
../packages.nix
|
||||
./window-rules.nix
|
||||
./keymaps.nix
|
||||
];
|
||||
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = pkgs.niri;
|
||||
|
||||
settings = {
|
||||
prefer-no-csd = true;
|
||||
screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png";
|
||||
|
||||
spawn-at-startup = [
|
||||
{argv = ["waybar"];}
|
||||
{argv = ["dunst"];}
|
||||
{argv = ["fcitx5"];}
|
||||
# polkit/portal helpers
|
||||
{argv = ["${pkgs.kdePackages.xdg-desktop-portal-kde}/libexec/xdg-desktop-portal-kde"];}
|
||||
{argv = ["${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"];}
|
||||
];
|
||||
|
||||
input = {
|
||||
keyboard = {
|
||||
xkb = {};
|
||||
numlock = true;
|
||||
};
|
||||
|
||||
touchpad = {
|
||||
tap = true;
|
||||
natural-scroll = true;
|
||||
disabled-on-external-mouse = true;
|
||||
};
|
||||
|
||||
mouse = {};
|
||||
trackpoint = {};
|
||||
};
|
||||
|
||||
layout = {
|
||||
gaps = 16;
|
||||
center-focused-column = "never";
|
||||
|
||||
preset-column-widths = [
|
||||
{proportion = 0.33333;}
|
||||
{proportion = 0.5;}
|
||||
{proportion = 0.66667;}
|
||||
];
|
||||
|
||||
default-column-width = {proportion = 0.5;};
|
||||
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
width = 4;
|
||||
active.color = "#7fc8ff";
|
||||
inactive.color = "#505050";
|
||||
};
|
||||
|
||||
border = {
|
||||
enable = false;
|
||||
width = 4;
|
||||
active.color = "#ffc87f";
|
||||
inactive.color = "#505050";
|
||||
urgent.color = "#9b0000";
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enable = false;
|
||||
softness = 30;
|
||||
spread = 5;
|
||||
offset = {
|
||||
x = 0;
|
||||
y = 5;
|
||||
};
|
||||
color = "#0007";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
204
nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix
Normal file
204
nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/keymaps.nix
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
{config, ...}: let
|
||||
term = config.currentUser.defaultTerminal;
|
||||
termRunner = config.currentUser.defaultTerminalRunner;
|
||||
iconTheme = config.currentUser.iconTheme;
|
||||
explorer = config.currentUser.defaultExplorer;
|
||||
explorerTerm = config.currentUser.defaultTerminalExplorer;
|
||||
launcher = "rofi";
|
||||
kbdBacklightDev = config.currentHost.keyboardBacklightDevice;
|
||||
kbdBacklightStep = config.currentHost.keyboardBacklightStep;
|
||||
in {
|
||||
programs.niri.settings.binds = with config.lib.niri.actions; {
|
||||
"Mod+Shift+Slash".action = show-hotkey-overlay;
|
||||
|
||||
"Mod+Return".hotkey-overlay.title = "Open a Terminal: ${term}";
|
||||
"Mod+Return".action = spawn "${term}";
|
||||
|
||||
"Mod+D".hotkey-overlay.title = "Run an Application: rofi";
|
||||
"Mod+D".action =
|
||||
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Alt+Space".hotkey-overlay.title = "Run an Application: rofi";
|
||||
"Alt+Space".action =
|
||||
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Mod+Shift+W".hotkey-overlay.title = "Search open Window: rofi";
|
||||
"Mod+Shift+W".action =
|
||||
spawn "${launcher}" "-show" "window" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Mod+E".hotkey-overlay.title = "Run file explorer";
|
||||
"Mod+E".action = spawn "${explorer}";
|
||||
"Mod+Shift+E".hotkey-overlay.title = "Run terminal explorer";
|
||||
"Mod+Shift+E".action = spawn "${termRunner}" "-e" "${explorerTerm}";
|
||||
|
||||
"XF86AudioRaiseVolume".allow-when-locked = true;
|
||||
"XF86AudioRaiseVolume".action =
|
||||
spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+";
|
||||
"XF86AudioLowerVolume".allow-when-locked = true;
|
||||
"XF86AudioLowerVolume".action =
|
||||
spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-";
|
||||
"XF86AudioMute".allow-when-locked = true;
|
||||
"XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
|
||||
"XF86AudioMicMute".allow-when-locked = true;
|
||||
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
|
||||
|
||||
"XF86MonBrightnessUp" = {
|
||||
action = spawn "brightnessctl" "set" "10%+";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
|
||||
"XF86MonBrightnessDown" = {
|
||||
action = spawn "brightnessctl" "set" "10%-";
|
||||
allow-when-locked = true;
|
||||
};
|
||||
|
||||
"XF86AudioPrev".action = spawn "playerctl" "previous";
|
||||
"XF86AudioNext".action = spawn "playerctl" "next";
|
||||
"XF86AudioPlay".action = spawn "playerctl" "playpause";
|
||||
|
||||
# NOTE: This is a host-specific config
|
||||
# G14 Built-in Fn+Enter
|
||||
"XF86Calculator".action = spawn "";
|
||||
# INFO: Seems that niri does not support touchpad toggle, waiting for upstream implementation.
|
||||
"XF86TouchpadToggle".action = spawn "";
|
||||
# TODO: Write logic for default case
|
||||
"XF86KbdBrightnessUp".action = spawn "brightnessctl" "--device" "${kbdBacklightDev}" "set" "${kbdBacklightStep}+";
|
||||
"XF86KbdBrightnessDown".action = spawn "brightnessctl" "--device" "${kbdBacklightDev}" "set" "${kbdBacklightStep}-";
|
||||
|
||||
# NOTE: This is a host-specific config
|
||||
# G14 Power Profiles Switcher
|
||||
# ROG Key: XF86Launch1
|
||||
# AURA Key: XF86Launch3
|
||||
# Fan Key: XF86Launch4
|
||||
"XF86Launch4".action = spawn "powerprofiles-next"; # See ../packages.nix
|
||||
"XF86Launch1".action =
|
||||
spawn "${launcher}" "-show" "drun" "-icon-theme" "${iconTheme}" "-show-icons";
|
||||
|
||||
"Mod+Tab".action = toggle-overview;
|
||||
"Mod+Q".action = close-window;
|
||||
|
||||
"Mod+Left".action = focus-column-left;
|
||||
"Mod+Down".action = focus-window-down;
|
||||
"Mod+Up".action = focus-window-up;
|
||||
"Mod+Right".action = focus-column-right;
|
||||
"Mod+H".action = focus-column-left;
|
||||
"Mod+J".action = focus-window-down;
|
||||
"Mod+K".action = focus-window-up;
|
||||
"Mod+L".action = focus-column-right;
|
||||
|
||||
"Mod+Shift+Left".action = move-column-left;
|
||||
"Mod+Shift+Down".action = move-window-down;
|
||||
"Mod+Shift+Up".action = move-window-up;
|
||||
"Mod+Shift+Right".action = move-column-right;
|
||||
"Mod+Shift+H".action = move-column-left;
|
||||
"Mod+Shift+J".action = move-window-down;
|
||||
"Mod+Shift+K".action = move-window-up;
|
||||
"Mod+Shift+L".action = move-column-right;
|
||||
|
||||
"Mod+Home".action = focus-column-first;
|
||||
"Mod+End".action = focus-column-last;
|
||||
"Mod+Ctrl+Home".action = move-column-to-first;
|
||||
"Mod+Ctrl+End".action = move-column-to-last;
|
||||
|
||||
"Mod+Alt+Left".action = focus-monitor-left;
|
||||
"Mod+Alt+Down".action = focus-monitor-down;
|
||||
"Mod+Alt+Up".action = focus-monitor-up;
|
||||
"Mod+Alt+Right".action = focus-monitor-right;
|
||||
"Mod+Alt+H".action = focus-monitor-left;
|
||||
"Mod+Alt+J".action = focus-monitor-down;
|
||||
"Mod+Alt+K".action = focus-monitor-up;
|
||||
"Mod+Alt+L".action = focus-monitor-right;
|
||||
|
||||
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down;
|
||||
"Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
|
||||
"Mod+Shift+Ctrl+H".action = move-column-to-monitor-left;
|
||||
"Mod+Shift+Ctrl+J".action = move-column-to-monitor-down;
|
||||
"Mod+Shift+Ctrl+K".action = move-column-to-monitor-up;
|
||||
"Mod+Shift+Ctrl+L".action = move-column-to-monitor-right;
|
||||
|
||||
"Mod+Page_Down".action = focus-workspace-down;
|
||||
"Mod+Page_Up".action = focus-workspace-up;
|
||||
"Mod+U".action = focus-workspace-down;
|
||||
"Mod+I".action = focus-workspace-up;
|
||||
"Mod+Ctrl+Page_Down".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+Page_Up".action = move-column-to-workspace-up;
|
||||
"Mod+Ctrl+U".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+I".action = move-column-to-workspace-up;
|
||||
|
||||
"Mod+Shift+Page_Down".action = move-workspace-down;
|
||||
"Mod+Shift+Page_Up".action = move-workspace-up;
|
||||
"Mod+Shift+U".action = move-workspace-down;
|
||||
"Mod+Shift+I".action = move-workspace-up;
|
||||
|
||||
"Mod+WheelScrollDown".cooldown-ms = 150;
|
||||
"Mod+WheelScrollDown".action = focus-workspace-down;
|
||||
"Mod+WheelScrollUp".cooldown-ms = 150;
|
||||
"Mod+WheelScrollUp".action = focus-workspace-up;
|
||||
"Mod+Ctrl+WheelScrollDown".cooldown-ms = 150;
|
||||
"Mod+Ctrl+WheelScrollDown".action = move-column-to-workspace-down;
|
||||
"Mod+Ctrl+WheelScrollUp".cooldown-ms = 150;
|
||||
"Mod+Ctrl+WheelScrollUp".action = move-column-to-workspace-up;
|
||||
|
||||
"Mod+WheelScrollRight".action = focus-column-right;
|
||||
"Mod+WheelScrollLeft".action = focus-column-left;
|
||||
"Mod+Ctrl+WheelScrollRight".action = move-column-right;
|
||||
"Mod+Ctrl+WheelScrollLeft".action = move-column-left;
|
||||
|
||||
"Mod+Shift+WheelScrollDown".action = focus-column-right;
|
||||
"Mod+Shift+WheelScrollUp".action = focus-column-left;
|
||||
"Mod+Ctrl+Shift+WheelScrollDown".action = move-column-right;
|
||||
"Mod+Ctrl+Shift+WheelScrollUp".action = move-column-left;
|
||||
|
||||
"Mod+1".action = focus-workspace 1;
|
||||
"Mod+2".action = focus-workspace 2;
|
||||
"Mod+3".action = focus-workspace 3;
|
||||
"Mod+4".action = focus-workspace 4;
|
||||
"Mod+5".action = focus-workspace 5;
|
||||
"Mod+6".action = focus-workspace 6;
|
||||
"Mod+7".action = focus-workspace 7;
|
||||
"Mod+8".action = focus-workspace 8;
|
||||
"Mod+9".action = focus-workspace 9;
|
||||
"Mod+Shift+1".action.move-column-to-workspace = 1;
|
||||
"Mod+Shift+2".action.move-column-to-workspace = 2;
|
||||
"Mod+Shift+3".action.move-column-to-workspace = 3;
|
||||
"Mod+Shift+4".action.move-column-to-workspace = 4;
|
||||
"Mod+Shift+5".action.move-column-to-workspace = 5;
|
||||
"Mod+Shift+6".action.move-column-to-workspace = 6;
|
||||
"Mod+Shift+7".action.move-column-to-workspace = 7;
|
||||
"Mod+Shift+8".action.move-column-to-workspace = 8;
|
||||
"Mod+Shift+9".action.move-column-to-workspace = 9;
|
||||
|
||||
"Mod+BracketLeft".action = consume-or-expel-window-left;
|
||||
"Mod+BracketRight".action = consume-or-expel-window-right;
|
||||
"Mod+Comma".action = consume-window-into-column;
|
||||
"Mod+Period".action = expel-window-from-column;
|
||||
|
||||
"Mod+R".action = switch-preset-column-width;
|
||||
"Mod+Shift+R".action = switch-preset-window-height;
|
||||
"Mod+Ctrl+R".action = reset-window-height;
|
||||
"Mod+M".action = maximize-column;
|
||||
"Mod+Shift+M".action = fullscreen-window;
|
||||
"Mod+Ctrl+F".action = expand-column-to-available-width;
|
||||
"Mod+C".action = center-column;
|
||||
"Mod+Ctrl+C".action = center-visible-columns;
|
||||
"Mod+Minus".action = set-column-width "-10%";
|
||||
"Mod+Equal".action = set-column-width "+10%";
|
||||
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||
"Mod+Shift+Equal".action = set-window-height "+10%";
|
||||
"Mod+F".action = toggle-window-floating;
|
||||
"Mod+Shift+F".action = switch-focus-between-floating-and-tiling;
|
||||
"Mod+W".action = toggle-column-tabbed-display;
|
||||
|
||||
"Mod+Shift+S".action.screenshot = {show-pointer = true;};
|
||||
"Print".action.screenshot = {show-pointer = true;};
|
||||
# "Ctrl+Print".action.screenshot-screen = {true};
|
||||
"Alt+Print".action.screenshot-window = {write-to-disk = true;};
|
||||
|
||||
"Mod+Escape".allow-inhibiting = false;
|
||||
"Mod+Escape".action = toggle-keyboard-shortcuts-inhibit;
|
||||
|
||||
"Ctrl+Alt+Delete".action = quit;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
# vim:foldmethod=marker,
|
||||
{...}: {
|
||||
programs.niri = {
|
||||
settings.window-rules = [
|
||||
# {{{ float, opacity 0.8, top right: Picture-in-Picture // waybar childs
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^firefox$";
|
||||
title = "^Picture-in-Picture$";
|
||||
}
|
||||
{
|
||||
# Applies to all chromium
|
||||
title = "^Picture in picture$";
|
||||
}
|
||||
{
|
||||
app-id = "^org.pulseaudio.pavucontrol$";
|
||||
title = "^Volume Control$";
|
||||
}
|
||||
];
|
||||
|
||||
open-floating = true;
|
||||
opacity = 0.8;
|
||||
default-floating-position = {
|
||||
x = 50;
|
||||
y = 50;
|
||||
relative-to = "top-right";
|
||||
};
|
||||
}
|
||||
# }}}
|
||||
{
|
||||
matches = [
|
||||
{
|
||||
app-id = "^gimp$";
|
||||
title = "^GIMP Startup$";
|
||||
}
|
||||
];
|
||||
open-focused = false;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
# Anki add new flashcard
|
||||
{
|
||||
app-id = "^anki$";
|
||||
title = "^Add$";
|
||||
}
|
||||
# Dolphin compressing files
|
||||
{
|
||||
app-id = "^org.kde.dolphin$";
|
||||
title = "^Compressing.*$";
|
||||
}
|
||||
{
|
||||
app-id = "^thunar$";
|
||||
title = "^File Operation Progress$";
|
||||
}
|
||||
### IM Medias
|
||||
{
|
||||
app-id = "^QQ$";
|
||||
title = "^图片查看器$";
|
||||
}
|
||||
{
|
||||
app-id = "^org.telegram.desktop$";
|
||||
title = "^Media viewer$";
|
||||
}
|
||||
{
|
||||
app-id = "^wechat$";
|
||||
title = "^图片和视频$";
|
||||
}
|
||||
];
|
||||
open-floating = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +1,35 @@
|
|||
{pkgs, ...}: let
|
||||
swayidleWrapper = pkgs.writeShellScriptBin "swayidle-wrapper" ''
|
||||
${pkgs.swayidle}/bin/swayidle -w \
|
||||
timeout 300 'swaylock -f' \
|
||||
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||
before-sleep 'swaylock -f -c 000000'
|
||||
# swayidleWrapper = pkgs.writeShellScriptBin "swayidle-wrapper" ''
|
||||
# ${pkgs.swayidle}/bin/swayidle -w \
|
||||
# timeout 300 'swaylock -f' \
|
||||
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
||||
# before-sleep 'swaylock -f -c 000000'
|
||||
# '';
|
||||
powerprofiles-next = pkgs.writeShellScriptBin "powerprofiles-next" ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_PROFILE=$(${pkgs.power-profiles-daemon}/bin/powerprofilesctl get)
|
||||
|
||||
case $CURRENT_PROFILE in
|
||||
"power-saver")
|
||||
NEXT_PROFILE="balanced"
|
||||
ICON="power-profile-balanced-symbolic"
|
||||
;;
|
||||
"balanced")
|
||||
NEXT_PROFILE="performance"
|
||||
ICON="power-profile-performance-symbolic"
|
||||
;;
|
||||
"performance" | *)
|
||||
NEXT_PROFILE="power-saver"
|
||||
ICON="power-profile-power-saver-symbolic"
|
||||
;;
|
||||
esac
|
||||
|
||||
${pkgs.power-profiles-daemon}/bin/powerprofilesctl set $NEXT_PROFILE
|
||||
|
||||
echo "Power profile set to: $NEXT_PROFILE"
|
||||
|
||||
${pkgs.libnotify}/bin/notify-send -a "powerprofilesctl" "Power Profile" "$NEXT_PROFILE" -i $ICON -u low -t 2000
|
||||
'';
|
||||
in {
|
||||
imports = [
|
||||
|
|
@ -16,7 +42,10 @@ in {
|
|||
cliphist # Clipboard daemon
|
||||
swww # Wallpaper daemon
|
||||
wmname
|
||||
swayidleWrapper
|
||||
# swayidleWrapper
|
||||
brightnessctl
|
||||
playerctl
|
||||
powerprofiles-next
|
||||
];
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -15,12 +15,20 @@
|
|||
# File Explorer
|
||||
"inode/directory" = "org.kde.dolphin.desktop";
|
||||
# Image Viewer
|
||||
# loupe: Performance is incredible
|
||||
"image/jpeg" = "vimiv.desktop;org.gnome.Loupe.desktop";
|
||||
"image/jpg" = "vimiv.desktop;org.gnome.Loupe.desktop";
|
||||
"image/png" = "vimiv.desktop;org.gnome.Loupe.desktop";
|
||||
"image/gif" = "vimiv.desktop;org.gnome.Loupe.desktop";
|
||||
"image/bmp" = "vimiv.desktop;org.gnome.Loupe.desktop";
|
||||
"image/webp" = "vimiv.desktop;org.gnome.Loupe.desktop";
|
||||
|
||||
# Audio:
|
||||
# music: elisa: fully featured, good cjk support
|
||||
# audio: mpv: simple and fast
|
||||
"audio/flac" = "mpv.desktop;org.kde.elisa";
|
||||
"audio/vnd.wave" = "mpv.desktop;org.kde.elisa"; # .wav
|
||||
|
||||
# Browser
|
||||
"text/html" = "firefox.desktop;chromium-browser.desktop";
|
||||
"x-scheme-handler/http" = "firefox.desktop;chromium-browser.desktop";
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
# Desktop Linux
|
||||
./programs/desktop/plasma.nix
|
||||
./programs/desktop/wayland-wm/niri.nix
|
||||
./programs/desktop/wayland-wm/niri
|
||||
|
||||
# General Program config
|
||||
../../modules/home/programs/eza.nix
|
||||
|
|
@ -52,5 +52,12 @@
|
|||
../../modules/home/dev/nix.nix
|
||||
];
|
||||
|
||||
currentUser.defaultTerminalRunner = "alacritty";
|
||||
|
||||
currentHost = {
|
||||
keyboardBacklightDevice = "asus::kbd_backlight";
|
||||
keyboardBacklightStep = "1";
|
||||
};
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue