Add niri stuff

This commit is contained in:
Tyler 2025-10-03 17:45:56 -04:00
parent 6fd99c8e61
commit 2be71ee70f
Signed by: tyler
GPG Key ID: 03B27509E17EFDC8
3 changed files with 271 additions and 0 deletions

115
.config/niri/config.kdl Normal file
View File

@ -0,0 +1,115 @@
// ~/.config/niri/config.kdl
// Validate with: niri validate
// Docs: https://yalter.github.io/niri/Configuration:-Introduction // :contentReference[oaicite:0]{index=0}
// --------- OUTPUTS (rotate the GPD Pocket 4 panel) ---------
output "eDP-1" {
// Uncomment the next line to disable this output:
// off
transform "270" // rotate 90°; use "270" if its the other way. :contentReference[oaicite:1]{index=1}
// scale 1.25 // optional UI scaling
}
// --------- LAYOUT / LOOK ---------
layout {
gaps 5
default-column-width { proportion 0.5; }
}
// --------- STARTUP DAEMONS ---------
spawn-at-startup "waybar" // bar
spawn-at-startup "mako" // notifications
spawn-at-startup "blueman-applet" // bluetooth tray
spawn-at-startup "nm-applet" // network tray
// (spawn-at-startup works like a “spawn” action at session start.) :contentReference[oaicite:2]{index=2}
// Screenshots path used by niris built-in screenshot actions.
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
// --------- KEYBINDS (DWM muscle memory) ---------
binds {
// Launchers / commands (from your config.h)
Mod+Shift+Return { spawn "kitty"; }
// Focus like DWM: j/k
Mod+J { focus-window-down; } // next client in column
Mod+K { focus-window-up; } // prev client in column // :contentReference[oaicite:3]{index=3}
// Master-ish resizing
Mod+H { set-column-width "-10%"; }
Mod+L { set-column-width "+10%"; }
Mod+I { set-window-height "+10%"; }
Mod+D { set-window-height "-10%"; }
// “Zoom” feel (cycle preset column widths)
Mod+Return { switch-preset-column-width; } // builtin behavior in niri releases. :contentReference[oaicite:4]{index=4}
// DWM: Mod+Tab view previous
Mod+Tab { focus-workspace-previous; } // workspace nav semantics here. :contentReference[oaicite:5]{index=5}
// Close (killclient)
Mod+Shift+C { close-window; } // :contentReference[oaicite:6]{index=6}
// Layout-ish toggles
Mod+F { toggle-window-floating; } // float
Mod+M { fullscreen-window; } // monocle-like fullscreen
Mod+T { maximize-column; } // tile-ish column maximize
// Overview (since DWMs “view all” has no true analogue)
Mod+0 { toggle-overview; } // overview feature in new niri. :contentReference[oaicite:7]{index=7}
// “shiftview” between workspaces
Mod+Shift+K { focus-workspace-up; }
Mod+Shift+J { focus-workspace-down; } // :contentReference[oaicite:8]{index=8}
// View workspaces 1..9 (DWM TAGKEYS view)
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
// indices are dynamic per monitor. :contentReference[oaicite:9]{index=9}
// Tag (send) focused column to workspace N (closest to DWM tag)
Mod+Shift+1 { move-column-to-workspace 1; }
Mod+Shift+2 { move-column-to-workspace 2; }
Mod+Shift+3 { move-column-to-workspace 3; }
Mod+Shift+4 { move-column-to-workspace 4; }
Mod+Shift+5 { move-column-to-workspace 5; }
Mod+Shift+6 { move-column-to-workspace 6; }
Mod+Shift+7 { move-column-to-workspace 7; }
Mod+Shift+8 { move-column-to-workspace 8; }
Mod+Shift+9 { move-column-to-workspace 9; } // :contentReference[oaicite:10]{index=10}
// Monitors (focus/tag mon)
Mod+Shift+L { focus-monitor-right; }
Mod+Shift+H { focus-monitor-left; }
Mod+Shift+I { move-column-to-monitor-up; }
Mod+Shift+U { move-column-to-monitor-down; }
// Quit (DWM Mod+Shift+Q)
Mod+Shift+Q { quit skip-confirmation=true; }
// Media / volume / brightness
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
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"; }
XF86AudioPlay { spawn "playerctl" "play-pause"; }
XF86AudioNext { spawn "playerctl" "next"; }
XF86AudioPrev { spawn "playerctl" "previous"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+5%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "5%-"; }
// Screenshots (to screenshot-path)
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; } // actions are available via niri msg action too. :contentReference[oaicite:11]{index=11}
}

