Compare commits

..

3 Commits

Author SHA1 Message Date
Hilton Chain
7b51750fd2
services: %rosenthal-desktop-services/base: Add ddcutil. 2026-02-15 15:50:21 +08:00
Hilton Chain
e4608f6d20
examples: niri: Use noctalia-shell keybindings. 2026-02-15 15:50:21 +08:00
Hilton Chain
5d1948fc96
examples: niri: Update and reorder configurations. 2026-02-15 15:50:19 +08:00
2 changed files with 40 additions and 60 deletions

View File

@ -266,12 +266,10 @@ layout {
} }
// Add lines like this to spawn processes at startup. // Add lines like this to spawn processes at startup.
// Note that running niri as a session supports xdg-desktop-autostart,
// which may be more convenient to use.
// See the binds section below for more spawn examples. // See the binds section below for more spawn examples.
// This line starts waybar, a commonly used bar for Wayland compositors. // Start user Shepherd for Guix Home.
// spawn-at-startup "waybar" spawn-at-startup "shepherd"
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup: // To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell" // spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell"
@ -286,7 +284,7 @@ hotkey-overlay {
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. // Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
// This option will also fix border/focus ring drawing behind some semitransparent windows. // This option will also fix border/focus ring drawing behind some semitransparent windows.
// After enabling or disabling this, you need to restart the apps for this to take effect. // After enabling or disabling this, you need to restart the apps for this to take effect.
// prefer-no-csd prefer-no-csd
// You can change the path where screenshots are saved. // You can change the path where screenshots are saved.
// A ~ at the front will be expanded to the home directory. // A ~ at the front will be expanded to the home directory.
@ -311,14 +309,13 @@ animations {
// Find more information on the wiki: // Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Window-Rules // https://yalter.github.io/niri/Configuration:-Window-Rules
// Work around WezTerm's initial configure bug // Keep WezTerm maximized so that the installer won't be resized.
// by setting an empty default-column-width.
window-rule { window-rule {
// This regular expression is intentionally made as specific as possible, // This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives. // since this is the default config, and we want no false positives.
// You can get away with just app-id="wezterm" if you want. // You can get away with just app-id="wezterm" if you want.
match app-id=r#"^org\.wezfurlong\.wezterm$"# match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {} open-maximized true
} }
// Open the Firefox picture-in-picture player as floating by default. // Open the Firefox picture-in-picture player as floating by default.
@ -329,6 +326,10 @@ window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$" match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true open-floating true
} }
window-rule {
match app-id=r#"librewolf$"# title="^Picture-in-Picture$"
open-floating true
}
// Example: block out two password managers from screen capture. // Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.) // (This example rule is commented out with a "/-" in front.)
@ -342,13 +343,22 @@ window-rule {
// block-out-from "screencast" // block-out-from "screencast"
} }
// Example: enable rounded corners for all windows. // Enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.) // For Noctalia shell.
/-window-rule { window-rule {
geometry-corner-radius 12 geometry-corner-radius 20
clip-to-geometry true clip-to-geometry true
} }
debug {
honor-xdg-activation-with-invalid-serial
}
// Background color to match the wallpaper.
overview {
backdrop-color "#D2DEE9"
}
binds { binds {
// Keys consist of modifiers separated by + signs, followed by an XKB key name // Keys consist of modifiers separated by + signs, followed by an XKB key name
// in the end. To find an XKB name for a particular key, you may use a program // in the end. To find an XKB name for a particular key, you may use a program
@ -367,34 +377,30 @@ binds {
// Suggested binds for running programs: terminal, app launcher, screen locker. // Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+Return hotkey-overlay-title="Open a Terminal" { spawn "wezterm"; } Mod+Return hotkey-overlay-title="Open a Terminal" { spawn "wezterm"; }
Mod+D hotkey-overlay-title="Run an Application" { spawn "noctalia-shell" "ipc" "call" "launcher" "toggle"; } Mod+D hotkey-overlay-title="Run an Application" { spawn "noctalia-shell" "ipc" "call" "launcher" "toggle"; }
// Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } // Super+Alt+L hotkey-overlay-title="Lock the Screen" { spawn "noctalia-shell" "ipc" "call" "lockScreen" "lock"; }
// Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc. // 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`. // 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). // 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"; } Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; }
// Example volume keys mappings for PipeWire & WirePlumber. // Example volume keys mappings for Noctalia shell
// The allow-when-locked=true property makes them work even when the session is locked. // The allow-when-locked=true property makes them work even when the session is locked.
// Using spawn-sh allows to pass multiple arguments together with the command. XF86AudioRaiseVolume allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "increase"; }
// "-l 1.0" limits the volume to 100%. XF86AudioLowerVolume allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "decrease"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } XF86AudioMute allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "muteOutput"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } XF86AudioMicMute allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "muteInput"; }
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 media keys mapping using playerctl. // Example media keys mappings for Noctalia shell.
// This will work with any MPRIS-enabled media player. // This will work with any MPRIS-enabled media player.
XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } XF86AudioPlay allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "media" "playPause"; }
XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; } XF86AudioStop allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "media" "pause"; }
XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } XF86AudioPrev allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "media" "previous"; }
XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } XF86AudioNext allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "media" "next"; }
// Example brightness key mappings for light. // Example brightness key mappings for Noctalia shell
// You can use regular spawn with multiple arguments too (to avoid going through "sh"), XF86MonBrightnessUp allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "brightness" "increase"; }
// but you need to manually put each argument in separate "" quotes. XF86MonBrightnessDown allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "brightness" "decrease"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "light" "-A" "10"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "light" "-U" "10"; }
// Open/close the Overview: a zoomed-out view of workspaces and windows. // Open/close the Overview: a zoomed-out view of workspaces and windows.
// You can also move the mouse into the top-left hot corner, // You can also move the mouse into the top-left hot corner,
@ -506,8 +512,8 @@ binds {
// These binds are also affected by touchpad's natural-scroll, so these // These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for // example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default. // touchpads by default.
// Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; } // Mod+TouchpadScrollDown { spawn "noctalia-shell" "ipc" "call" "volume" "increase"; }
// Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; } // Mod+TouchpadScrollUp { spawn "noctalia-shell" "ipc" "call" "volume" "decrease"; }
// You can refer to workspaces by index. However, keep in mind that // You can refer to workspaces by index. However, keep in mind that
// niri is a dynamic workspace system, so these commands are kind of // niri is a dynamic workspace system, so these commands are kind of
@ -623,31 +629,3 @@ binds {
// moving the mouse or pressing any other key. // moving the mouse or pressing any other key.
Mod+Shift+P { power-off-monitors; } Mod+Shift+P { power-off-monitors; }
} }
// Start user Shepherd.
spawn-at-startup "shepherd"
// Noctalia shell.
window-rule {
geometry-corner-radius 20
clip-to-geometry true
}
debug {
honor-xdg-activation-with-invalid-serial
}
// Emacs has a window height > 100% whening using CSD.
prefer-no-csd
// Keep WezTerm maximized so that the installer won't be resized.
window-rule {
match app-id="org.wezfurlong.wezterm"
open-maximized true
}
// Background color to match the wallpaper.
overview {
backdrop-color "#D2DEE9"
}

View File

@ -36,6 +36,7 @@
#:use-module (gnu packages fonts) #:use-module (gnu packages fonts)
#:use-module (gnu packages gnome) #:use-module (gnu packages gnome)
#:use-module (gnu packages guile) #:use-module (gnu packages guile)
#:use-module (gnu packages hardware)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages networking) #:use-module (gnu packages networking)
#:use-module (gnu packages polkit) #:use-module (gnu packages polkit)
@ -645,6 +646,7 @@ gtk-key-theme-name = ~a~%"
;; Add udev rules for backlight control. ;; Add udev rules for backlight control.
(simple-service 'backlight udev-service-type (list light)) (simple-service 'backlight udev-service-type (list light))
(simple-service 'backlight-external udev-service-type (list ddcutil))
(modify-services %desktop-services (modify-services %desktop-services
(delete %display-manager-service-type) (delete %display-manager-service-type)