switch to nushell

This commit is contained in:
LordMZTE 2024-05-09 15:01:31 +02:00
parent bbabd015e7
commit e50f057de4
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
5 changed files with 7 additions and 7 deletions

View file

@ -1,6 +1,6 @@
[main]
opener = xdg-open;
shell = /usr/bin/fish -c;
shell = <% opt.system "which nu" %> -c;
theme = catppuccin-mocha;
show-hidden = true;
mouse-support = true;

View file

@ -3,7 +3,7 @@ local opts = {}
opts.mzteinit_entries = {
{ key = "z", label = "river", cmd = { cg.opt.system "which mzteriver" } },
{ key = "h", label = "hyprland", cmd = { "Hyprland" } },
{ key = "s", label = "shell", cmd = { "fish" } },
{ key = "s", label = "shell", cmd = { "nu" } },
{ key = "l", label = "logout", cmd = { "!quit" } },
{ key = "p", label = "shutdown", cmd = { "systemctl", "poweroff" }, quit = true },
{ key = "r", label = "reboot", cmd = { "systemctl", "reboot" }, quit = true },

View file

@ -13,7 +13,7 @@ pub fn initOptions() !void {
var buf: [512]u8 = undefined;
// Shell (defaults to mzteinit since that's my login shell)
try opt("fish").setLog("shell", .both);
try opt("nu").setLog("shell", .both);
try cmd("syntax on");

View file

@ -41,12 +41,12 @@ pub fn populateEnvironment(env: *std.process.EnvMap) !bool {
try env.put(kv[0], try std.fmt.bufPrint(&sbuf, "{s}/{s}", .{ home, kv[1] }));
}
// set shell to fish to prevent anything from defaulting to mzteinit
if (try util.findInPath(alloc, "fish")) |fish| {
// set shell to nu to prevent anything from defaulting to mzteinit
if (try util.findInPath(alloc, "nu")) |fish| {
defer alloc.free(fish);
try env.put("SHELL", fish);
} else {
log.warn("fish not found! setting $SHELL to /bin/sh", .{});
log.warn("nu not found! setting $SHELL to /bin/sh", .{});
try env.put("SHELL", "/bin/sh");
}

View file

@ -80,7 +80,7 @@ fn tryMain() !void {
if (env_map.data.get("MZTEINIT")) |_| {
try stdout.writer().writeAll("mzteinit running already, starting shell\n");
try stdout.flush();
var child = std.ChildProcess.init(launch_cmd orelse &.{"fish"}, alloc);
var child = std.ChildProcess.init(launch_cmd orelse &.{"nu"}, alloc);
_ = try child.spawnAndWait();
return;
} else {