105
.config/waybar/config.jsonc Normal file
View File

@ -0,0 +1,105 @@
{
// Waybar reads JSONC and is styled via CSS.
// niri has a native workspaces module "niri/workspaces".
// Save as: ~/.config/waybar/config.jsonc
"layer": "top",
"position": "top",
"height": 28,
"gtk-layer-shell": true,
"modules-left": [
"niri/workspaces",
],
"modules-center": [
],
"modules-right": [
"custom/weather",
"custom/loadavg",
"custom/docker",
"cpu",
"memory",
"pulseaudio",
"bluetooth",
"battery",
"tray",
"clock"
],
// ----- niri workspaces -----
"niri/workspaces": {
"format": "{name}",
"on-click": "niri msg action toggle-overview",
"disable-scroll": false
},
// ----- CPU / Memory -----
"cpu": {
"interval": 3,
"format": " {usage:>2}%"
},
"memory": {
"interval": 5,
"format": " {used:0.1f}G"
},
// ----- Clock / Date -----
"clock": {
"interval": 1,
"format": " {:%a %b %d}  {:%H:%M:%S}",
"tooltip": false
},
// ----- Loadavg (custom) -----
"custom/loadavg": {
"exec": "awk '{printf \" %s\", $1}' /proc/loadavg",
"interval": 5,
"return-type": "text",
"tooltip": false
},
// ----- IP (custom) -----
// Shows first non-loopback IPv4; adjust if you prefer a specific iface.
"custom/ip": {
"exec": "ip -4 -o addr show scope global | awk '{print $4}' | cut -d/ -f1 | head -n1 | awk '{print \" \"$1}'",
"interval": 15,
"return-type": "text",
"tooltip": "ip -4 -o addr show"
},
// ----- Docker (custom) -----
"custom/docker": {
"exec": "printf \" %s\" \"$(docker ps -q 2>/dev/null | wc -l)\"",
"interval": 10,
"return-type": "text",
"tooltip": "docker ps"
},
// ----- Bluetooth (native) -----
"bluetooth": {
"format": "{status}",
"format-disabled": " off",
"format-connected": " {num_connections}",
"on-click": "blueman-manager"
},
// ----- Battery -----
"battery": {
"interval": 15,
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-icons": ["", "", "", "", ""],
"states": {
"warning": 25,
"critical": 10
}
},
// ----- System tray -----
"tray": {
"icon-size": 16,
"spacing": 6
}
}

51
.config/waybar/style.css Normal file
View File

@ -0,0 +1,51 @@
/* Waybar CSS — match your DWM palette + Hermit font */
* {
font-family: Hermit, monospace;
font-size: 11pt;
}
window#waybar {
background: #222222;
color: #eeeeee;
border-bottom: 0px solid transparent;
}
#workspaces button {
padding: 0 6px;
margin: 0 3px;
border-radius: 6px;
background: #222222;
color: #bbbbbb;
border: 1px solid #444444;
}
#workspaces button.active {
background: #458588; /* your light blue accent */
color: #eeeeee;
border-color: #458588;
}
#workspaces button:hover {
background: #444444;
color: #eeeeee;
}
#cpu, #memory, #clock, #pulseaudio, #battery, #tray,
#custom-weather, #custom-loadavg, #custom-ip, #custom-docker, #bluetooth {
padding: 0 10px;
margin: 0 4px;
border-radius: 8px;
background: #222222;
border: 1px solid #444444;
}
#pulseaudio.muted {
color: #bbbbbb;
opacity: 0.7;
}
#battery.warning {
color: #ffcc00;
}
#battery.critical {
color: #ff5555;
}