Keybindings and waybar (#238)

* feat: niri & hyprland - adjust keybindings
* feat: waybar - add micphone icon, use WirePlumber, etc
This commit is contained in:
Ryan Yin
2025-12-19 15:52:39 +08:00
committed by GitHub
parent b7f5aed4b8
commit a0fc2040a9
4 changed files with 46 additions and 30 deletions

View File

@@ -1,16 +1,15 @@
{ {
"position": "top", "position": "top",
"layer": "top", "layer": "top",
"modules-left": ["custom/launcher", "temperature", "backlight", "network"],
"modules-left": ["custom/launcher", "temperature", "backlight", "hyprland/workspaces"],
"modules-center": ["custom/playerctl"], "modules-center": ["custom/playerctl"],
"modules-right": [ "modules-right": [
"pulseaudio", "wireplumber",
"memory", "wireplumber#source",
"cpu", "cpu",
"network", "memory",
"battery",
"clock", "clock",
"battery",
"idle_inhibitor", "idle_inhibitor",
"custom/powermenu", "custom/powermenu",
"tray", "tray",
@@ -33,7 +32,6 @@
"default": "", "default": "",
}, },
}, },
"clock": { "clock": {
"interval": 60, "interval": 60,
"align": 0, "align": 0,
@@ -102,14 +100,11 @@
"on-click-middle": "nm-connection-editor", "on-click-middle": "nm-connection-editor",
"on-click-right": "foot nmtui", "on-click-right": "foot nmtui",
}, },
"pulseaudio": { "wireplumber": {
//"format": "{volume}% {icon} {format_source}",
"format": "{icon} {volume}%", "format": "{icon} {volume}%",
"format-muted": " Mute", "format-muted": " Mute",
"format-bluetooth": " {volume}% {format_source}", "format-bluetooth": " {volume}%",
"format-bluetooth-muted": " Mute", "format-bluetooth-muted": " Mute",
"format-source": " {volume}%",
"format-source-muted": "",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "hands-free": "",
@@ -120,11 +115,19 @@
"default": ["", "", ""], "default": ["", "", ""],
}, },
"scroll-step": 5.0, "scroll-step": 5.0,
// Commands to execute on events "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"on-click": "amixer set Master toggle",
"on-click-right": "GSK_RENDERER=opengl pavucontrol", "on-click-right": "GSK_RENDERER=opengl pavucontrol",
"smooth-scrolling-threshold": 1, "smooth-scrolling-threshold": 1,
}, },
"wireplumber#source": {
"node-type": "Audio/Source",
"format": " {volume}%",
"format-muted": " Muted",
"tooltip": false,
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle",
"on-click-right": "GSK_RENDERER=opengl pavucontrol",
"scroll-step": 5,
},
"temperature": { "temperature": {
"format": "\uf2c9 {temperatureC}\u00b0C", "format": "\uf2c9 {temperatureC}\u00b0C",
"tooltip": false, "tooltip": false,

View File

@@ -76,10 +76,10 @@ tooltip label {
#memory, #memory,
#temperature, #temperature,
#cpu, #cpu,
#custom-wall, #custom-playerctl,
#temperature,
#backlight, #backlight,
#pulseaudio, #wireplumber,
#wireplumber-source,
#network, #network,
#battery, #battery,
#custom-powermenu { #custom-powermenu {
@@ -123,18 +123,23 @@ tooltip label {
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-direction: alternate; animation-direction: alternate;
} }
#custom-wall {
color: #33ccff;
}
#temperature { #temperature {
color: rgb(150, 205, 251); color: rgb(150, 205, 251);
} }
#backlight { #backlight {
color: rgb(248, 189, 150); color: rgb(248, 189, 150);
} }
#pulseaudio { #wireplumber {
color: rgb(245, 224, 220); color: rgb(245, 224, 220);
} }
#wireplumber-source {
color: rgb(181, 232, 224);
}
#custom-playerctl {
color: rgb(166, 227, 161);
}
#network { #network {
color: #abe9b3; color: #abe9b3;
} }

View File

@@ -30,12 +30,14 @@ bind = $mod, d, exec, anyrun
# - Hardware control # - Hardware control
# BIND MOD KEY DISPATCHER VALUE # BIND MOD KEY DISPATCHER VALUE
# https://wiki.archlinux.org/title/WirePlumber # https://wiki.archlinux.org/title/WirePlumber
bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01+ --limit 1.0
bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01-
bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindl = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle bindl = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bind = , XF86MonBrightnessUp, exec, brightnessctl set 5%+ bind = , XF86MonBrightnessUp, exec, brightnessctl --class=backlight set 1%+
bind = , XF86MonBrightnessDown, exec, brightnessctl set 5%- bind = , XF86MonBrightnessDown, exec, brightnessctl --class=backlight set 1%-
bind = , XF86KbdBrightnessUp, exec, brightnessctl --device=kbd_backlight set 10%+
bind = , XF86KbdBrightnessDown, exec, brightnessctl --device=kbd_backlight set 10%-
bind = , XF86AudioPlay, exec, playerctl play-pause bind = , XF86AudioPlay, exec, playerctl play-pause
bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioNext, exec, playerctl next
bind = , XF86AudioPrev, exec, playerctl previous bind = , XF86AudioPrev, exec, playerctl previous

View File

@@ -28,8 +28,8 @@ binds {
// 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. // Using spawn-sh allows to pass multiple arguments together with the command.
// "-l 1.0" limits the volume to 100%. // "-l 1.0" limits the volume to 100%.
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.01+ --limit 1.0"; }
XF86AudioLowerVolume 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.01-"; }
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } 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"; } XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
@@ -43,8 +43,14 @@ binds {
// Example brightness key mappings for brightnessctl. // Example brightness key mappings for brightnessctl.
// You can use regular spawn with multiple arguments too (to avoid going through "sh"), // 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. // but you need to manually put each argument in separate "" quotes.
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "1%+"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "1%-"; }
// keyboard backlight
XF86KbdBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--device=kbd_backlight" "set" "10%+"; }
XF86KbdBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--device=kbd_backlight" "set" "10%-"; }
// for apple-silicon touchbar
XF86Search { spawn "anyrun"; }
// 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,
@@ -229,7 +235,7 @@ binds {
// which ensures niri always processes them, even when an inhibitor is active. // which ensures niri always processes them, even when an inhibitor is active.
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
Mod+Shift+E { wlogout; } Mod+Shift+E { spawn "wlogout"; }
// The quit action will show a confirmation dialog to avoid accidental exits. // The quit action will show a confirmation dialog to avoid accidental exits.
Ctrl+Alt+Delete { quit; } Ctrl+Alt+Delete { quit; }