diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-08-27 14:20:22 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-08-29 15:58:01 +0300 |
| commit | 6e0b38050d4f0c8656b0ecee3140f4f07e2b895b (patch) | |
| tree | 7dcb4c435a7bf07a04902a0e035e771e54fc6738 | |
| parent | bf472970c6b84b02d51a195b322dfd741c586e9e (diff) | |
| download | niri-6e0b38050d4f0c8656b0ecee3140f4f07e2b895b.tar.gz niri-6e0b38050d4f0c8656b0ecee3140f4f07e2b895b.tar.bz2 niri-6e0b38050d4f0c8656b0ecee3140f4f07e2b895b.zip | |
default-config: Use spawn-sh more
It's easier to understand.
| -rw-r--r-- | resources/default-config.kdl | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/resources/default-config.kdl b/resources/default-config.kdl index fc140ef7..3ddf40a5 100644 --- a/resources/default-config.kdl +++ b/resources/default-config.kdl @@ -366,22 +366,25 @@ binds { Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } + // Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. + // Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`. + // For example, this is a standard bind to toggle the screen reader (orca). + Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; } + // Example volume keys mappings for PipeWire & WirePlumber. // The allow-when-locked=true property makes them work even when the session is locked. - XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } - XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + // Using spawn-sh allows to pass multiple arguments together with the command. + XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } + XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } // Example brightness key mappings for brightnessctl. + // You can use regular spawn with multiple arguments too (to avoid going through "sh"), + // but you need to manually put each argument in separate "" quotes. XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } - // Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. - // Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`. - // For example, this is a standard bind to toggle the screen reader (orca). - Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; } - // Open/close the Overview: a zoomed-out view of workspaces and windows. // You can also move the mouse into the top-left hot corner, // or do a four-finger swipe up on a touchpad. @@ -492,8 +495,8 @@ binds { // These binds are also affected by touchpad's natural-scroll, so these // example binds are "inverted", since we have natural-scroll enabled for // touchpads by default. - // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } - // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + // Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; } + // Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; } // You can refer to workspaces by index. However, keep in mind that // niri is a dynamic workspace system, so these commands are kind of |
