diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index a5852d0..24a6a34 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -110,7 +110,10 @@ environment { // The sleeps preserve Hyprland's ordering (tray applets after waybar). spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh" spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh" -spawn-at-startup "sh" "-c" "sleep 1 && waybar" +// waybar needs its own config here: the shared one uses hyprland/workspaces +// and hyprland/window, which do nothing under niri. config-niri swaps those +// for niri/workspaces and niri/window. +spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri" spawn-at-startup "sh" "-c" "sleep 2 && kdeconnect-indicator" spawn-at-startup "sh" "-c" "sleep 3 && /opt/Mullvad\\ VPN/mullvad-vpn" spawn-at-startup "sh" "-c" "sleep 3 && swaync-client -dn" diff --git a/.config/scripts/niri/wallpaper_picker.sh b/.config/scripts/niri/wallpaper_picker.sh index cdeb1f3..0f14b6a 100755 --- a/.config/scripts/niri/wallpaper_picker.sh +++ b/.config/scripts/niri/wallpaper_picker.sh @@ -74,6 +74,8 @@ wait # Remember the choice so the daemon can be restored on the next login. echo "$WALLPAPER" > "$STATE_FILE" +# -c: the shared waybar config uses the hyprland/* modules, which are inert +# under niri. Must match the config niri starts waybar with. killall waybar 2>/dev/null -waybar &disown +waybar -c "$HOME/.config/waybar/config-niri" &disown notify-send "Wallpaper Picker" "Applied: $SELECTED" diff --git a/.config/waybar/config-niri b/.config/waybar/config-niri new file mode 100644 index 0000000..d6e126b --- /dev/null +++ b/.config/waybar/config-niri @@ -0,0 +1,186 @@ +{ + "layer": "top", + "position": "top", + "height": 34, + "spacing": 16, + "modules-left": ["niri/workspaces", "custom/music"], + "modules-center": ["clock"], + "modules-right": ["privacy", "cpu", "memory", "wireplumber", "group/tray", "battery"], + + "cava": { + "framerate": 30, + "autosens": 1, + "sensitivity": 100, + "bars": 14, + "lower_cutoff_freq": 50, + "higher_cutoff_freq": 10000, + "method": "pulse", + "source": "auto", + "stereo": true, + "reverse": false, + "bar_delimiter": 0, + "monstercat": false, + "waves": false, + "noise_reduction": 0.77, + "input_delay": 2, + "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], + "actions": { + "on-click-right": "mode" + } + }, + + "wlr/taskbar": { + "format": "{icon}", + "icon-size": 14, + "icon-theme": "Numix-Circle", + "tooltip-format": "{title}", + "on-click": "activate", + "on-click-middle": "close", + "ignore-list": [ + "Alacritty" + ], + "app_ids-mapping": { + "firefoxdeveloperedition": "firefox-developer-edition" + }, + "rewrite": { + "Firefox Web Browser": "Firefox", + "Foot Server": "Terminal" + } + }, + + "pulseaudio/slider": { + "min": 0, + "max": 100, + "orientation": "horizontal" + }, + + "privacy": { + "icon-spacing": 4, + "icon-size": 18, + "transition-duration": 250, + "modules": [ + { + "type": "screenshare", + "tooltip": true, + "tooltip-icon-size": 24 + }, + { + "type": "audio-out", + "tooltip": true, + "tooltip-icon-size": 24 + }, + { + "type": "audio-in", + "tooltip": true, + "tooltip-icon-size": 24 + } + ] + }, + + "custom/music": { + "format": "{}", + "exec": "tail -n 1 -F /tmp/song_detail_last 2>/dev/null", + "on-click": "playerctl play-pause", + "on-click-right": "bash ~/.config/scripts/shared/show_cover.sh", + "on-scroll-up": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+", + "on-scroll-down": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + }, + + "custom/camera": { + "format": "{text}", + "exec": "bash ~/.config/scripts/waybar/camera_monitor.sh bar", + "interval": 1, + "return-type": "json", + "tooltip": true + }, + + "wireplumber": { + "format": "{icon} {volume}% ", + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", + "format-icons": ["", "", ""], + "on-click-right": "pavucontrol", + "format-muted": "\uf00d {volume}%" + }, + + // niri equivalent of hyprland/workspaces. "active-only" does not exist here; + // "current-only" is the same idea. The named app workspaces (code, github, ...) + // show by their name — add them to "ignore-workspaces" to hide them. + "niri/workspaces": { + "format": "{value}", + "current-only": true + }, + "niri/window": { + "format": "{title}" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "\uf06e", + "deactivated": "\uf070" + } + }, + "network": { + "interface": "enp4s0f4u2u1c2", + "format": "{ifname}", + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname} ", + "format-disconnected": "", + "tooltip-format": "{ifname}", + "tooltip-format-wifi": "{essid} ({signalStrength}%) ", + "tooltip-format-ethernet": "{ifname} ", + "tooltip-format-disconnected": "Disconnected", + "max-length": 50 + }, + "cpu": { + "interval": 1, + "format": "{usage}%" + }, + "memory": { + "interval": 1, + "format": "{used:0.1f}" + }, + + "clock": { + "interval" : 1, + "format": "{:%H:%M:%S | %A, %B %d, %Y }", + "format-alt": "{:%H:%M:%S}", + "tooltip-format": "{calendar}", + "on-click-right": "gnome-calendar", + "calendar": { + "format": { + "months": "{}", + "today": "{}" + } + } + }, + "pulseaudio": { + "format": "{icon} {volume}%", + "format-icons": { + "default": ["\uf026", "\uf027", "\uf028"] + }, + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", + "on-click-right": "pavucontrol", + "format-muted": "\uf00d {volume}%" + }, + "group/tray": { + "orientation": "horizontal", + "drawer": { + "transition-duration": 300, + "transition-left-to-right": false + }, + "modules": [ + "custom/tray-toggle", + "tray" + ] + }, + + "custom/tray-toggle": { + "format": "\uf0c9", + "tooltip": false + }, + + "tray": { + "icon-size": 20, + "spacing": 10 + } +}