mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
feat(sway): add basic keybinds
This commit is contained in:
parent
a14817d2ab
commit
2c03959277
1 changed files with 101 additions and 5 deletions
|
@ -1,12 +1,19 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
lib,
|
||||||
|
config,
|
||||||
nixosConfig,
|
nixosConfig,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
imports = [
|
inherit
|
||||||
./kitty.nix
|
(lib)
|
||||||
];
|
mapAttrs'
|
||||||
|
nameValuePair
|
||||||
|
;
|
||||||
|
|
||||||
|
bindWithModifier = mapAttrs' (k: nameValuePair (cfg.modifier + "+" + k));
|
||||||
|
cfg = config.wayland.windowManager.sway.config;
|
||||||
|
in {
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config =
|
config =
|
||||||
|
@ -14,13 +21,94 @@
|
||||||
modifier = "Mod4";
|
modifier = "Mod4";
|
||||||
terminal = "kitty";
|
terminal = "kitty";
|
||||||
|
|
||||||
|
# Excuse me, le füque
|
||||||
focus.followMouse = false;
|
focus.followMouse = false;
|
||||||
|
focus.mouseWarping = false;
|
||||||
|
|
||||||
|
# TODO menu = "rofi -show run";
|
||||||
|
|
||||||
|
keybindings =
|
||||||
|
{
|
||||||
|
"XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
|
"XF86AudioLowerVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
|
"XF86AudioMute" = "exec --no-startup-id wpctl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
"XF86AudioMicMute" = "exec --no-startup-id wpctl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||||
|
|
||||||
|
#"Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
||||||
|
#"${mod}+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot save area";
|
||||||
|
}
|
||||||
|
# // optionalAttrs useBacklight {
|
||||||
|
# "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
|
||||||
|
# "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
|
||||||
|
# }
|
||||||
|
// {
|
||||||
|
"Menu" = "exec ${cfg.menu}";
|
||||||
|
}
|
||||||
|
# General mappings that start with $modifier+...
|
||||||
|
// bindWithModifier {
|
||||||
|
"t" = "exec ${cfg.terminal}";
|
||||||
|
"asciicircum" = "exec ${cfg.menu}";
|
||||||
|
"b" = "exec firefox";
|
||||||
|
|
||||||
|
"Shift+r" = "reload";
|
||||||
|
"q" = "kill";
|
||||||
|
|
||||||
|
"Left" = "focus left";
|
||||||
|
"Right" = "focus right";
|
||||||
|
"Up" = "focus up";
|
||||||
|
"Down" = "focus down";
|
||||||
|
|
||||||
|
"Shift+Left" = "move left";
|
||||||
|
"Shift+Right" = "move right";
|
||||||
|
"Shift+Up" = "move up";
|
||||||
|
"Shift+Down" = "move down";
|
||||||
|
|
||||||
|
"s" = "splith";
|
||||||
|
"v" = "splitv";
|
||||||
|
"f" = "floating toggle";
|
||||||
|
"Return" = "fullscreen toggle";
|
||||||
|
"Space" = "focus mode_toggle";
|
||||||
|
# "a" = "focus parent";
|
||||||
|
# "s" = "layout stacking";
|
||||||
|
# "w" = "layout tabbed";
|
||||||
|
# "e" = "layout toggle split";
|
||||||
|
|
||||||
|
"Shift+Ctrl+q" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||||
|
"r" = "mode resize";
|
||||||
|
|
||||||
|
"1" = "workspace number 1";
|
||||||
|
"2" = "workspace number 2";
|
||||||
|
"3" = "workspace number 3";
|
||||||
|
"4" = "workspace number 4";
|
||||||
|
"5" = "workspace number 5";
|
||||||
|
"6" = "workspace number 6";
|
||||||
|
"7" = "workspace number 7";
|
||||||
|
"8" = "workspace number 8";
|
||||||
|
"9" = "workspace number 9";
|
||||||
|
"Comma" = "workspace prev";
|
||||||
|
"Period" = "workspace next";
|
||||||
|
|
||||||
|
"Shift+1" = "move container to workspace number 1";
|
||||||
|
"Shift+2" = "move container to workspace number 2";
|
||||||
|
"Shift+3" = "move container to workspace number 3";
|
||||||
|
"Shift+4" = "move container to workspace number 4";
|
||||||
|
"Shift+5" = "move container to workspace number 5";
|
||||||
|
"Shift+6" = "move container to workspace number 6";
|
||||||
|
"Shift+7" = "move container to workspace number 7";
|
||||||
|
"Shift+8" = "move container to workspace number 8";
|
||||||
|
"Shift+9" = "move container to workspace number 9";
|
||||||
|
"Shift+Comma" = "move container to workspace prev";
|
||||||
|
"Shift+Period" = "move container to workspace next";
|
||||||
|
};
|
||||||
|
|
||||||
window.titlebar = false;
|
window.titlebar = false;
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
"type:keyboard" = {
|
"type:keyboard" = {
|
||||||
repeat_delay = "235";
|
repeat_delay = "235";
|
||||||
repeat_rate = "60";
|
repeat_rate = "60";
|
||||||
xkb_layout = "de";
|
xkb_layout = "de";
|
||||||
|
xkb_variant = "nodeadkeys";
|
||||||
xkb_numlock = "enabled";
|
xkb_numlock = "enabled";
|
||||||
};
|
};
|
||||||
"type:pointer" = {
|
"type:pointer" = {
|
||||||
|
@ -28,6 +116,7 @@
|
||||||
pointer_accel = "0";
|
pointer_accel = "0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
assigns = {
|
assigns = {
|
||||||
"9" = [
|
"9" = [
|
||||||
{class = "^steam_app_";}
|
{class = "^steam_app_";}
|
||||||
|
@ -95,6 +184,13 @@
|
||||||
xdragon
|
xdragon
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.pointerCursor = {
|
||||||
|
gtk.enable = true;
|
||||||
|
name = "Adwaita-dark";
|
||||||
|
package = pkgs.gnome.adwaita-icon-theme;
|
||||||
|
size = 24;
|
||||||
|
};
|
||||||
|
|
||||||
# Needed to fix cursors in firefox under wayland, see https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1374497558
|
# Needed to fix cursors in firefox under wayland, see https://github.com/NixOS/nixpkgs/issues/207339#issuecomment-1374497558
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue