Niri config with the niri modules
Browse files at this commitb4398089cff96cd392350ebcbe5462472f768a36Parent: d8992e1- feat
- niri config with the niri modules
3 changed files +193 -2
- .config/niri/config.kdl +4 -1
- .config/scripts/niri/wallpaper_picker.sh +3 -1
- .config/waybar/config-niri +186 -0
.config/niri/config.kdlmodified+4 -1
| @@ -110,7 +110,10 @@ environment { | |||
| 110 | // The sleeps preserve Hyprland's ordering (tray applets after waybar). | 110 | // The sleeps preserve Hyprland's ordering (tray applets after waybar). |
| 111 | spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh" | 111 | spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh" |
| 112 | spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh" | 112 | spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh" |
| 113 | -spawn-at-startup "sh" "-c" "sleep 1 && waybar" | 113 | +// waybar needs its own config here: the shared one uses hyprland/workspaces |
| 114 | +// and hyprland/window, which do nothing under niri. config-niri swaps those | ||
| 115 | +// for niri/workspaces and niri/window. | ||
| 116 | +spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri" | ||
| 114 | spawn-at-startup "sh" "-c" "sleep 2 && kdeconnect-indicator" | 117 | spawn-at-startup "sh" "-c" "sleep 2 && kdeconnect-indicator" |
| 115 | spawn-at-startup "sh" "-c" "sleep 3 && /opt/Mullvad\\ VPN/mullvad-vpn" | 118 | spawn-at-startup "sh" "-c" "sleep 3 && /opt/Mullvad\\ VPN/mullvad-vpn" |
| 116 | spawn-at-startup "sh" "-c" "sleep 3 && swaync-client -dn" | 119 | spawn-at-startup "sh" "-c" "sleep 3 && swaync-client -dn" |
.config/scripts/niri/wallpaper_picker.shmodified+3 -1
| @@ -74,6 +74,8 @@ wait | |||
| 74 | # Remember the choice so the daemon can be restored on the next login. | 74 | # Remember the choice so the daemon can be restored on the next login. |
| 75 | echo "$WALLPAPER" > "$STATE_FILE" | 75 | echo "$WALLPAPER" > "$STATE_FILE" |
| 76 | 76 | ||
| 77 | +# -c: the shared waybar config uses the hyprland/* modules, which are inert | ||
| 78 | +# under niri. Must match the config niri starts waybar with. | ||
| 77 | killall waybar 2>/dev/null | 79 | killall waybar 2>/dev/null |
| 78 | -waybar &disown | 80 | +waybar -c "$HOME/.config/waybar/config-niri" &disown |
| 79 | notify-send "Wallpaper Picker" "Applied: $SELECTED" | 81 | notify-send "Wallpaper Picker" "Applied: $SELECTED" |
.config/waybar/config-niriadded+186 -0
| @@ -0,0 +1,186 @@ | |||
| 1 | +{ | ||
| 2 | + "layer": "top", | ||
| 3 | + "position": "top", | ||
| 4 | + "height": 34, | ||
| 5 | + "spacing": 16, | ||
| 6 | + "modules-left": ["niri/workspaces", "custom/music"], | ||
| 7 | + "modules-center": ["clock"], | ||
| 8 | + "modules-right": ["privacy", "cpu", "memory", "wireplumber", "group/tray", "battery"], | ||
| 9 | + | ||
| 10 | + "cava": { | ||
| 11 | + "framerate": 30, | ||
| 12 | + "autosens": 1, | ||
| 13 | + "sensitivity": 100, | ||
| 14 | + "bars": 14, | ||
| 15 | + "lower_cutoff_freq": 50, | ||
| 16 | + "higher_cutoff_freq": 10000, | ||
| 17 | + "method": "pulse", | ||
| 18 | + "source": "auto", | ||
| 19 | + "stereo": true, | ||
| 20 | + "reverse": false, | ||
| 21 | + "bar_delimiter": 0, | ||
| 22 | + "monstercat": false, | ||
| 23 | + "waves": false, | ||
| 24 | + "noise_reduction": 0.77, | ||
| 25 | + "input_delay": 2, | ||
| 26 | + "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], | ||
| 27 | + "actions": { | ||
| 28 | + "on-click-right": "mode" | ||
| 29 | + } | ||
| 30 | + }, | ||
| 31 | + | ||
| 32 | + "wlr/taskbar": { | ||
| 33 | + "format": "{icon}", | ||
| 34 | + "icon-size": 14, | ||
| 35 | + "icon-theme": "Numix-Circle", | ||
| 36 | + "tooltip-format": "{title}", | ||
| 37 | + "on-click": "activate", | ||
| 38 | + "on-click-middle": "close", | ||
| 39 | + "ignore-list": [ | ||
| 40 | + "Alacritty" | ||
| 41 | + ], | ||
| 42 | + "app_ids-mapping": { | ||
| 43 | + "firefoxdeveloperedition": "firefox-developer-edition" | ||
| 44 | + }, | ||
| 45 | + "rewrite": { | ||
| 46 | + "Firefox Web Browser": "Firefox", | ||
| 47 | + "Foot Server": "Terminal" | ||
| 48 | + } | ||
| 49 | + }, | ||
| 50 | + | ||
| 51 | + "pulseaudio/slider": { | ||
| 52 | + "min": 0, | ||
| 53 | + "max": 100, | ||
| 54 | + "orientation": "horizontal" | ||
| 55 | + }, | ||
| 56 | + | ||
| 57 | + "privacy": { | ||
| 58 | + "icon-spacing": 4, | ||
| 59 | + "icon-size": 18, | ||
| 60 | + "transition-duration": 250, | ||
| 61 | + "modules": [ | ||
| 62 | + { | ||
| 63 | + "type": "screenshare", | ||
| 64 | + "tooltip": true, | ||
| 65 | + "tooltip-icon-size": 24 | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + "type": "audio-out", | ||
| 69 | + "tooltip": true, | ||
| 70 | + "tooltip-icon-size": 24 | ||
| 71 | + }, | ||
| 72 | + { | ||
| 73 | + "type": "audio-in", | ||
| 74 | + "tooltip": true, | ||
| 75 | + "tooltip-icon-size": 24 | ||
| 76 | + } | ||
| 77 | + ] | ||
| 78 | + }, | ||
| 79 | + | ||
| 80 | + "custom/music": { | ||
| 81 | + "format": "{}", | ||
| 82 | + "exec": "tail -n 1 -F /tmp/song_detail_last 2>/dev/null", | ||
| 83 | + "on-click": "playerctl play-pause", | ||
| 84 | + "on-click-right": "bash ~/.config/scripts/shared/show_cover.sh", | ||
| 85 | + "on-scroll-up": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+", | ||
| 86 | + "on-scroll-down": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" | ||
| 87 | + }, | ||
| 88 | + | ||
| 89 | + "custom/camera": { | ||
| 90 | + "format": "{text}", | ||
| 91 | + "exec": "bash ~/.config/scripts/waybar/camera_monitor.sh bar", | ||
| 92 | + "interval": 1, | ||
| 93 | + "return-type": "json", | ||
| 94 | + "tooltip": true | ||
| 95 | + }, | ||
| 96 | + | ||
| 97 | + "wireplumber": { | ||
| 98 | + "format": "{icon} {volume}% ", | ||
| 99 | + "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle", | ||
| 100 | + "format-icons": ["", "", ""], | ||
| 101 | + "on-click-right": "pavucontrol", | ||
| 102 | + "format-muted": "\uf00d {volume}%" | ||
| 103 | + }, | ||
| 104 | + | ||
| 105 | + // niri equivalent of hyprland/workspaces. "active-only" does not exist here; | ||
| 106 | + // "current-only" is the same idea. The named app workspaces (code, github, ...) | ||
| 107 | + // show by their name — add them to "ignore-workspaces" to hide them. | ||
| 108 | + "niri/workspaces": { | ||
| 109 | + "format": "{value}", | ||
| 110 | + "current-only": true | ||
| 111 | + }, | ||
| 112 | + "niri/window": { | ||
| 113 | + "format": "{title}" | ||
| 114 | + }, | ||
| 115 | + "idle_inhibitor": { | ||
| 116 | + "format": "{icon}", | ||
| 117 | + "format-icons": { | ||
| 118 | + "activated": "\uf06e", | ||
| 119 | + "deactivated": "\uf070" | ||
| 120 | + } | ||
| 121 | + }, | ||
| 122 | + "network": { | ||
| 123 | + "interface": "enp4s0f4u2u1c2", | ||
| 124 | + "format": "{ifname}", | ||
| 125 | + "format-wifi": "{essid} ({signalStrength}%) ", | ||
| 126 | + "format-ethernet": "{ifname} ", | ||
| 127 | + "format-disconnected": "", | ||
| 128 | + "tooltip-format": "{ifname}", | ||
| 129 | + "tooltip-format-wifi": "{essid} ({signalStrength}%) ", | ||
| 130 | + "tooltip-format-ethernet": "{ifname} ", | ||
| 131 | + "tooltip-format-disconnected": "Disconnected", | ||
| 132 | + "max-length": 50 | ||
| 133 | + }, | ||
| 134 | + "cpu": { | ||
| 135 | + "interval": 1, | ||
| 136 | + "format": "{usage}%" | ||
| 137 | + }, | ||
| 138 | + "memory": { | ||
| 139 | + "interval": 1, | ||
| 140 | + "format": "{used:0.1f}" | ||
| 141 | + }, | ||
| 142 | + | ||
| 143 | + "clock": { | ||
| 144 | + "interval" : 1, | ||
| 145 | + "format": "{:%H:%M:%S | %A, %B %d, %Y }", | ||
| 146 | + "format-alt": "{:%H:%M:%S}", | ||
| 147 | + "tooltip-format": "<tt><small>{calendar}</small></tt>", | ||
| 148 | + "on-click-right": "gnome-calendar", | ||
| 149 | + "calendar": { | ||
| 150 | + "format": { | ||
| 151 | + "months": "<span color='#ffead3'><b>{}</b></span>", | ||
| 152 | + "today": "<span color='#ff6699'><b>{}</b></span>" | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + }, | ||
| 156 | + "pulseaudio": { | ||
| 157 | + "format": "{icon} {volume}%", | ||
| 158 | + "format-icons": { | ||
| 159 | + "default": ["\uf026", "\uf027", "\uf028"] | ||
| 160 | + }, | ||
| 161 | + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", | ||
| 162 | + "on-click-right": "pavucontrol", | ||
| 163 | + "format-muted": "\uf00d {volume}%" | ||
| 164 | + }, | ||
| 165 | + "group/tray": { | ||
| 166 | + "orientation": "horizontal", | ||
| 167 | + "drawer": { | ||
| 168 | + "transition-duration": 300, | ||
| 169 | + "transition-left-to-right": false | ||
| 170 | + }, | ||
| 171 | + "modules": [ | ||
| 172 | + "custom/tray-toggle", | ||
| 173 | + "tray" | ||
| 174 | + ] | ||
| 175 | + }, | ||
| 176 | + | ||
| 177 | + "custom/tray-toggle": { | ||
| 178 | + "format": "\uf0c9", | ||
| 179 | + "tooltip": false | ||
| 180 | + }, | ||
| 181 | + | ||
| 182 | + "tray": { | ||
| 183 | + "icon-size": 20, | ||
| 184 | + "spacing": 10 | ||
| 185 | + } | ||
| 186 | +} | ||