sway-config
Configures Sway window manager. Use when user asks about sway keybindings, window rules, outputs, inputs, workspaces, or any sway/i3 configuration.
When & Why to Use This Skill
This Claude skill provides comprehensive automation for configuring the Sway window manager and i3-compatible environments. It streamlines Linux desktop customization by allowing users to manage keybindings, window rules, workspace assignments, and hardware input/output settings through natural language, significantly reducing the manual effort required for dotfile maintenance.
Use Cases
- Customizing Productivity Workflows: Effortlessly define or update keybindings for application launching, system controls, and custom bash scripts to maintain a keyboard-centric environment.
- Display and Workspace Management: Configure multi-monitor setups (outputs), set resolutions, and automate the assignment of specific applications to dedicated workspaces for better organization.
- Window Behavior Automation: Create sophisticated window rules to enable floating modes, set transparency, or define layout constraints for specific app IDs or window classes.
- Hardware Configuration: Adjust input device settings, such as keyboard layouts (XKB options) and touchpad behaviors, directly through the agent interface.
- Troubleshooting and Migration: Analyze existing Sway/i3 configurations to identify errors or assist in migrating settings between different Linux desktop environments.
| name | sway-config |
|---|---|
| description | Configures Sway window manager. Use when user asks about sway keybindings, window rules, outputs, inputs, workspaces, or any sway/i3 configuration. |
| allowed-tools | Bash, Read, Edit, Glob, Grep |
Sway Configuration
Config location
~/dotfiles/.config/sway/config
Man pages
man 5 sway- Main config referenceman 5 sway-input- Input devices (keyboard, mouse, touchpad)man 5 sway-output- Displays and monitorsman 5 sway-bar- Status bar configuration
Common patterns
Keybindings
bindsym $mod+Return exec foot bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
Window rules (make windows float, assign to workspace, etc)
for_window [app_id="firefox"] floating enable for_window [class="Steam"] move to workspace 5 assign [app_id="discord"] workspace 4
Finding window identifiers
Run: swaymsg -t get_tree | grep -E "app_id|class"
Input configuration
input "type:keyboard" { xkb_options ctrl:nocaps }
Output configuration
output eDP-1 resolution 1920x1080 position 0,0
Startup programs
exec /usr/bin/program # runs once at startup exec_always nm-applet # runs on startup and reload
Variables
set $mod Mod4 set $term foot
Criteria for window matching
- app_id - Wayland app identifier
- class - X11 window class (XWayland)
- title - Window title (regex)
- floating/tiling - Window state
After editing
Reload config with $mod+Shift+c or run: swaymsg reload