this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix kdeconnect and battery notif scripts

Ben C 0b746352 c55bbc49

+1641 -406
+27 -27
flake.lock
··· 46 46 }, 47 47 "crane": { 48 48 "locked": { 49 - "lastModified": 1757183466, 50 - "narHash": "sha256-kTdCCMuRE+/HNHES5JYsbRHmgtr+l9mOtf5dpcMppVc=", 49 + "lastModified": 1762538466, 50 + "narHash": "sha256-8zrIPl6J+wLm9MH5ksHcW7BUHo7jSNOu0/hA0ohOOaM=", 51 51 "owner": "ipetkov", 52 52 "repo": "crane", 53 - "rev": "d599ae4847e7f87603e7082d73ca673aa93c916d", 53 + "rev": "0cea393fffb39575c46b7a0318386467272182fe", 54 54 "type": "github" 55 55 }, 56 56 "original": { ··· 330 330 ] 331 331 }, 332 332 "locked": { 333 - "lastModified": 1758026969, 334 - "narHash": "sha256-tKzssVn3pZzQwXbtTWvanGC1hUvmImoEC5JC3ky0BdE=", 333 + "lastModified": 1762865542, 334 + "narHash": "sha256-ye0wzGV4RJ2tO1tMQsw8hqlQxu6F8owPKgePHEFSdE0=", 335 335 "owner": "accelbread", 336 336 "repo": "flakelight-rust", 337 - "rev": "8790a04e736a7651bab4d277e75aea82379dde2b", 337 + "rev": "ba4c6d47cc064110bc6138ba8573c23264af00ba", 338 338 "type": "github" 339 339 }, 340 340 "original": { ··· 371 371 ] 372 372 }, 373 373 "locked": { 374 - "lastModified": 1758214611, 375 - "narHash": "sha256-5YLeUhF7Nu85fNi5ElWexJ4ViiY041I0mBLLzOhg2DQ=", 374 + "lastModified": 1762844981, 375 + "narHash": "sha256-Sghy+Gi+zcUDFfdDJuKyPMtF/klSTeWjmJZoQH7SwzA=", 376 376 "owner": "nix-community", 377 377 "repo": "flakelight", 378 - "rev": "464ab0a32efcc4310eef119cfc6c470e267cd42a", 378 + "rev": "faf9643dce373b7a556c77af8f8b961a75a066a4", 379 379 "type": "github" 380 380 }, 381 381 "original": { ··· 392 392 ] 393 393 }, 394 394 "locked": { 395 - "lastModified": 1761155197, 396 - "narHash": "sha256-3NcqyhZkWrqY0qlnXqtV82vGwaQ7Be3Ll1w7+NPzq8w=", 395 + "lastModified": 1762844981, 396 + "narHash": "sha256-Sghy+Gi+zcUDFfdDJuKyPMtF/klSTeWjmJZoQH7SwzA=", 397 397 "owner": "nix-community", 398 398 "repo": "flakelight", 399 - "rev": "5afd70555737c62786b69a64980e7bb1c1947956", 399 + "rev": "faf9643dce373b7a556c77af8f8b961a75a066a4", 400 400 "type": "github" 401 401 }, 402 402 "original": { ··· 413 413 ] 414 414 }, 415 415 "locked": { 416 - "lastModified": 1758214611, 417 - "narHash": "sha256-5YLeUhF7Nu85fNi5ElWexJ4ViiY041I0mBLLzOhg2DQ=", 416 + "lastModified": 1762844981, 417 + "narHash": "sha256-Sghy+Gi+zcUDFfdDJuKyPMtF/klSTeWjmJZoQH7SwzA=", 418 418 "owner": "nix-community", 419 419 "repo": "flakelight", 420 - "rev": "464ab0a32efcc4310eef119cfc6c470e267cd42a", 420 + "rev": "faf9643dce373b7a556c77af8f8b961a75a066a4", 421 421 "type": "github" 422 422 }, 423 423 "original": { ··· 435 435 ] 436 436 }, 437 437 "locked": { 438 - "lastModified": 1758283165, 439 - "narHash": "sha256-rNp0VvplyuwsPqX5CIWc86i9TVFhn25lHPuheD+BHwE=", 438 + "lastModified": 1762968306, 439 + "narHash": "sha256-xPjGdFQXE9xXMA/CmWTkgrpp6Wtqy0Yo+Q8cQbanQSQ=", 440 440 "owner": "Bwc9876", 441 441 "repo": "gh-grader-preview", 442 - "rev": "782c0a0ba9de755122bc670c6098258c9da5e493", 442 + "rev": "4c13612797c048c141e437217c7cec2d74c38cd5", 443 443 "type": "github" 444 444 }, 445 445 "original": { ··· 477 477 ] 478 478 }, 479 479 "locked": { 480 - "lastModified": 1762787259, 481 - "narHash": "sha256-t2U/GLLXHa2+kJkwnFNRVc2fEJ/lUfyZXBE5iKzJdcs=", 480 + "lastModified": 1762964643, 481 + "narHash": "sha256-RYHN8O/Aja59XDji6WSJZPkJpYVUfpSkyH+PEupBJqM=", 482 482 "owner": "nix-community", 483 483 "repo": "home-manager", 484 - "rev": "37a3d97f2873e0f68711117c34d04b7c7ead8f4e", 484 + "rev": "827f2a23373a774a8805f84ca5344654c31f354b", 485 485 "type": "github" 486 486 }, 487 487 "original": { ··· 789 789 ] 790 790 }, 791 791 "locked": { 792 - "lastModified": 1761235019, 793 - "narHash": "sha256-jkseFs9Ty4x8FyVDzyFLh6enwIDBdcfZrUjE++5W9uA=", 792 + "lastModified": 1762970441, 793 + "narHash": "sha256-GM9lALQTLo6p60TSBTRGfRuZYswDodD6XSTDBNSnoUg=", 794 794 "owner": "Bwc9876", 795 795 "repo": "nu_plugin_dbus", 796 - "rev": "47e1e232e44b38fc975839656124c74897ed3425", 796 + "rev": "90687b4b3d34acc588ffa473ccece3b48a83c43b", 797 797 "type": "github" 798 798 }, 799 799 "original": { ··· 1105 1105 ] 1106 1106 }, 1107 1107 "locked": { 1108 - "lastModified": 1758283441, 1109 - "narHash": "sha256-L7Px0c+cwmMK81XUc9vrwF9/6GD82Y2MGLRof3tS09E=", 1108 + "lastModified": 1762968193, 1109 + "narHash": "sha256-w5+Ie7ObwqhAPV/WOvT1UyFK80aLNN5RQlfkyUqVkg0=", 1110 1110 "owner": "Bwc9876", 1111 1111 "repo": "wayland-mpris-idle-inhibit", 1112 - "rev": "4a776219b880d8fca3ab645ead0da67d5d7f6369", 1112 + "rev": "2d21359c1d805a327133cf4c7c45f6230a8f8866", 1113 1113 "type": "github" 1114 1114 }, 1115 1115 "original": {
+19 -20
flake.nix
··· 39 39 }; 40 40 }; 41 41 42 - outputs = 43 - inputs@{ 44 - self, 45 - nixpkgs, 46 - flakelight, 47 - nix-index-db, 48 - hm, 49 - nixos-hardware, 50 - lanzaboote, 51 - wayland-mpris-idle-inhibit, 52 - fenix, 53 - catppuccin, 54 - nixvim, 55 - imperm, 56 - nu_plugin_dbus, 57 - bingus, 58 - spoon, 59 - gh-grader-preview, 60 - niri, 61 - }: 42 + outputs = inputs @ { 43 + self, 44 + nixpkgs, 45 + flakelight, 46 + nix-index-db, 47 + hm, 48 + nixos-hardware, 49 + lanzaboote, 50 + wayland-mpris-idle-inhibit, 51 + fenix, 52 + catppuccin, 53 + nixvim, 54 + imperm, 55 + nu_plugin_dbus, 56 + bingus, 57 + spoon, 58 + gh-grader-preview, 59 + niri, 60 + }: 62 61 flakelight ./. { 63 62 imports = [ 64 63 spoon.flakelightModules.repl
+296 -312
homeModules/gdi.nix
··· 1 - { inputs, ... }: 2 - { 1 + {inputs, ...}: { 3 2 config, 4 3 lib, 5 4 pkgs, 6 5 ... 7 - }: 8 - { 9 - imports = [ inputs.niri.homeModules.niri ]; 6 + }: { 7 + imports = [inputs.niri.homeModules.niri]; 10 8 11 9 # TODO: Replace Hyprland with Niri, switch out gdi.nix for this 12 10 options.cow.gdi = { ··· 14 12 doIdle = lib.mkEnableOption "Turn off screen, sleep, etc. from inactivity"; 15 13 }; 16 14 17 - config = 18 - let 19 - iconTheme = { 20 - name = "Tela-green"; 21 - package = pkgs.tela-icon-theme; 22 - }; 23 - cursorTheme = { 24 - name = "catppuccin-mocha-dark-cursors"; 25 - package = pkgs.catppuccin-cursors.mochaDark; 26 - size = 24; 27 - }; 28 - in 15 + config = let 16 + iconTheme = { 17 + name = "Tela-green"; 18 + package = pkgs.tela-icon-theme; 19 + }; 20 + cursorTheme = { 21 + name = "catppuccin-mocha-dark-cursors"; 22 + package = pkgs.catppuccin-cursors.mochaDark; 23 + size = 24; 24 + }; 25 + in 29 26 lib.mkIf config.cow.gdi.enable { 30 - nixpkgs.overlays = [ inputs.niri.overlays.niri ]; 27 + nixpkgs.overlays = [inputs.niri.overlays.niri]; 31 28 32 29 # Me when I'm stupid and enable my preferred keyring unconditionally in a flake for a WM 33 30 services.gnome-keyring.enable = lib.mkForce false; ··· 90 87 91 88 window-rules = [ 92 89 { 93 - geometry-corner-radius = 94 - let 95 - s = 10.0; 96 - in 97 - { 98 - top-left = s; 99 - top-right = s; 100 - bottom-left = s; 101 - bottom-right = s; 102 - }; 90 + geometry-corner-radius = let 91 + s = 10.0; 92 + in { 93 + top-left = s; 94 + top-right = s; 95 + bottom-left = s; 96 + bottom-right = s; 97 + }; 103 98 clip-to-geometry = true; 104 99 } 105 100 ]; ··· 129 124 }; 130 125 }; 131 126 132 - binds = 133 - with config.lib.niri.actions; 134 - let 135 - spawnPkg = p: spawn "${lib.getExe p}"; 136 - move-column-to-workspace = n: { move-column-to-workspace = [ n ]; }; 137 - terminal = pkgs.wezterm; 138 - spawnTerm = spawnPkg terminal; 139 - spawnPlayerctl = spawnPkg pkgs.playerctl; 140 - spawnRofi = spawn "rofi"; 141 - spawnSh = spawn "sh" "-c"; 142 - spawnOsd = spawn "${pkgs.swayosd}/bin/swayosd-client"; 143 - launchDesktop = x: spawn "${pkgs.gtk3}/bin/gtk-launch" "${x}.desktop"; 144 - brightness = spawnOsd "--brightness"; 145 - volume = spawnOsd "--output-volume"; 146 - in 147 - { 148 - # Niri Stuff 127 + binds = with config.lib.niri.actions; let 128 + spawnPkg = p: spawn "${lib.getExe p}"; 129 + move-column-to-workspace = n: {move-column-to-workspace = [n];}; 130 + terminal = pkgs.wezterm; 131 + spawnTerm = spawnPkg terminal; 132 + spawnPlayerctl = spawnPkg pkgs.playerctl; 133 + spawnRofi = spawn "rofi"; 134 + spawnSh = spawn "sh" "-c"; 135 + spawnOsd = spawn "${pkgs.swayosd}/bin/swayosd-client"; 136 + launchDesktop = x: spawn "${pkgs.gtk3}/bin/gtk-launch" "${x}.desktop"; 137 + brightness = spawnOsd "--brightness"; 138 + volume = spawnOsd "--output-volume"; 139 + in { 140 + # Niri Stuff 149 141 150 - ## Basics 151 - "Mod+X".action = quit; 152 - "Mod+Tab".action = toggle-overview; 153 - "Mod+Slash".action = show-hotkey-overlay; 154 - "Mod+C".action = close-window; 142 + ## Basics 143 + "Mod+X".action = quit; 144 + "Mod+Tab".action = toggle-overview; 145 + "Mod+Slash".action = show-hotkey-overlay; 146 + "Mod+C".action = close-window; 155 147 156 - "Mod+Left".action = focus-column-left; 157 - "Mod+Down".action = focus-window-down; 158 - "Mod+Up".action = focus-window-up; 159 - "Mod+Right".action = focus-column-right; 148 + "Mod+Left".action = focus-column-left; 149 + "Mod+Down".action = focus-window-down; 150 + "Mod+Up".action = focus-window-up; 151 + "Mod+Right".action = focus-column-right; 160 152 161 - "Mod+Shift+Left".action = move-column-left; 162 - "Mod+Shift+Down".action = move-window-down; 163 - "Mod+Shift+Up".action = move-window-up; 164 - "Mod+Shift+Right".action = move-column-right; 153 + "Mod+Shift+Left".action = move-column-left; 154 + "Mod+Shift+Down".action = move-window-down; 155 + "Mod+Shift+Up".action = move-window-up; 156 + "Mod+Shift+Right".action = move-column-right; 165 157 166 - "Mod+Home".action = focus-column-first; 167 - "Mod+End".action = focus-column-last; 168 - "Mod+Shift+Home".action = move-column-to-first; 169 - "Mod+Shift+End".action = move-column-to-last; 158 + "Mod+Home".action = focus-column-first; 159 + "Mod+End".action = focus-column-last; 160 + "Mod+Shift+Home".action = move-column-to-first; 161 + "Mod+Shift+End".action = move-column-to-last; 170 162 171 - "Mod+BracketLeft".action = consume-or-expel-window-left; 172 - "Mod+BracketRight".action = consume-or-expel-window-right; 163 + "Mod+BracketLeft".action = consume-or-expel-window-left; 164 + "Mod+BracketRight".action = consume-or-expel-window-right; 173 165 174 - "Mod+F".action = maximize-column; 175 - "Mod+Shift+F".action = fullscreen-window; 176 - "Mod+Ctrl+F".action = expand-column-to-available-width; 177 - "Mod+Ctrl+Shift+F".action = toggle-windowed-fullscreen; 166 + "Mod+F".action = maximize-column; 167 + "Mod+Shift+F".action = fullscreen-window; 168 + "Mod+Ctrl+F".action = expand-column-to-available-width; 169 + "Mod+Ctrl+Shift+F".action = toggle-windowed-fullscreen; 178 170 179 - "Mod+Page_Down".action = focus-workspace-down; 180 - "Mod+Page_Up".action = focus-workspace-up; 181 - "Mod+U".action = focus-workspace-down; 182 - "Mod+I".action = focus-workspace-up; 183 - "Mod+Shift+Page_Down".action = move-column-to-workspace-down; 184 - "Mod+Shift+Page_Up".action = move-column-to-workspace-up; 185 - "Mod+Shift+U".action = move-column-to-workspace-down; 186 - "Mod+Shift+I".action = move-column-to-workspace-up; 171 + "Mod+Page_Down".action = focus-workspace-down; 172 + "Mod+Page_Up".action = focus-workspace-up; 173 + "Mod+U".action = focus-workspace-down; 174 + "Mod+I".action = focus-workspace-up; 175 + "Mod+Shift+Page_Down".action = move-column-to-workspace-down; 176 + "Mod+Shift+Page_Up".action = move-column-to-workspace-up; 177 + "Mod+Shift+U".action = move-column-to-workspace-down; 178 + "Mod+Shift+I".action = move-column-to-workspace-up; 187 179 188 - "Mod+1".action = focus-workspace 1; 189 - "Mod+2".action = focus-workspace 2; 190 - "Mod+3".action = focus-workspace 3; 191 - "Mod+4".action = focus-workspace 4; 192 - "Mod+5".action = focus-workspace 5; 193 - "Mod+6".action = focus-workspace 6; 194 - "Mod+7".action = focus-workspace 7; 195 - "Mod+8".action = focus-workspace 8; 196 - "Mod+9".action = focus-workspace 9; 197 - "Mod+Ctrl+1".action = move-column-to-workspace 1; 198 - "Mod+Ctrl+2".action = move-column-to-workspace 2; 199 - "Mod+Ctrl+3".action = move-column-to-workspace 3; 200 - "Mod+Ctrl+4".action = move-column-to-workspace 4; 201 - "Mod+Ctrl+5".action = move-column-to-workspace 5; 202 - "Mod+Ctrl+6".action = move-column-to-workspace 6; 203 - "Mod+Ctrl+7".action = move-column-to-workspace 7; 204 - "Mod+Ctrl+8".action = move-column-to-workspace 8; 205 - "Mod+Ctrl+9".action = move-column-to-workspace 9; 180 + "Mod+1".action = focus-workspace 1; 181 + "Mod+2".action = focus-workspace 2; 182 + "Mod+3".action = focus-workspace 3; 183 + "Mod+4".action = focus-workspace 4; 184 + "Mod+5".action = focus-workspace 5; 185 + "Mod+6".action = focus-workspace 6; 186 + "Mod+7".action = focus-workspace 7; 187 + "Mod+8".action = focus-workspace 8; 188 + "Mod+9".action = focus-workspace 9; 189 + "Mod+Ctrl+1".action = move-column-to-workspace 1; 190 + "Mod+Ctrl+2".action = move-column-to-workspace 2; 191 + "Mod+Ctrl+3".action = move-column-to-workspace 3; 192 + "Mod+Ctrl+4".action = move-column-to-workspace 4; 193 + "Mod+Ctrl+5".action = move-column-to-workspace 5; 194 + "Mod+Ctrl+6".action = move-column-to-workspace 6; 195 + "Mod+Ctrl+7".action = move-column-to-workspace 7; 196 + "Mod+Ctrl+8".action = move-column-to-workspace 8; 197 + "Mod+Ctrl+9".action = move-column-to-workspace 9; 206 198 207 - "Mod+Escape" = { 208 - action = toggle-keyboard-shortcuts-inhibit; 209 - allow-inhibiting = false; 210 - }; 199 + "Mod+Escape" = { 200 + action = toggle-keyboard-shortcuts-inhibit; 201 + allow-inhibiting = false; 202 + }; 211 203 212 - "Mod+W".action = spawn "systemctl" "--user" "restart" "waybar.service"; 213 - "Mod+Shift+W".action = spawn "systemctl" "--user" "stop" "waybar.service"; 204 + "Mod+W".action = spawn "systemctl" "--user" "restart" "waybar.service"; 205 + "Mod+Shift+W".action = spawn "systemctl" "--user" "stop" "waybar.service"; 214 206 215 - "Mod+Shift+R".action = 216 - spawnSh "pkill wf-recorder --signal SIGINT ||${pkgs.nushell}/bin/nu ${../res/screenrec.nu}"; 217 - "Mod+Shift+S".action = { 218 - screenshot = [ ]; 219 - }; 220 - "Print".action = { 221 - screenshot = [ ]; 222 - }; 223 - "Mod+L".action = spawnSh "pidof hyprlock || hyprlock --immediate"; 224 - "Mod+Z".action = spawn "systemctl" "suspend"; 225 - "Super+Alt+Ctrl+Shift+L".action = spawn "xdg-open" "https://linkedin.com"; 207 + "Mod+Shift+R".action = 208 + spawnSh "pkill wf-recorder --signal SIGINT ||${pkgs.nushell}/bin/nu ${../res/screenrec.nu}"; 209 + "Mod+Shift+S".action = { 210 + screenshot = []; 211 + }; 212 + "Print".action = { 213 + screenshot = []; 214 + }; 215 + "Mod+L".action = spawnSh "pidof hyprlock || hyprlock --immediate"; 216 + "Mod+Z".action = spawn "systemctl" "suspend"; 217 + "Super+Alt+Ctrl+Shift+L".action = spawn "xdg-open" "https://linkedin.com"; 226 218 227 - # Terminal 228 - "Mod+T".action = spawnTerm; 219 + # Terminal 220 + "Mod+T".action = spawnTerm; 229 221 230 - # Rofi 231 - "Mod+S".action = spawnRofi "-show" "drun" "-show-icons"; 232 - "Mod+B".action = spawnPkg pkgs.rofi-bluetooth; 233 - "Mod+Shift+E".action = spawnRofi "-modi" "emoji" "-show" "emoji"; 234 - "Mod+Alt+C".action = 235 - spawnRofi "-show" "calc" "-modi" "calc" "-no-show-match" "-no-sort" "-calc-command" 236 - "echo -n '{result}' | wl-copy"; 237 - "Mod+V".action = 238 - spawnSh "cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy"; 239 - "Mod+Alt+V".action = 240 - spawnSh "echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe"; 222 + # Rofi 223 + "Mod+S".action = spawnRofi "-show" "drun" "-show-icons"; 224 + "Mod+B".action = spawnPkg pkgs.rofi-bluetooth; 225 + "Mod+Shift+E".action = spawnRofi "-modi" "emoji" "-show" "emoji"; 226 + "Mod+Alt+C".action = 227 + spawnRofi "-show" "calc" "-modi" "calc" "-no-show-match" "-no-sort" "-calc-command" 228 + "echo -n '{result}' | wl-copy"; 229 + "Mod+V".action = 230 + spawnSh "cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy"; 231 + "Mod+Alt+V".action = 232 + spawnSh "echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe"; 241 233 242 - # Yazi 243 - "Mod+E".action = lib.mkIf config.cow.yazi.enable (launchDesktop "yazi"); 234 + # Yazi 235 + "Mod+E".action = lib.mkIf config.cow.yazi.enable (launchDesktop "yazi"); 244 236 245 - # Firefox 246 - "Mod+Q".action = lib.mkIf config.cow.firefox.enable (launchDesktop "firefox-devedition"); 237 + # Firefox 238 + "Mod+Q".action = lib.mkIf config.cow.firefox.enable (launchDesktop "firefox-devedition"); 247 239 248 - # Pavucontrol 249 - "Mod+A".action = spawnPkg pkgs.pavucontrol "--tab" "5"; 240 + # Pavucontrol 241 + "Mod+A".action = spawnPkg pkgs.pavucontrol "--tab" "5"; 250 242 251 - # Brightness 252 - "XF86MonBrightnessUp" = { 253 - action = brightness "raise"; 254 - allow-when-locked = true; 255 - }; 256 - "XF86MonBrightnessDown" = { 257 - action = brightness "lower"; 258 - allow-when-locked = true; 259 - }; 243 + # Brightness 244 + "XF86MonBrightnessUp" = { 245 + action = brightness "raise"; 246 + allow-when-locked = true; 247 + }; 248 + "XF86MonBrightnessDown" = { 249 + action = brightness "lower"; 250 + allow-when-locked = true; 251 + }; 260 252 261 - # Volume 262 - "XF86AudioRaiseVolume" = { 263 - action = volume "raise"; 264 - allow-when-locked = true; 265 - }; 266 - "XF86AudioLowerVolume" = { 267 - action = volume "lower"; 268 - allow-when-locked = true; 269 - }; 270 - "XF86AudioMute" = { 271 - action = volume "mute-toggle"; 272 - allow-when-locked = true; 273 - }; 253 + # Volume 254 + "XF86AudioRaiseVolume" = { 255 + action = volume "raise"; 256 + allow-when-locked = true; 257 + }; 258 + "XF86AudioLowerVolume" = { 259 + action = volume "lower"; 260 + allow-when-locked = true; 261 + }; 262 + "XF86AudioMute" = { 263 + action = volume "mute-toggle"; 264 + allow-when-locked = true; 265 + }; 274 266 275 - # Playerctl 276 - "XF86AudioPlay" = { 277 - action = spawnPlayerctl "play-pause"; 278 - allow-when-locked = true; 279 - }; 280 - "XF86AudioPause" = { 281 - action = spawnPlayerctl "pause"; 282 - allow-when-locked = true; 283 - }; 284 - "XF86AudioStop" = { 285 - action = spawnPlayerctl "stop"; 286 - allow-when-locked = true; 287 - }; 288 - "XF86AudioNext" = { 289 - action = spawnPlayerctl "next"; 290 - allow-when-locked = true; 291 - }; 292 - "XF86AudioPrev" = { 293 - action = spawnPlayerctl "previous"; 294 - allow-when-locked = true; 295 - }; 267 + # Playerctl 268 + "XF86AudioPlay" = { 269 + action = spawnPlayerctl "play-pause"; 270 + allow-when-locked = true; 296 271 }; 272 + "XF86AudioPause" = { 273 + action = spawnPlayerctl "pause"; 274 + allow-when-locked = true; 275 + }; 276 + "XF86AudioStop" = { 277 + action = spawnPlayerctl "stop"; 278 + allow-when-locked = true; 279 + }; 280 + "XF86AudioNext" = { 281 + action = spawnPlayerctl "next"; 282 + allow-when-locked = true; 283 + }; 284 + "XF86AudioPrev" = { 285 + action = spawnPlayerctl "previous"; 286 + allow-when-locked = true; 287 + }; 288 + }; 297 289 }; 298 290 }; 299 291 ··· 405 397 406 398 catppuccin.rofi.enable = false; 407 399 408 - systemd.user.services = 409 - let 410 - target = config.wayland.systemd.target; 411 - mkShellService = 412 - { 413 - desc, 414 - service, 415 - }: 416 - { 417 - Install = { 418 - WantedBy = [ target ]; 419 - }; 400 + systemd.user.services = let 401 + target = config.wayland.systemd.target; 402 + mkShellService = { 403 + desc, 404 + service, 405 + }: { 406 + Install = { 407 + WantedBy = [target]; 408 + }; 420 409 421 - Unit = { 422 - ConditionEnvironment = "WAYLAND_DISPLAY"; 423 - Description = desc; 424 - After = [ target ]; 425 - PartOf = [ target ]; 426 - }; 410 + Unit = { 411 + ConditionEnvironment = "WAYLAND_DISPLAY"; 412 + Description = desc; 413 + After = [target]; 414 + PartOf = [target]; 415 + }; 427 416 428 - Service = service; 429 - }; 430 - in 431 - { 432 - battery-notif = mkShellService { 433 - desc = "Battery Notification Service"; 417 + Service = service; 418 + }; 419 + in { 420 + battery-notif = mkShellService { 421 + desc = "Battery Notification Service"; 434 422 435 - service = { 436 - ExecStart = "${pkgs.nushell}/bin/nu --plugins ${ 437 - inputs.nu_plugin_dbus.packages.${pkgs.system}.default 438 - } ${../res/battery_notif.nu}"; 439 - Restart = "on-failure"; 440 - RestartSec = "10"; 441 - }; 423 + service = { 424 + ExecStart = ''${pkgs.nushell}/bin/nu --plugins "[${ 425 + lib.getExe inputs.nu_plugin_dbus.packages.${pkgs.system}.default 426 + }]" ${../res/battery_notif.nu}''; 427 + Restart = "on-failure"; 428 + RestartSec = "10"; 442 429 }; 430 + }; 443 431 444 - swaybg = lib.mkIf config.cow.pictures.enable (mkShellService { 445 - desc = "Sway Background Image"; 446 - service = { 447 - ExecStart = "${lib.getExe pkgs.swaybg} -m fill --image ${config.cow.pictures.bg}"; 448 - Restart = "on-failure"; 449 - RestartSec = "10"; 450 - }; 451 - }); 432 + swaybg = lib.mkIf config.cow.pictures.enable (mkShellService { 433 + desc = "Sway Background Image"; 434 + service = { 435 + ExecStart = "${lib.getExe pkgs.swaybg} -m fill --image ${config.cow.pictures.bg}"; 436 + Restart = "on-failure"; 437 + RestartSec = "10"; 438 + }; 439 + }); 452 440 453 - mpris-idle-inhibit = mkShellService { 454 - desc = "MPRIS Idle Inhibitor"; 441 + mpris-idle-inhibit = mkShellService { 442 + desc = "MPRIS Idle Inhibitor"; 455 443 456 - service = { 457 - ExecStart = ''${ 444 + service = { 445 + ExecStart = ''${ 458 446 inputs.wayland-mpris-idle-inhibit.packages.${pkgs.system}.default 459 447 }/bin/wayland-mpris-idle-inhibit --ignore "kdeconnect" --ignore "playerctld"''; 460 - Restart = "on-failure"; 461 - RestartSec = "10"; 462 - }; 448 + Restart = "on-failure"; 449 + RestartSec = "10"; 463 450 }; 464 451 }; 452 + }; 465 453 466 454 qt = { 467 455 enable = true; ··· 541 529 }; 542 530 }; 543 531 544 - swayidle = 545 - let 546 - lockCmd = args: "pidof hyprlock || ${lib.getExe pkgs.hyprlock} ${args} &"; 547 - in 532 + swayidle = let 533 + lockCmd = args: "pidof hyprlock || ${lib.getExe pkgs.hyprlock} ${args} &"; 534 + in 548 535 lib.mkIf config.cow.gdi.doIdle { 549 536 enable = true; 550 537 timeouts = [ ··· 616 603 rofi-pulse-select 617 604 ]; 618 605 }; 619 - theme = 620 - let 621 - inherit (config.lib.formats.rasi) mkLiteral; 622 - in 623 - { 624 - "@import" = 625 - "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.catppuccin.rofi.flavor}.rasi"; 626 - "*" = 627 - (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 628 - "bg0" = "base"; 629 - "bg1" = "mantle"; 630 - "bg2" = "crust"; 631 - "bg3" = config.catppuccin.accent; 632 - "fg0" = "subtext1"; 633 - "fg1" = "text"; 634 - "fg2" = "subtext0"; 635 - "fg3" = "overlay0"; 636 - "fg4" = "surface0"; 637 - }) 638 - // { 639 - font = mkLiteral ''"Roboto 14"''; 640 - background-color = mkLiteral ''transparent''; 641 - text-color = mkLiteral ''@fg0''; 642 - margin = mkLiteral ''0px''; 643 - padding = mkLiteral ''0px''; 644 - spacing = mkLiteral ''0px''; 645 - }; 646 - "window" = { 647 - location = mkLiteral ''north''; 648 - y-offset = mkLiteral ''calc(50% - 176px)''; 649 - width = mkLiteral ''600''; 650 - border-radius = mkLiteral ''24px''; 651 - background-color = mkLiteral ''@bg0''; 652 - }; 653 - "mainbox" = { 654 - padding = mkLiteral ''12px''; 655 - }; 656 - "inputbar" = { 657 - background-color = mkLiteral ''@bg1''; 658 - border-color = mkLiteral ''@bg3''; 659 - border = mkLiteral ''2px''; 660 - border-radius = mkLiteral ''16px''; 661 - padding = mkLiteral ''8px 16px''; 662 - spacing = mkLiteral ''8px''; 663 - children = mkLiteral ''[ prompt, entry ]''; 664 - }; 665 - "prompt" = { 666 - text-color = mkLiteral ''@fg2''; 667 - }; 668 - "entry" = { 669 - placeholder = mkLiteral ''"Search"''; 670 - placeholder-color = mkLiteral ''@fg3''; 671 - }; 672 - "message" = { 673 - margin = mkLiteral ''12px 0 0''; 674 - border-radius = mkLiteral ''16px''; 675 - border-color = mkLiteral ''@bg2''; 676 - background-color = mkLiteral ''@bg2''; 677 - }; 678 - "textbox" = { 679 - padding = mkLiteral ''8px 24px''; 680 - }; 681 - "listview" = { 606 + theme = let 607 + inherit (config.lib.formats.rasi) mkLiteral; 608 + in { 609 + "@import" = "${config.catppuccin.sources.rofi}/themes/catppuccin-${config.catppuccin.rofi.flavor}.rasi"; 610 + "*" = 611 + (builtins.mapAttrs (name: value: mkLiteral "@${value}") { 612 + "bg0" = "base"; 613 + "bg1" = "mantle"; 614 + "bg2" = "crust"; 615 + "bg3" = config.catppuccin.accent; 616 + "fg0" = "subtext1"; 617 + "fg1" = "text"; 618 + "fg2" = "subtext0"; 619 + "fg3" = "overlay0"; 620 + "fg4" = "surface0"; 621 + }) 622 + // { 623 + font = mkLiteral ''"Roboto 14"''; 682 624 background-color = mkLiteral ''transparent''; 683 - margin = mkLiteral ''12px 0 0''; 684 - lines = mkLiteral ''8''; 685 - columns = mkLiteral ''2''; 686 - fixed-height = mkLiteral ''false''; 687 - }; 688 - "element" = { 689 - padding = mkLiteral ''8px 16px''; 690 - spacing = mkLiteral ''8px''; 691 - border-radius = mkLiteral ''16px''; 692 - }; 693 - "element normal active" = { 694 - text-color = mkLiteral ''@bg3''; 695 - }; 696 - "element alternate active" = { 697 - text-color = mkLiteral ''@bg3''; 698 - }; 699 - "element selected normal, element selected active" = { 700 - text-color = mkLiteral ''@fg4''; 701 - background-color = mkLiteral ''@bg3''; 625 + text-color = mkLiteral ''@fg0''; 626 + margin = mkLiteral ''0px''; 627 + padding = mkLiteral ''0px''; 628 + spacing = mkLiteral ''0px''; 702 629 }; 703 - "element-icon" = { 704 - size = mkLiteral ''1em''; 705 - vertical-align = mkLiteral ''0.5''; 706 - }; 707 - "element-text" = { 708 - text-color = mkLiteral ''inherit''; 709 - }; 630 + "window" = { 631 + location = mkLiteral ''north''; 632 + y-offset = mkLiteral ''calc(50% - 176px)''; 633 + width = mkLiteral ''600''; 634 + border-radius = mkLiteral ''24px''; 635 + background-color = mkLiteral ''@bg0''; 710 636 }; 637 + "mainbox" = { 638 + padding = mkLiteral ''12px''; 639 + }; 640 + "inputbar" = { 641 + background-color = mkLiteral ''@bg1''; 642 + border-color = mkLiteral ''@bg3''; 643 + border = mkLiteral ''2px''; 644 + border-radius = mkLiteral ''16px''; 645 + padding = mkLiteral ''8px 16px''; 646 + spacing = mkLiteral ''8px''; 647 + children = mkLiteral ''[ prompt, entry ]''; 648 + }; 649 + "prompt" = { 650 + text-color = mkLiteral ''@fg2''; 651 + }; 652 + "entry" = { 653 + placeholder = mkLiteral ''"Search"''; 654 + placeholder-color = mkLiteral ''@fg3''; 655 + }; 656 + "message" = { 657 + margin = mkLiteral ''12px 0 0''; 658 + border-radius = mkLiteral ''16px''; 659 + border-color = mkLiteral ''@bg2''; 660 + background-color = mkLiteral ''@bg2''; 661 + }; 662 + "textbox" = { 663 + padding = mkLiteral ''8px 24px''; 664 + }; 665 + "listview" = { 666 + background-color = mkLiteral ''transparent''; 667 + margin = mkLiteral ''12px 0 0''; 668 + lines = mkLiteral ''8''; 669 + columns = mkLiteral ''2''; 670 + fixed-height = mkLiteral ''false''; 671 + }; 672 + "element" = { 673 + padding = mkLiteral ''8px 16px''; 674 + spacing = mkLiteral ''8px''; 675 + border-radius = mkLiteral ''16px''; 676 + }; 677 + "element normal active" = { 678 + text-color = mkLiteral ''@bg3''; 679 + }; 680 + "element alternate active" = { 681 + text-color = mkLiteral ''@bg3''; 682 + }; 683 + "element selected normal, element selected active" = { 684 + text-color = mkLiteral ''@fg4''; 685 + background-color = mkLiteral ''@bg3''; 686 + }; 687 + "element-icon" = { 688 + size = mkLiteral ''1em''; 689 + vertical-align = mkLiteral ''0.5''; 690 + }; 691 + "element-text" = { 692 + text-color = mkLiteral ''inherit''; 693 + }; 694 + }; 711 695 location = "center"; 712 696 }; 713 697 nushell.extraConfig = ''
+12 -14
homeModules/keepassxc.nix
··· 1 - { ... }: 2 - { 1 + {...}: { 3 2 config, 4 3 lib, 5 4 pkgs, 6 5 ... 7 - }: 8 - { 6 + }: { 9 7 options.cow.keepassxc = { 10 8 enable = lib.mkEnableOption "KeePassXC + autolaunch"; 11 9 dbPath = lib.mkOption { ··· 16 14 }; 17 15 18 16 config = lib.mkIf config.cow.keepassxc.enable { 19 - cow.imperm.keepCache = [ ".config/keepassxc" ]; 17 + cow.imperm.keepCache = [".config/keepassxc"]; 20 18 21 19 programs.niri.settings.spawn-at-startup = 22 20 lib.optionals (config.cow.gdi.enable && config.cow.keepassxc.dbPath != null) 23 - [ 24 - { 25 - argv = [ 26 - "keepassxc" 27 - config.cow.keepassxc.dbPath 28 - ]; 29 - } 30 - ]; 31 - home.packages = with pkgs; [ keepassxc ]; 21 + [ 22 + { 23 + argv = [ 24 + "keepassxc" 25 + config.cow.keepassxc.dbPath 26 + ]; 27 + } 28 + ]; 29 + home.packages = with pkgs; [keepassxc]; 32 30 }; 33 31 }
+24 -20
homeModules/utils.nix
··· 1 - { ... }: 2 - { 1 + {...}: { 3 2 config, 4 3 lib, 5 4 pkgs, 6 5 ... 7 - }: 8 - { 6 + }: { 9 7 options.cow.utils = { 10 - enable = (lib.mkEnableOption "Handy utilities to have") // { 11 - default = true; 12 - }; 13 - batAliases = (lib.mkEnableOption "Aliases for bat commands in the shell") // { 14 - default = true; 15 - }; 8 + enable = 9 + (lib.mkEnableOption "Handy utilities to have") 10 + // { 11 + default = true; 12 + }; 13 + batAliases = 14 + (lib.mkEnableOption "Aliases for bat commands in the shell") 15 + // { 16 + default = true; 17 + }; 16 18 }; 17 19 18 20 config = lib.mkIf config.cow.utils.enable { 19 - home.packages = 20 - with pkgs; 21 + home.packages = with pkgs; 21 22 [ 22 23 binutils 23 24 usbutils ··· 47 48 ] 48 49 ++ lib.optional config.cow.gdi.enable wev; 49 50 50 - home.shellAliases = lib.mkIf config.cow.utils.batAliases { 51 - cat = "bat"; 52 - man = "batman"; 53 - bg = "batgrep"; 54 - bdiff = "batdiff"; 55 - }; 51 + home.shellAliases = lib.mkIf config.cow.utils.batAliases { 52 + cat = "bat"; 53 + man = "batman"; 54 + bg = "batgrep"; 55 + bdiff = "batdiff"; 56 + }; 56 57 57 58 programs.bat = { 58 59 enable = true; 60 + syntaxes = { 61 + nushell.src = ../res/bat-nushell.sublime-syntax.yaml; 62 + }; 59 63 extraPackages = with pkgs.bat-extras; [ 60 64 batdiff 61 65 batman ··· 69 73 settings = { 70 74 backend = "fastfetch"; 71 75 color_align = { 72 - custom_colors = [ ]; 76 + custom_colors = []; 73 77 fore_back = null; 74 78 mode = "horizontal"; 75 79 }; ··· 79 83 mode = "rgb"; 80 84 preset = "gay-men"; 81 85 pride_month_disable = false; 82 - pride_month_shown = [ ]; 86 + pride_month_shown = []; 83 87 }; 84 88 }; 85 89 };
+4 -4
homeModules/waybar.nix
··· 316 316 tooltip-format = "{:%F at %T in %Z (UTC%Ez)}"; 317 317 }; 318 318 "custom/kde-connect" = { 319 - exec = "${pkgs.nushell}/bin/nu --plugins ${ 320 - inputs.nu_plugin_dbus.packages.${pkgs.system}.default 321 - } ${../res/custom_waybar_modules/kdeconnect.nu}"; 319 + exec = ''${pkgs.nushell}/bin/nu --plugins "[${ 320 + lib.getExe inputs.nu_plugin_dbus.packages.${pkgs.system}.default 321 + }]" ${../res/custom_waybar_modules/kdeconnect.nu}''; 322 322 format = "{}"; 323 323 interval = 30; 324 324 on-click = "kdeconnect-settings"; ··· 389 389 "bluetooth" 390 390 "pulseaudio" 391 391 ] 392 - ++ lib.optional config.cow.kde-connect.enable "custom/kdeconnect" 392 + ++ lib.optional config.cow.kde-connect.enable "custom/kde-connect" 393 393 ++ lib.optional config.cow.gdi.doIdle "idle_inhibitor" 394 394 ++ [ 395 395 "custom/notification"
+5 -9
nixosModules/gdi.nix
··· 1 - { ... }: 2 - { 1 + {...}: { 3 2 config, 4 3 lib, 5 4 pkgs, 6 5 ... 7 - }: 8 - { 6 + }: { 9 7 options.cow.gdi = { 10 8 enable = lib.mkEnableOption "Hyprland with graphical apps, etc."; 11 9 doIdle = lib.mkEnableOption "Idling the system"; ··· 21 19 services.greetd = lib.mkIf config.cow.gdi.showGreet { 22 20 enable = true; 23 21 useTextGreeter = true; 24 - settings.default_session.command = 25 - let 26 - greeting = ''--greeting "Authenticate into ${lib.toUpper config.networking.hostName}"''; 27 - in 28 - "${pkgs.tuigreet}/bin/tuigreet --time ${greeting} --cmd niri-session"; 22 + settings.default_session.command = let 23 + greeting = ''--greeting "Authenticate into ${lib.toUpper config.networking.hostName}"''; 24 + in "${pkgs.tuigreet}/bin/tuigreet --time ${greeting} --cmd niri-session"; 29 25 }; 30 26 }; 31 27 }
+1254
res/bat-nushell.sublime-syntax.yaml
··· 1 + %YAML 1.2 2 + --- 3 + # https://www.sublimetext.com/docs/syntax.html 4 + # https://www.https://www.nushell.sh/book/ 5 + name: nushell 6 + scope: source.nu 7 + version: 2 8 + 9 + file_extensions: 10 + - nu 11 + 12 + first_line_match: |- 13 + (?xi: 14 + ^ \s* \%+ .*? -\*- .*? \bnu\b .*? -\*- # editorconfig 15 + ) 16 + 17 + variables: 18 + # ? 19 + identifier: (?:[A-Za-z]\w*) 20 + filename: (?:[^;,(\s]+) 21 + eol: (?=\s*[%\n]) 22 + 23 + # https://www.nushell.sh/book/command_reference.html#command-reference 24 + nushell_functions: |- 25 + (?x: all | ansi | any | append | ast | bits | bytes | cd | char | chunks | clear | collect | columns | commandline | compact | complete | config | cp | date | debug | decode | default | describe | detect | do | drop | du | each | echo | encode | enumerate | error | every | exec | exit | explain | explore | fill | filter | find | first | flatten | fmt | format | from | generate | get | glob | grid | group-by | hash | headers | help | hide-env | histogram | history | http | ignore | input | insert | inspect | interleave | into | is-admin | is-empty | is-not-empty | is-terminal | items | join | keybindings | kill | last | length | let-env | lines | load-env | ls | math | merge | metadata | mkdir | mktemp | move | mv | nu-check | nu-highlight | open | overlay | panic | par-each | parse | path | plugin | port | prepend | print | ps | query | random | range | reduce | reject | rename | reverse | rm | roll | rotate | run-external | save | schema | scope | select | seq | shuffle | skip | sleep | sort | sort-by | split | split-by | start | stor | str | sys | table | take | tee | term | timeit | to | touch | transpose | tutor | ulimit | uname | uniq | update | upsert | url | values | version | view | watch | which | whoami | window | with-env | wrap | zip) 26 + 27 + custom_functions: |- 28 + (?x: 7z | \? | _atuin_search_cmd | activate | adbtasker | add-preamble | ai | ansi-strip-table | apps-update | askai | askdalle | askpdf | autolister | autouse-file | balena | banner | bar | base2dec | batstat | bhe-update | bitly | cblue | cd-pipe | chat_gpt | chatpdf | check-link | claude_ai | clean-analytics | clone-ubuntu-install | code | column | column2 | const-table | copy-downloads-2-ubbdrive | copy-research-2-ubbdrive | copy-scripts-and-commit | copy-webies-2-ubbdrive | copy-yandex-and-commit | coretemp | countdown | cp-pipe | cpwd | create_left_prompt | create_right_prompt | dall_e | date | debunk-table | dec2base | default-table | dpx | echo-c | echo-g | echo-r | exchange_rates | export-nushell-docs | find-file | find-index | fix-docker | fix-green-dirs | format-mails | fuzzy-dispatcher | fuzzy-select-fs | gcal | generate-dates | get-aliases | get-devices | get-dirs | get-env | get-files | get-github-latest | get-input | get-ips | get-keybindings | get-miss-chapters | get-monitors | get-pass | get-phone-number | get-rows | get-vers | get_weather_by_interval | gg | gg-trans | github-app-update | gmail | gnome-settings | gnu-plot | google_ai | google_search | goto-nuconfigdir | grep-nu | group-list | guake | h | habitica | history | history-stats | http | indexify | install-font | intersect | into | is-column | is-mounted | iselect | isleap | jd | jdown | join-text-files | killn | le | left_prompt | lg | libreoff | list-diff | list-sum | listen-ports | lister | lists2table | ln | lo | ls-ports | lt | m | maps | math | matlab-cli | mcx | med_discord | media | mk-anime | mkcd | monitor | mpv | multiwhere | mv-anime | mv-manga | mv-pipe | mv-torrents | my-pandoc | my-pdflatex | nchat | nerd-fonts-clean | network-switcher | nu-crypt | nu-sloc | nufetch | nushell-syntax-2-sublime | obs | op | open-analytics | open-credential | open-link | openf | openl | openm | patch-font | pdf | pip3-upgrade | pivot-table | plot-table | png-plot | print-file | progress_bar | ps | psn | pwd | pwd-short | qrenc | quick-ubuntu-and-tools-update-module | r9 | ram | rand-select | randi | random | range2list | rclone | re-enamerate | rebrandly | rename-all | rename-date | replicate-tree | reset-alpine-auth | return-error | rm-empty-dirs | rm-pipe | rml | rmount | save-credential | scale-minmax | scale-minmax-table | scompact | send-gmail | set-env | set-screen | setdiff | show-ips | show_banner | speedtest-plot | ssh-sin-pass | ssh-termux | ssh-to | std | stop-net-apps | str | subl | sum-size | supgrade | svg2pdf | sys | t | table-diff | table2record | tasker | tasker-join | to-conversiones | to-onedrive | tokei | token2word | trans | tts | typeof | ubb | ubb_announce | um | umall | union | uniq-by | unset-env | up2ubb | update-nu-config | upload-debs-to-gdrive | usage | ver | verify | weather | wget-all | which-cd | wifi-info | wifi-pass | xls2csv | ydx | yt-api | ytcli | ytm | z | zi) 29 + 30 + plugin_functions: |- 31 + (?x: from | gstat | highlight | hist | inc | plot | polars | port | query | to | xyplot) 32 + 33 + nushell_keywords: |- 34 + (?x: alias | break | const | continue | def | export | export-env | extern | for | hide | if | let | loop | match | module | mut | overlay | plugin | return | source | source-env | try | use | where | while | else | catch) 35 + 36 + nushell_aliases: |- 37 + (?x: R | apagar | append-table | bard | bat | btop | cable-ubb | cal | copy | cputemp | dexit | ds | dsitcl | enter | finished | g | get-mac | get-wg | grp | math mean | math std | max-vol | mcv | mount-ssd4 | mpydf | mute | n | ncdu | netspeed | nu-clean | open-config | p | paste | png | print-list | quantum | reiniciar | s | shells | takephoto | to matlab-matrix | trc | tree | unmute | wsp) 38 + 39 + nushell_personal: |- 40 + (?x: speedtest | myffmpeg | subtitles-renamer) 41 + 42 + nushell_operators: |- 43 + (?x: and | or | mod | in | not-in | not | xor | bit-or | bit-xor | bit-and | bit-shl | bit-shr | starts-with | ends-with) 44 + 45 + boolean_operators: |- 46 + (?x: true | false) 47 + 48 + ################################################################################ 49 + 50 + contexts: 51 + main: 52 + - include: function-declarations 53 + - include: class-declarations 54 + - include: keywords 55 + - include: expressions 56 + 57 + expressions: 58 + - include: comments 59 + - include: line-continuations 60 + - include: parens 61 + - include: brackets 62 + - include: braces 63 + - include: numbers 64 + - include: strings 65 + - include: operators 66 + - include: accessor-dots 67 + - include: terminators 68 + - include: separator-commas 69 + - include: builtin-packages 70 + - include: structures 71 + - include: builtin-constants 72 + - include: builtin-variables 73 + - include: transposed-variables 74 + - include: variable-assignments 75 + - include: builtin-types 76 + - include: builtin-commands 77 + - include: builtin-functions 78 + - include: custom-functions 79 + - include: plugin-functions 80 + - include: nushell-keywords 81 + - include: nushell-aliases 82 + - include: nushell-personal 83 + - include: nushell-operators 84 + - include: boolean-operators 85 + - include: variables 86 + - include: invalid-variables 87 + 88 + eol-pop: 89 + - match: "{{eol}}" 90 + pop: 1 91 + 92 + else-pop: 93 + - match: (?=\S) 94 + pop: 1 95 + 96 + ###[ COMMENTS AND LINE CONTINUATION ]########################################### 97 + 98 + comments: 99 + - include: block-comments 100 + - include: line-comments 101 + 102 + block-comments: 103 + - match: ^\s*(#\{)\s*\n 104 + captures: 105 + 1: punctuation.definition.comment.nu 106 + push: block-comment-content 107 + 108 + block-comment-content: 109 + - meta_scope: comment.block.percentage.nu 110 + - match: ^\s*(#)\s*$\n? 111 + captures: 112 + 1: punctuation.definition.comment.nu 113 + pop: 1 114 + - include: block-comments 115 + 116 + line-comments: 117 + - match: (#+).*\n? 118 + scope: comment.line.percentage.nu 119 + captures: 120 + 1: punctuation.definition.comment.nu 121 + 122 + # line-continuations: 123 + # - match: (\.{3})\s*(\S.*\n?)? 124 + # captures: 125 + # 1: punctuation.separator.continuation.line.nu 126 + # 2: comment.line.nu 127 + 128 + ###[ LANGUAGE FUNDAMENTALS ]#################################################### 129 + 130 + numbers: #? 131 + - match: \b(0[xX])(\h+)(u8|u16|u32|u64|s8|s16|s32|s64)?\b 132 + scope: meta.number.integer.hexadecimal.nu 133 + captures: 134 + 1: constant.numeric.base.nu 135 + 2: constant.numeric.value.nu 136 + 3: constant.numeric.suffix.nu 137 + push: maybe-transpose 138 + - match: \b(0[bB])([01]+)(u8|u16|u32|u64|s8|s16|s32|s64)?\b 139 + scope: meta.number.integer.binary.nu 140 + captures: 141 + 1: constant.numeric.base.nu 142 + 2: constant.numeric.value.nu 143 + 3: constant.numeric.suffix.nu 144 + push: maybe-transpose 145 + - match: ((?:\d+(\.)\d*|(\.)?\d+)(?:[Ee][-+]?\d+)?)(i|j)\b 146 + scope: meta.number.imaginary.decimal.nu 147 + captures: 148 + 1: constant.numeric.value.nu 149 + 2: punctuation.separator.decimal.nu 150 + 3: punctuation.separator.decimal.nu 151 + 4: constant.numeric.suffix.nu 152 + push: maybe-transpose 153 + - match: (?:\d+(\.)\d*|(\.)?\d+)(?:[Ee][-+]?\d+)?(?!\w) 154 + scope: meta.number.float.decimal.nu constant.numeric.value.nu 155 + captures: 156 + 1: punctuation.separator.decimal.nu 157 + 2: punctuation.separator.decimal.nu 158 + push: maybe-transpose 159 + 160 + strings: 161 + - match: \' 162 + scope: punctuation.definition.string.begin.nu 163 + push: single-quoted-string 164 + - match: \" 165 + scope: punctuation.definition.string.begin.nu 166 + push: double-quoted-string 167 + 168 + single-quoted-string: 169 + - meta_include_prototype: false 170 + - meta_scope: meta.string.nu string.quoted.single.nu 171 + - match: \'\' 172 + scope: constant.character.escape.nu 173 + - match: \' 174 + scope: punctuation.definition.string.end.nu 175 + set: maybe-dot-transpose 176 + - match: $\n? 177 + scope: invalid.illegal.unclosed-string.nu 178 + pop: 1 179 + - include: escaped-characters 180 + - include: format-specs 181 + 182 + double-quoted-string: 183 + - meta_include_prototype: false 184 + - meta_scope: meta.string.nu string.quoted.double.nu 185 + - match: \"\" 186 + scope: constant.character.escape.nu 187 + - match: \" 188 + scope: punctuation.definition.string.end.nu 189 + set: maybe-transpose 190 + - match: $\n? 191 + scope: invalid.illegal.unclosed-string.nu 192 + pop: 1 193 + - include: escaped-characters 194 + - include: format-specs 195 + 196 + escaped-characters: 197 + - match: \%\%|\\\\|\\[abfnrtv] 198 + scope: constant.character.escape.nu 199 + 200 + format-specs: 201 + - match: \%(?:\d\$)?[-+\s0#]?(?:\d+|\*)?(?:\.\d+|\.\*)?(?:[cdeEfgGis]|[bt]?[ouxX]) 202 + scope: constant.other.placeholder.nu 203 + 204 + variables: 205 + - match: \b{{identifier}} 206 + scope: variable.other.nu 207 + 208 + transposed-variables: 209 + - match: \b({{identifier}})(?:\s*(\.\')|(\')) 210 + captures: 211 + 1: variable.other.nu 212 + 2: keyword.operator.transpose.nu 213 + 3: keyword.operator.transpose.nu 214 + 215 + variable-assignments: 216 + - match: \b({{identifier}})\s*(=)(?!=) 217 + captures: 218 + 1: variable.other.nu 219 + 2: keyword.operator.assignment.nu 220 + 221 + structures: 222 + - match: \b({{identifier}})(\.)(?={{identifier}}) 223 + captures: 224 + 1: variable.other.nu 225 + 2: punctuation.accessor.dot.nu 226 + push: structure-fields 227 + 228 + structure-fields: 229 + - match: ({{identifier}})(\.)(?={{identifier}}) 230 + captures: 231 + 1: variable.other.member.nu 232 + 2: punctuation.accessor.dot.nu 233 + - match: "{{identifier}}" 234 + scope: variable.other.member.nu 235 + set: maybe-transpose 236 + 237 + ###[ PARENS/BRACKETS/BRACES BLOCKS ]############################################ 238 + 239 + parens: 240 + - match: \( 241 + scope: punctuation.section.parens.begin.nu 242 + push: parens-content 243 + 244 + parens-content: 245 + - meta_scope: meta.parens.nu 246 + - match: \) 247 + scope: punctuation.section.parens.end.nu 248 + set: maybe-fields-or-transpose 249 + - include: last-indices 250 + - include: expressions 251 + 252 + maybe-fields-or-transpose: 253 + - match: (\.)({{identifier}}) 254 + captures: 255 + 1: punctuation.accessor.dot.nu 256 + 2: variable.other.member.nu 257 + - match: \.(?!['*/\\^]) 258 + scope: punctuation.accessor.dot.nu 259 + pop: 1 260 + - include: maybe-transpose 261 + 262 + brackets: 263 + - match: \[ 264 + scope: punctuation.section.brackets.begin.nu 265 + push: brackets-content 266 + 267 + brackets-content: 268 + - meta_scope: meta.brackets.nu 269 + - match: \] 270 + scope: punctuation.section.brackets.end.nu 271 + set: maybe-transpose 272 + - include: separator-semicolons 273 + - include: argument-placeholders 274 + - include: expressions 275 + 276 + braces: 277 + - match: \{ 278 + scope: punctuation.section.braces.begin.nu 279 + push: braces-content 280 + 281 + braces-content: 282 + - meta_scope: meta.braces.nu 283 + - match: \} 284 + scope: punctuation.section.braces.end.nu 285 + set: maybe-fields-or-transpose 286 + - include: separator-semicolons 287 + - include: last-indices 288 + - include: expressions 289 + 290 + ###[ DECLARATION BLOCKS ]####################################################### 291 + 292 + function-declarations: 293 + - match: \bdef\b 294 + scope: keyword.declaration.function.nu 295 + push: function-declaration-header 296 + 297 + function-declaration-header: 298 + - meta_scope: meta.function.nu 299 + - include: line-continuations 300 + - match: "{{eol}}" 301 + set: maybe-function-arguments-block 302 + - match: ({{identifier}})\s*(=) 303 + captures: 304 + 1: variable.parameter.output.nu 305 + 2: keyword.operator.assignment.nu 306 + - match: \[ 307 + scope: punctuation.section.brackets.begin.nu 308 + push: function-output-parameters-list 309 + # - match: = 310 + # scope: keyword.operator.assignment.nu 311 + - match: (?:(?:set|get)(\.))?{{identifier}} 312 + scope: entity.name.function.nu 313 + captures: 314 + 1: punctuation.accessor.dot.nu 315 + - match: \{ 316 + scope: punctuation.section.parens.begin.nu 317 + push: function-input-parameters-list 318 + 319 + function-output-parameters-list: 320 + - include: line-continuations 321 + - include: eol-pop 322 + - include: separator-commas 323 + - match: \] 324 + scope: punctuation.section.brackets.end.nu 325 + pop: 1 326 + - match: "{{identifier}}" 327 + scope: variable.parameter.output.nu 328 + 329 + function-input-parameters-list: 330 + - clear_scopes: 1 331 + - meta_scope: meta.function.parameters.nu 332 + - include: line-continuations 333 + - include: eol-pop 334 + - include: separator-commas 335 + - include: argument-placeholders 336 + - match: \) 337 + scope: punctuation.section.parens.end.nu 338 + pop: 1 339 + - match: "{{identifier}}" 340 + scope: variable.parameter.input.nu 341 + 342 + maybe-function-arguments-block: 343 + - meta_content_scope: meta.function.nu 344 + - include: comments 345 + - match: \barguments\b 346 + scope: keyword.context.arguments.nu 347 + push: function-arguments-block-header 348 + - match: (?=\S) 349 + set: function-body 350 + 351 + function-arguments-block-header: 352 + - meta_scope: meta.arguments.nu 353 + - match: \[ 354 + scope: punctuation.section.parens.begin.nu 355 + push: function-arguments-block-attributes-list 356 + - match: "{{eol}}" 357 + set: function-arguments-block-content 358 + 359 + function-arguments-block-attributes-list: 360 + - meta_scope: meta.attributes.nu 361 + - include: eol-pop 362 + - match: \] 363 + scope: punctuation.section.parens.end.nu 364 + pop: 1 365 + - match: \bRepeating\b 366 + scope: variable.parameter.attribute.nu 367 + 368 + function-arguments-block-content: 369 + - meta_scope: meta.arguments.nu 370 + - match: \bend\b 371 + scope: keyword.context.arguments.end.nu 372 + pop: 1 373 + - match: \b\.\? 374 + scope: keyword.operator.properties.nu 375 + - include: argument-placeholders 376 + - include: builtin-types 377 + - include: expressions 378 + 379 + function-body: 380 + - meta_scope: meta.function.nu 381 + - match: \bend\b 382 + scope: keyword.declaration.function.end.nu 383 + pop: 1 384 + - include: function-declarations 385 + - include: keywords 386 + - include: expressions 387 + 388 + ###[ KEYWORDS AND FLOW CONTROL BLOCKS ]######################################### 389 + 390 + # https://www.mathworks.com/help/matlab/ref/iskeyword.html 391 + # https://www.mathworks.com/help/matlab/control-flow.html 392 + keywords: 393 + - include: if-blocks 394 + - include: switch-blocks 395 + - include: for-blocks 396 + - include: parfor-blocks 397 + - include: while-blocks 398 + - include: try-blocks 399 + - include: spmd-blocks 400 + # - match: \bbreak\b 401 + # scope: keyword.control.flow.break.nu 402 + # - match: \bcontinue\b 403 + # scope: keyword.control.flow.continue.nu 404 + # - match: \breturn\b 405 + # scope: keyword.control.flow.return.nu 406 + # - match: \bglobal\b 407 + # scope: storage.modifier.global.nu 408 + # - match: \bpersistent\b 409 + # scope: storage.modifier.persistent.nu 410 + 411 + if-blocks: 412 + - match: \bif\b 413 + scope: keyword.control.conditional.if.nu 414 + push: if-block-content 415 + 416 + if-block-content: 417 + - meta_scope: meta.block.if.nu 418 + - match: \belseif\b 419 + scope: keyword.control.conditional.elseif.nu 420 + - match: \belse\b 421 + scope: keyword.control.conditional.else.nu 422 + - match: \bend\b 423 + scope: keyword.control.conditional.end.nu 424 + pop: 1 425 + - include: keywords 426 + - include: expressions 427 + 428 + # switch-blocks: 429 + # - match: \bswitch\b 430 + # scope: keyword.control.conditional.switch.nu 431 + # push: switch-block-content 432 + 433 + # switch-block-content: 434 + # - meta_scope: meta.block.switch.nu 435 + # - match: \bcase\b 436 + # scope: keyword.control.conditional.case.nu 437 + # - match: \botherwise\b 438 + # scope: keyword.control.conditional.otherwise.nu 439 + # - match: \bend\b 440 + # scope: keyword.control.conditional.end.nu 441 + # pop: 1 442 + # - include: keywords 443 + # - include: expressions 444 + 445 + for-blocks: 446 + - match: \bfor\b 447 + scope: keyword.control.loop.for.nu 448 + push: for-block-content 449 + 450 + for-block-content: 451 + - meta_scope: meta.block.for.nu 452 + - match: \bend\b 453 + scope: keyword.control.loop.end.nu 454 + pop: 1 455 + - include: keywords 456 + - include: expressions 457 + 458 + # parfor-blocks: 459 + # - match: \bparfor\b 460 + # scope: keyword.control.loop.parfor.nu 461 + # push: parfor-block-content 462 + 463 + # parfor-block-content: 464 + # - meta_scope: meta.block.parfor.nu 465 + # - match: \bend\b 466 + # scope: keyword.control.loop.end.nu 467 + # pop: 1 468 + # - include: keywords 469 + # - include: expressions 470 + 471 + # while-blocks: 472 + # - match: \bwhile\b 473 + # scope: keyword.control.loop.while.nu 474 + # push: while-block-content 475 + 476 + # while-block-content: 477 + # - meta_scope: meta.block.while.nu 478 + # - match: \bend\b 479 + # scope: keyword.control.loop.end.nu 480 + # pop: 1 481 + # - include: keywords 482 + # - include: expressions 483 + 484 + # try-blocks: 485 + # - match: \btry\b 486 + # scope: keyword.control.exception.try.nu 487 + # push: try-block-content 488 + 489 + # try-block-content: 490 + # - meta_scope: meta.block.try.nu 491 + # - match: \bcatch\b 492 + # scope: keyword.control.exception.catch.nu 493 + # - match: \bend\b 494 + # scope: keyword.control.exception.end.nu 495 + # pop: 1 496 + # - include: keywords 497 + # - include: expressions 498 + 499 + # spmd-blocks: 500 + # - match: \bspmd\b 501 + # scope: keyword.context.spmd.nu 502 + # push: spmd-block-content 503 + 504 + # spmd-block-content: 505 + # - meta_scope: meta.block.spmd.nu 506 + # - match: \bend\b 507 + # scope: keyword.context.spmd.end.nu 508 + # pop: 1 509 + # - include: keywords 510 + # - include: expressions 511 + 512 + ###[ OPERATORS AND PUNCTUATION ]################################################ 513 + 514 + # https://www.mathworks.com/help/matlab/matlab_prog/matlab-operators-and-special-characters.html 515 + operators: 516 + - match: '\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^' 517 + scope: keyword.operator.arithmetic.nu 518 + - match: "==|~=|>=|>|<=|<" 519 + scope: keyword.operator.comparison.nu 520 + - match: '~|&&|&|\|\||\|' 521 + scope: keyword.operator.logical.nu 522 + - match: ":" 523 + scope: keyword.operator.colon.nu 524 + - match: "=" 525 + scope: keyword.operator.assignment.nu 526 + - match: \?(?=[A-Za-z]) 527 + scope: keyword.operator.metaclass.nu 528 + - match: \! 529 + scope: keyword.operator.shell-escape.nu 530 + push: shell-escape-content 531 + - match: \b\@ 532 + scope: punctuation.accessor.at.nu 533 + - match: \@ 534 + scope: keyword.operator.at.nu 535 + push: function-handle 536 + 537 + shell-escape-content: 538 + - meta_content_scope: meta.string.nu string.unquoted.nu 539 + - match: \n 540 + pop: 1 541 + 542 + function-handle: 543 + - match: \( 544 + scope: punctuation.section.parens.begin.nu 545 + set: anonymous-function-parameters-list 546 + - match: "" 547 + pop: 1 548 + 549 + anonymous-function-parameters-list: 550 + - meta_scope: meta.function.parameters.nu 551 + - include: line-continuations 552 + - include: eol-pop 553 + - match: "{{identifier}}" 554 + scope: variable.parameter.input.nu 555 + - include: separator-commas 556 + - match: \) 557 + scope: punctuation.section.parens.end.nu 558 + pop: 1 559 + 560 + maybe-transpose: 561 + - match: (?:\s*(\.\')|(\'))? 562 + captures: 563 + 1: keyword.operator.transpose.nu 564 + 2: keyword.operator.transpose.nu 565 + pop: 1 566 + 567 + maybe-dot-transpose: 568 + - match: (?:\s*(\.\'))? 569 + captures: 570 + 1: keyword.operator.transpose.nu 571 + pop: 1 572 + 573 + accessor-dots: 574 + - match: \b\. 575 + scope: punctuation.accessor.dot.nu 576 + 577 + terminators: 578 + - match: \; 579 + scope: punctuation.terminator.nu 580 + 581 + separator-commas: 582 + - match: \, 583 + scope: punctuation.separator.sequence.nu 584 + 585 + separator-semicolons: 586 + - match: \; 587 + scope: punctuation.separator.sequence.nu 588 + 589 + ###[ BUILTIN CONSTANTS, VARIABLES AND DATA TYPES ]############################## 590 + 591 + # Functions that return essential constants, usually used without parameters 592 + # builtin-constants: 593 + # - match: \b(true|false|eps|pi|Inf|NaN|NaT|flintmax|intmax|intmin|realmax|realmin|namelengthmax)\b 594 + # scope: constant.language.nu 595 + # push: maybe-transpose 596 + 597 + # builtin-variables: 598 + # - match: \b(ans|nargin|nargout|varargin|varargout)\b 599 + # scope: variable.language.nu 600 + # push: maybe-transpose 601 + 602 + # builtin-types: 603 + # - match: \b(?:categorical|cell|char|complex|double|int8|int16|int32|int64|logical|single|string|struct|table|timeseries|timetable|uint8|uint16|uint32|uint64)\b(?!\() 604 + # scope: storage.type.nu 605 + 606 + # last-indices: 607 + # - match: \bend\b 608 + # scope: variable.language.nu 609 + # push: maybe-transpose 610 + 611 + # argument-placeholders: 612 + # - match: \~(?![A-Za-z]) 613 + # scope: variable.language.anonymous.nu 614 + 615 + ###[ BUILTIN COMMANDS AND FUNCTIONS ]########################################### 616 + 617 + # Functions with predefined parameters, mostly used in command syntax form 618 + # builtin-commands: 619 + # # https://www.mathworks.com/help/matlab/ref/axis.html 620 + # - match: \baxis\b 621 + # scope: meta.function-call.nu support.function.builtin.nu 622 + # push: maybe-axis-parameter 623 + # # https://www.mathworks.com/help/matlab/ref/beep.html 624 + # - match: \bbeep\b 625 + # scope: meta.function-call.nu support.function.builtin.nu 626 + # push: maybe-on-off-parameter 627 + # # https://www.mathworks.com/help/matlab/ref/box.html 628 + # - match: \bbox\b 629 + # scope: meta.function-call.nu support.function.builtin.nu 630 + # push: maybe-on-off-parameter 631 + # # https://www.mathworks.com/help/matlab/ref/matlab.graphics.interaction.internal.brush.html 632 + # - match: \bbrush\b 633 + # scope: meta.function-call.nu support.function.builtin.nu 634 + # push: maybe-on-off-parameter 635 + # # https://www.mathworks.com/help/matlab/ref/cla.html 636 + # - match: \bcla\b 637 + # scope: meta.function-call.nu support.function.builtin.nu 638 + # push: maybe-cla-parameter 639 + # # https://www.mathworks.com/help/matlab/ref/clear.html 640 + # - match: \bclear\b 641 + # scope: meta.function-call.nu support.function.builtin.nu 642 + # push: maybe-clear-parameter 643 + # # https://www.mathworks.com/help/matlab/ref/close.html 644 + # - match: \bclose\b 645 + # scope: meta.function-call.nu support.function.builtin.nu 646 + # push: maybe-close-parameter 647 + # # https://www.mathworks.com/help/matlab/ref/diary.html 648 + # - match: \bdiary\b 649 + # scope: meta.function-call.nu support.function.builtin.nu 650 + # push: maybe-on-off-parameter 651 + # # https://www.mathworks.com/help/matlab/ref/drawnow.html 652 + # - match: \bdrawnow\b 653 + # scope: meta.function-call.nu support.function.builtin.nu 654 + # push: maybe-drawnow-parameter 655 + # # https://www.mathworks.com/help/matlab/ref/echo.html 656 + # - match: \becho\b 657 + # scope: meta.function-call.nu support.function.builtin.nu 658 + # push: maybe-echo-parameter 659 + # # https://www.mathworks.com/help/matlab/ref/exist.html 660 + # - match: \bexist\b 661 + # scope: meta.function-call.nu support.function.builtin.nu 662 + # push: maybe-exist-parameter 663 + # # https://www.mathworks.com/help/matlab/ref/exit.html 664 + # # https://www.mathworks.com/help/matlab/ref/quit.html 665 + # - match: \b(?:exit|quit)\b 666 + # scope: meta.function-call.nu support.function.builtin.nu 667 + # push: maybe-exit-parameter 668 + # # https://www.mathworks.com/help/matlab/ref/format.html 669 + # - match: \bformat\b 670 + # scope: meta.function-call.nu support.function.builtin.nu 671 + # push: maybe-format-parameter 672 + # # https://www.mathworks.com/help/matlab/ref/grid.html 673 + # - match: \bgrid\b 674 + # scope: meta.function-call.nu support.function.builtin.nu 675 + # push: maybe-grid-parameter 676 + # # https://www.mathworks.com/help/matlab/ref/hidden.html 677 + # - match: \bhidden\b 678 + # scope: meta.function-call.nu support.function.builtin.nu 679 + # push: maybe-on-off-parameter 680 + # # https://www.mathworks.com/help/matlab/ref/hold.html 681 + # - match: \bhold\b 682 + # scope: meta.function-call.nu support.function.builtin.nu 683 + # push: maybe-hold-parameter 684 + # # https://www.mathworks.com/help/matlab/ref/import.html 685 + # - match: \bimport\b 686 + # scope: meta.function-call.nu support.function.builtin.nu 687 + # push: maybe-import-parameter 688 + # # https://www.mathworks.com/help/matlab/ref/material.html 689 + # - match: \bmaterial\b 690 + # scope: meta.function-call.nu support.function.builtin.nu 691 + # push: maybe-material-parameter 692 + # # https://www.mathworks.com/help/matlab/ref/mkdir.html 693 + # - match: \bmkdir\b 694 + # scope: meta.function-call.nu support.function.builtin.nu 695 + # push: maybe-mkdir-parameter 696 + # # https://www.mathworks.com/help/matlab/ref/more.html 697 + # - match: \bmore\b 698 + # scope: meta.function-call.nu support.function.builtin.nu 699 + # push: maybe-on-off-parameter 700 + # # https://www.mathworks.com/help/matlab/ref/movefile.html 701 + # - match: \bmovefile\b 702 + # scope: meta.function-call.nu support.function.builtin.nu 703 + # push: maybe-movefile-parameter 704 + # # https://www.mathworks.com/help/matlab/ref/opengl.html 705 + # - match: \bopengl\b 706 + # scope: meta.function-call.nu support.function.builtin.nu 707 + # push: maybe-opengl-parameter 708 + # # https://www.mathworks.com/help/matlab/ref/rmdir.html 709 + # - match: \brmdir\b 710 + # scope: meta.function-call.nu support.function.builtin.nu 711 + # push: maybe-rmdir-parameter 712 + # # https://www.mathworks.com/help/matlab/ref/who.html 713 + # # https://www.mathworks.com/help/matlab/ref/whos.html 714 + # - match: \b(?:who|whos)\b 715 + # scope: meta.function-call.nu support.function.builtin.nu 716 + # push: maybe-who-parameter 717 + 718 + # maybe-on-off-parameter: 719 + # - match: (?:on|off)\b 720 + # scope: meta.string.nu support.constant.nu 721 + # pop: 1 722 + # - include: else-pop 723 + # - include: eol-pop 724 + 725 + # maybe-axis-parameter: 726 + # - match: (?:manual|auto|tight|padded|equal|image|square|fill|vis3d|normal|xy|ij|on|off)\b 727 + # scope: meta.string.nu support.constant.nu 728 + # pop: 1 729 + # - include: else-pop 730 + # - include: eol-pop 731 + 732 + # maybe-cla-parameter: 733 + # - match: reset\b 734 + # scope: meta.string.nu support.constant.nu 735 + # pop: 1 736 + # - include: else-pop 737 + # - include: eol-pop 738 + 739 + # maybe-clear-parameter: 740 + # - match: -regexp\b 741 + # scope: meta.string.nu support.constant.nu 742 + # set: regexp-pattern-list 743 + # - match: (?:all|classes|functions|global|import|java|mex|variables)\b 744 + # scope: meta.string.nu support.constant.nu 745 + # pop: 1 746 + # - include: else-pop 747 + # - include: eol-pop 748 + 749 + # regexp-pattern-list: 750 + # - include: eol-pop 751 + # - match: (?=[;,]) 752 + # pop: 1 753 + # - match: '[^;,\s]+' 754 + # scope: meta.string.nu string.regexp.nu 755 + 756 + # maybe-close-parameter: 757 + # - match: all\b 758 + # scope: meta.string.nu support.constant.nu 759 + # set: maybe-close-parameter-2 760 + # - include: else-pop 761 + # - include: eol-pop 762 + 763 + # maybe-close-parameter-2: 764 + # - match: (?:hidden|force)\b 765 + # scope: meta.string.nu support.constant.nu 766 + # pop: 1 767 + # - include: else-pop 768 + # - include: eol-pop 769 + 770 + # maybe-drawnow-parameter: 771 + # - match: (?:limitrate|nocallbacks|update|expose)\b 772 + # scope: meta.string.nu support.constant.nu 773 + # pop: 1 774 + # - include: else-pop 775 + # - include: eol-pop 776 + 777 + # maybe-echo-parameter: 778 + # - match: (?:on|off)\b 779 + # scope: meta.string.nu support.constant.nu 780 + # set: maybe-echo-parameter-2 781 + # - match: '{{filename}}' 782 + # scope: meta.string.nu string.unquoted.nu 783 + # set: maybe-on-off-parameter 784 + # - include: else-pop 785 + # - include: eol-pop 786 + 787 + # maybe-echo-parameter-2: 788 + # - match: all\b 789 + # scope: meta.string.nu support.constant.nu 790 + # pop: 1 791 + # - include: else-pop 792 + # - include: eol-pop 793 + 794 + # maybe-exist-parameter: 795 + # - match: '{{filename}}' 796 + # scope: meta.string.nu string.unquoted.nu 797 + # set: maybe-exist-parameter-2 798 + # - include: else-pop 799 + # - include: eol-pop 800 + 801 + # maybe-exist-parameter-2: 802 + # - match: (?:builtin|class|dir|file|var)\b 803 + # scope: meta.string.nu support.constant.nu 804 + # pop: 1 805 + # - include: else-pop 806 + # - include: eol-pop 807 + 808 + # maybe-exit-parameter: 809 + # - match: (?:cancel|force)\b 810 + # scope: meta.string.nu support.constant.nu 811 + # pop: 1 812 + # - include: else-pop 813 + # - include: eol-pop 814 + 815 + # maybe-format-parameter: 816 + # - match: (?:short|long|shortE|longE|shortG|longG|shortEng|longEng|bank|hex|rational|compact|loose)\b 817 + # scope: meta.string.nu support.constant.nu 818 + # pop: 1 819 + # - include: else-pop 820 + # - include: eol-pop 821 + 822 + # maybe-grid-parameter: 823 + # - match: (?:on|off|minor)\b 824 + # scope: meta.string.nu support.constant.nu 825 + # pop: 1 826 + # - include: else-pop 827 + # - include: eol-pop 828 + 829 + # maybe-hold-parameter: 830 + # - match: (?:on|off|all)\b 831 + # scope: meta.string.nu support.constant.nu 832 + # pop: 1 833 + # - include: else-pop 834 + # - include: eol-pop 835 + 836 + # maybe-import-parameter: 837 + # - match: (?:\w+\.)*(?:\w+|\*) 838 + # scope: meta.string.nu string.unquoted.nu 839 + # pop: 1 840 + # - include: else-pop 841 + # - include: eol-pop 842 + 843 + # maybe-material-parameter: 844 + # - match: (?:shiny|dull|metal|default)\b 845 + # scope: meta.string.nu support.constant.nu 846 + # pop: 1 847 + # - include: else-pop 848 + # - include: eol-pop 849 + 850 + # maybe-mkdir-parameter: 851 + # - match: '{{filename}}' 852 + # scope: meta.string.nu string.unquoted.nu 853 + # set: maybe-mkdir-parameter-2 854 + # - include: else-pop 855 + # - include: eol-pop 856 + 857 + # maybe-mkdir-parameter-2: 858 + # - match: '{{filename}}' 859 + # scope: meta.string.nu string.unquoted.nu 860 + # pop: 1 861 + # - include: else-pop 862 + # - include: eol-pop 863 + 864 + # maybe-movefile-parameter: 865 + # - match: '{{filename}}' 866 + # scope: meta.string.nu string.unquoted.nu 867 + # set: maybe-movefile-parameter-2 868 + # - include: else-pop 869 + # - include: eol-pop 870 + 871 + # maybe-movefile-parameter-2: 872 + # - match: '{{filename}}' 873 + # scope: meta.string.nu string.unquoted.nu 874 + # set: maybe-movefile-parameter-3 875 + # - include: else-pop 876 + # - include: eol-pop 877 + 878 + # maybe-movefile-parameter-3: 879 + # - match: f\b 880 + # scope: meta.string.nu support.constant.nu 881 + # pop: 1 882 + # - include: else-pop 883 + # - include: eol-pop 884 + 885 + # maybe-opengl-parameter: 886 + # - match: (?:info|software|hardware|hardwarebasic)\b 887 + # scope: meta.string.nu support.constant.nu 888 + # pop: 1 889 + # - include: else-pop 890 + # - include: eol-pop 891 + 892 + # maybe-rmdir-parameter: 893 + # - match: '{{filename}}' 894 + # scope: meta.string.nu string.unquoted.nu 895 + # set: maybe-rmdir-parameter-2 896 + # - include: else-pop 897 + # - include: eol-pop 898 + 899 + # maybe-rmdir-parameter-2: 900 + # - match: s\b 901 + # scope: meta.string.nu support.constant.nu 902 + # pop: 1 903 + # - include: else-pop 904 + # - include: eol-pop 905 + 906 + # maybe-who-parameter: 907 + # - match: global\b 908 + # scope: meta.string.nu support.constant.nu 909 + # pop: 1 910 + # - include: else-pop 911 + # - include: eol-pop 912 + 913 + # Parentheses are usually omitted when functions are used without parameters. 914 + # This command syntax is also possible for functions if all parameters are character arrays. 915 + # Only the function names are matched here to allow both command syntax and function syntax form. 916 + # https://www.mathworks.com/help/matlab/matlab_prog/command-vs-function-syntax.html 917 + builtin-functions: 918 + - match: \b{{nushell_functions}}\b 919 + scope: meta.function-call.nu support.function.builtin.nu 920 + 921 + custom-functions: 922 + - match: \b{{custom_functions}}\b 923 + scope: support.function.custom.nu 924 + 925 + plugin-functions: 926 + - match: \b{{plugin_functions}}\b 927 + scope: support.function.plugin.nu 928 + 929 + nushell-keywords: 930 + - match: \b{{nushell_keywords}}\b 931 + scope: support.function.keywords.nu 932 + 933 + nushell-aliases: 934 + - match: \b{{nushell_aliases}}\b 935 + scope: support.function.aliases.nu 936 + 937 + nushell-personal: 938 + - match: \b{{nushell_personal}}\b 939 + scope: support.function.personal.nu 940 + 941 + nushell-operators: 942 + - match: \b{{nushell_operators}}\b 943 + scope: support.function.operators.nu 944 + 945 + boolean-operators: 946 + - match: \b{{boolean_operators}}\b 947 + scope: support.function.boolean.nu 948 + 949 + ###[ BUILTIN PACKAGES AND OBJECT FUNCTIONS ]#################################### 950 + 951 + # builtin-packages: 952 + # - match: \bcdflib\b 953 + # scope: support.module.builtin.nu 954 + # push: 955 + # - maybe-cdflib-object-function 956 + # - maybe-accessor-dot 957 + # - match: \bclibgen\b 958 + # scope: support.module.builtin.nu 959 + # push: 960 + # - maybe-clibgen-object-function 961 + # - maybe-accessor-dot 962 + # - match: \bH5\b 963 + # scope: support.module.builtin.nu 964 + # push: 965 + # - maybe-h5-object-function 966 + # - maybe-accessor-dot 967 + # - match: \bH5A\b 968 + # scope: support.module.builtin.nu 969 + # push: 970 + # - maybe-h5a-object-function 971 + # - maybe-accessor-dot 972 + # - match: \bH5DS\b 973 + # scope: support.module.builtin.nu 974 + # push: 975 + # - maybe-h5ds-object-function 976 + # - maybe-accessor-dot 977 + # - match: \bH5E\b 978 + # scope: support.module.builtin.nu 979 + # push: 980 + # - maybe-h5e-object-function 981 + # - maybe-accessor-dot 982 + # - match: \bH5F\b 983 + # scope: support.module.builtin.nu 984 + # push: 985 + # - maybe-h5f-object-function 986 + # - maybe-accessor-dot 987 + # - match: \bH5G\b 988 + # scope: support.module.builtin.nu 989 + # push: 990 + # - maybe-h5g-object-function 991 + # - maybe-accessor-dot 992 + # - match: \bH5I\b 993 + # scope: support.module.builtin.nu 994 + # push: 995 + # - maybe-h5i-object-function 996 + # - maybe-accessor-dot 997 + # - match: \bH5L\b 998 + # scope: support.module.builtin.nu 999 + # push: 1000 + # - maybe-h5l-object-function 1001 + # - maybe-accessor-dot 1002 + # - match: \bH5ML\b 1003 + # scope: support.module.builtin.nu 1004 + # push: 1005 + # - maybe-h5ml-object-function 1006 + # - maybe-accessor-dot 1007 + # - match: \bH5O\b 1008 + # scope: support.module.builtin.nu 1009 + # push: 1010 + # - maybe-h5o-object-function 1011 + # - maybe-accessor-dot 1012 + # - match: \bH5P\b 1013 + # scope: support.module.builtin.nu 1014 + # push: 1015 + # - maybe-h5p-object-function 1016 + # - maybe-accessor-dot 1017 + # - match: \bH5R\b 1018 + # scope: support.module.builtin.nu 1019 + # push: 1020 + # - maybe-h5r-object-function 1021 + # - maybe-accessor-dot 1022 + # - match: \bH5S\b 1023 + # scope: support.module.builtin.nu 1024 + # push: 1025 + # - maybe-h5s-object-function 1026 + # - maybe-accessor-dot 1027 + # - match: \bH5T\b 1028 + # scope: support.module.builtin.nu 1029 + # push: 1030 + # - maybe-h5t-object-function 1031 + # - maybe-accessor-dot 1032 + # - match: \bH5Z\b 1033 + # scope: support.module.builtin.nu 1034 + # push: 1035 + # - maybe-h5z-object-function 1036 + # - maybe-accessor-dot 1037 + # - match: \bMException\b 1038 + # scope: support.module.builtin.nu 1039 + # push: 1040 + # - maybe-mexception-object-function 1041 + # - maybe-accessor-dot 1042 + # - match: \bNET\b 1043 + # scope: support.module.builtin.nu 1044 + # push: 1045 + # - maybe-net-object-function 1046 + # - maybe-accessor-dot 1047 + # - match: \bnetcdf\b 1048 + # scope: support.module.builtin.nu 1049 + # push: 1050 + # - maybe-netcdf-object-function 1051 + # - maybe-accessor-dot 1052 + # - match: \bRandStream\b 1053 + # scope: support.module.builtin.nu 1054 + # push: 1055 + # - maybe-randstream-object-function 1056 + # - maybe-accessor-dot 1057 + # - match: \bTiff\b 1058 + # scope: support.module.builtin.nu 1059 + # push: 1060 + # - maybe-tiff-object-function 1061 + # - maybe-accessor-dot 1062 + 1063 + # maybe-accessor-dot: 1064 + # - match: \.\' 1065 + # scope: keyword.operator.transpose.nu 1066 + # pop: 2 1067 + # - match: \.(?!\*|/|\\|\^) 1068 + # scope: punctuation.accessor.dot.nu 1069 + # pop: 1 1070 + # - match: '' 1071 + # pop: 2 1072 + 1073 + # maybe-cdflib-object-function: 1074 + # - match: '{{cdflib_object_functions}}\b' 1075 + # scope: meta.function-call.nu support.function.nu 1076 + # pop: 1 1077 + # - match: '{{identifier}}?' 1078 + # scope: variable.other.nu 1079 + # pop: 1 1080 + 1081 + # maybe-clibgen-object-function: 1082 + # - match: '{{clibgen_object_functions}}\b' 1083 + # scope: meta.function-call.nu support.function.nu 1084 + # pop: 1 1085 + # - match: '{{identifier}}?' 1086 + # scope: variable.other.nu 1087 + # pop: 1 1088 + 1089 + # maybe-h5-object-function: 1090 + # - match: '{{H5_object_functions}}\b' 1091 + # scope: meta.function-call.nu support.function.nu 1092 + # pop: 1 1093 + # - match: '{{identifier}}?' 1094 + # scope: variable.other.nu 1095 + # pop: 1 1096 + 1097 + # maybe-h5a-object-function: 1098 + # - match: '{{H5A_object_functions}}\b' 1099 + # scope: meta.function-call.nu support.function.nu 1100 + # pop: 1 1101 + # - match: '{{identifier}}?' 1102 + # scope: variable.other.nu 1103 + # pop: 1 1104 + 1105 + # maybe-h5ds-object-function: 1106 + # - match: '{{H5DS_object_functions}}\b' 1107 + # scope: meta.function-call.nu support.function.nu 1108 + # pop: 1 1109 + # - match: '{{identifier}}?' 1110 + # scope: variable.other.nu 1111 + # pop: 1 1112 + 1113 + # maybe-h5e-object-function: 1114 + # - match: '{{H5E_object_functions}}\b' 1115 + # scope: meta.function-call.nu support.function.nu 1116 + # pop: 1 1117 + # - match: '{{identifier}}?' 1118 + # scope: variable.other.nu 1119 + # pop: 1 1120 + 1121 + # maybe-h5f-object-function: 1122 + # - match: '{{H5F_object_functions}}\b' 1123 + # scope: meta.function-call.nu support.function.nu 1124 + # pop: 1 1125 + # - match: '{{identifier}}?' 1126 + # scope: variable.other.nu 1127 + # pop: 1 1128 + 1129 + # maybe-h5g-object-function: 1130 + # - match: '{{H5G_object_functions}}\b' 1131 + # scope: meta.function-call.nu support.function.nu 1132 + # pop: 1 1133 + # - match: '{{identifier}}?' 1134 + # scope: variable.other.nu 1135 + # pop: 1 1136 + 1137 + # maybe-h5i-object-function: 1138 + # - match: '{{H5I_object_functions}}\b' 1139 + # scope: meta.function-call.nu support.function.nu 1140 + # pop: 1 1141 + # - match: '{{identifier}}?' 1142 + # scope: variable.other.nu 1143 + # pop: 1 1144 + 1145 + # maybe-h5l-object-function: 1146 + # - match: '{{H5L_object_functions}}\b' 1147 + # scope: meta.function-call.nu support.function.nu 1148 + # pop: 1 1149 + # - match: '{{identifier}}?' 1150 + # scope: variable.other.nu 1151 + # pop: 1 1152 + 1153 + # maybe-h5ml-object-function: 1154 + # - match: '{{H5ML_object_functions}}\b' 1155 + # scope: meta.function-call.nu support.function.nu 1156 + # pop: 1 1157 + # - match: '{{identifier}}?' 1158 + # scope: variable.other.nu 1159 + # pop: 1 1160 + 1161 + # maybe-h5o-object-function: 1162 + # - match: '{{H5O_object_functions}}\b' 1163 + # scope: meta.function-call.nu support.function.nu 1164 + # pop: 1 1165 + # - match: '{{identifier}}?' 1166 + # scope: variable.other.nu 1167 + # pop: 1 1168 + 1169 + # maybe-h5p-object-function: 1170 + # - match: '{{H5P_object_functions}}\b' 1171 + # scope: meta.function-call.nu support.function.nu 1172 + # pop: 1 1173 + # - match: '{{identifier}}?' 1174 + # scope: variable.other.nu 1175 + # pop: 1 1176 + 1177 + # maybe-h5r-object-function: 1178 + # - match: '{{H5R_object_functions}}\b' 1179 + # scope: meta.function-call.nu support.function.nu 1180 + # pop: 1 1181 + # - match: '{{identifier}}?' 1182 + # scope: variable.other.nu 1183 + # pop: 1 1184 + 1185 + # maybe-h5s-object-function: 1186 + # - match: '{{H5S_object_functions}}\b' 1187 + # scope: meta.function-call.nu support.function.nu 1188 + # pop: 1 1189 + # - match: '{{identifier}}?' 1190 + # scope: variable.other.nu 1191 + # pop: 1 1192 + 1193 + # maybe-h5t-object-function: 1194 + # - match: '{{H5T_object_functions}}\b' 1195 + # scope: meta.function-call.nu support.function.nu 1196 + # pop: 1 1197 + # - match: '{{identifier}}?' 1198 + # scope: variable.other.nu 1199 + # pop: 1 1200 + 1201 + # maybe-h5z-object-function: 1202 + # - match: '{{H5Z_object_functions}}\b' 1203 + # scope: meta.function-call.nu support.function.nu 1204 + # pop: 1 1205 + # - match: '{{identifier}}?' 1206 + # scope: variable.other.nu 1207 + # pop: 1 1208 + 1209 + # maybe-mexception-object-function: 1210 + # - match: last\b 1211 + # scope: meta.function-call.nu support.function.nu 1212 + # pop: 1 1213 + # - match: '{{identifier}}?' 1214 + # scope: variable.other.nu 1215 + # pop: 1 1216 + 1217 + # maybe-net-object-function: 1218 + # - match: '{{NET_object_functions}}\b' 1219 + # scope: meta.function-call.nu support.function.nu 1220 + # pop: 1 1221 + # - match: '{{identifier}}?' 1222 + # scope: variable.other.nu 1223 + # pop: 1 1224 + 1225 + # maybe-netcdf-object-function: 1226 + # - match: '{{netcdf_object_functions}}\b' 1227 + # scope: meta.function-call.nu support.function.nu 1228 + # pop: 1 1229 + # - match: '{{identifier}}?' 1230 + # scope: variable.other.nu 1231 + # pop: 1 1232 + 1233 + # maybe-randstream-object-function: 1234 + # - match: '{{RandStream_object_functions}}\b' 1235 + # scope: meta.function-call.nu support.function.nu 1236 + # pop: 1 1237 + # - match: '{{identifier}}?' 1238 + # scope: variable.other.nu 1239 + # pop: 1 1240 + 1241 + # maybe-tiff-object-function: 1242 + # - match: '{{Tiff_object_functions}}\b' 1243 + # scope: meta.function-call.nu support.function.nu 1244 + # pop: 1 1245 + # - match: '{{identifier}}?' 1246 + # scope: variable.other.nu 1247 + # pop: 1 1248 + 1249 + ###[ INVALID ]################################################################## 1250 + 1251 + invalid-variables: 1252 + # No variables or function names can start with a number or an underscore. 1253 + - match: '\b(_\w|\d+[_a-df-zA-DF-Z])\w*\b' 1254 + scope: invalid.illegal.invalid-variable-name.nu