add steamdeck keyboard inputs

This commit is contained in:
wieerwill 2024-11-23 13:31:04 +01:00
parent 2522f7f8e6
commit 9c79269bd6

105
home.nix
View File

@ -1,17 +1,6 @@
{ config, pkgs, lib, ... }:
let
# Define variables for your workspaces and displays
display1 = "card1-eDP-1"; # Replace with your actual display identifier
touchDisplay = "10248:4117:FTS3528:00_2808:1015";
workspace1 = "1:Web";
workspace2 = "2:App";
workspace3 = "3:Chat";
workspace4 = "4:Read";
workspace5 = "5:Code";
workspace6 = "6:Password";
workspace7 = "7:Shell";
workspace8 = "8:Media";
in
{
# Home Manager needs a bit of information about you and the paths it should
@ -56,7 +45,7 @@ in
# steam deck touch compability in non-steam games
caribou
#nixgl.auto.nixGLDefault
evtest # for input key testing
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
@ -146,27 +135,79 @@ in
terminal = "alacritty";
menu = "bemenu-run";
# Define variables for your workspaces and displays
display1 = "card1-eDP-1";
workspace1 = "1:Web";
workspace2 = "2:App";
workspace3 = "3:Chat";
workspace4 = "4:Read";
workspace5 = "5:Code";
workspace6 = "6:Password";
workspace7 = "7:Shell";
workspace8 = "8:Media";
# Autostart applications
startup = [
{command = "nvim";}
{command = "allacritty";}
{command = "keepassxc";}
{command = "logseq";}
{command = "thunderbird";}
{command = "firefox";}
#{command = "steam";}
{ command = "swaymsg workspace ${workspace7}; exec nvim"; }
{ command = "swaymsg workspace ${workspace7}; exec alacritty"; }
{ command = "keepassxc"; }
{ command = "logseq"; }
{ command = "thunderbird"; }
{ command = "firefox"; }
#{ command = "steam"; }
# Update environment variables
{command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE PATH";}
{ command = "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE PATH";}
# Start sway-session.target
{command = "systemctl --user start sway-session.target";}
{ command = "systemctl --user start sway-session.target";}
# Switch to the desired workspaces on each output
{ command = "swaymsg focus output ${display1}; swaymsg workspace ${workspace1}"; }
{ command = "swaymsg focus output ${display2}; swaymsg workspace ${workspace3}"; }
];
# Keyboard layout
input = {
# input touchDisplay
# Enable touch screen
"10248:4117:FTS3528:00_2808:1015" = {
send_events = "enabled";
tap_enabled = true;
map_to_output = "${display1}";
};
# Map touch devices to display
"type:touch" = {
map_to_output = "${display1}";
};
map_to_output = "${display1}";
};
# Configure Steam Controller pointer
"10462:4613:Valve_Software_Steam_Controller" = {
# For the pointer device
accel_speed = 0.0;
natural_scroll = false;
left_handed = false;
scroll_method = "two_finger";
middle_emulation = true;
};
# Configure Steam Controller keyboard
"10462:4613:Valve_Software_Steam_Controller" = {
xkb_layout = "de";
};
# Set German layout for all keyboards
"type:keyboard" = {
xkb_layout = "de";
repeat_delay = 600;
repeat_rate = 25;
};
# For all pointers
"type:pointer" = {
accel_speed = 0.0;
natural_scroll = false;
left_handed = false;
middle_emulation = true;
};
"*" = {
xkb_layout = "de"; # German keyboard layout
};
@ -174,14 +215,14 @@ in
# Display configuration
output = {
"*" = {
scale = "1";
};
"${display1}" = {
res = "1280x800"; # Steam Deck resolution
pos = "0 0";
scale = "1";
};
"*" = {
scale = "1";
};
};
# Keybindings
@ -223,7 +264,9 @@ in
"XF86MonBrightnessUp" = "exec brightnessctl set 5%+";
"Print" = "exec grimshot save area";
"Mod4+Shift+q" = "exec swaynagmode --exit";
"Mod4+Shift+Return" = "exec swaynagmode --confirm";
"Mod4+Shift+Return" = "exec swaynagmode --confirm";
# steamdeck specific keys
# "bindcode 304" = "exec firefox";...
};
# Assign workspaces to outputs (adjust as needed)
@ -251,9 +294,9 @@ in
"${workspace6}" = [ { app_id = "org.keepassxc.KeePassXC"; } ];
"${workspace7}" = [ { app_id = "Alacritty"; } ];
"${workspace8}" = [
{ class = "vlc"; }
{ class = "steam"; }
];
{ class = "vlc"; }
{ class = "steam"; }
];
};
};
};