Compare commits
No commits in common. "dde7db50b0264e7f87536921de70827fb5626c89" and "148509831e9b587c4e45adbd761a394ac5a8caf4" have entirely different histories.
dde7db50b0
...
148509831e
|
@ -55,7 +55,6 @@
|
|||
peek
|
||||
picard
|
||||
pkg-config
|
||||
podman-compose
|
||||
pop-icon-theme
|
||||
prismlauncher
|
||||
protonup-ng
|
||||
|
|
|
@ -89,13 +89,4 @@
|
|||
time = {
|
||||
timeZone = "Europe/Brussels";
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = true;
|
||||
defaultNetwork.settings = {
|
||||
dns_enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { runAndReturnStdout, runCommand } from "./utilities.ts";
|
||||
import { runAndReturnStdout } from "./utilities.ts";
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const { options } = await new Command()
|
||||
|
@ -21,11 +21,11 @@ async function main(): Promise<void> {
|
|||
|
||||
if (options.install) {
|
||||
const extensions = await getSavedExtensions(options.file);
|
||||
await runCommand("codium", {
|
||||
await new Deno.Command("codium", {
|
||||
args: [
|
||||
...extensions.flatMap((id) => ["--install-extension", id]),
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
|
||||
if (options.list) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { runAndReturnStdout, runCommand } from "./utilities.ts";
|
||||
import { runAndReturnStdout } from "./utilities.ts";
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const { options } = await new Command()
|
||||
|
@ -27,15 +27,15 @@ async function main(): Promise<void> {
|
|||
if (options.diff) {
|
||||
for (const file of files) {
|
||||
const filename = file.slice(file.lastIndexOf("/") + 1);
|
||||
await runCommand("delta", {
|
||||
await new Deno.Command("delta", {
|
||||
args: [`/etc/nixos/${filename}`, file],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
await runCommand("sudo", {
|
||||
await new Deno.Command("sudo", {
|
||||
args: [
|
||||
"cp",
|
||||
"--preserve=timestamps",
|
||||
|
@ -43,12 +43,12 @@ async function main(): Promise<void> {
|
|||
...files,
|
||||
"/etc/nixos/",
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
|
||||
if (options.rebuild) {
|
||||
await runCommand("sudo", {
|
||||
await new Deno.Command("sudo", {
|
||||
args: ["nixos-rebuild", options.rebuild],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { runCommand } from "./utilities.ts";
|
||||
|
||||
const imagePath = new URL("../data/wallpaper.jpg", import.meta.url).pathname;
|
||||
|
||||
|
@ -42,15 +41,15 @@ async function main(): Promise<void> {
|
|||
}
|
||||
|
||||
async function downloadImage(url: string): Promise<void> {
|
||||
await runCommand("curl", {
|
||||
await new Deno.Command("curl", {
|
||||
args: ["-fsLS", url, "-o", imagePath],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
|
||||
async function setWallpaper(file: string = imagePath): Promise<void> {
|
||||
const monitors = ["monitorHDMI-0", "monitorHDMI-1"];
|
||||
for (const monitor of monitors) {
|
||||
await runCommand("xfconf-query", {
|
||||
await new Deno.Command("xfconf-query", {
|
||||
args: [
|
||||
"-c",
|
||||
"xfce4-desktop",
|
||||
|
@ -59,7 +58,7 @@ async function setWallpaper(file: string = imagePath): Promise<void> {
|
|||
"-s",
|
||||
file,
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { runCommand, tomlFrontmatter } from "./utilities.ts";
|
||||
import { tomlFrontmatter } from "./utilities.ts";
|
||||
|
||||
type Frontmatter = {
|
||||
page_title: string;
|
||||
|
@ -49,7 +49,7 @@ async function main(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
|
||||
await runCommand("youtube3", {
|
||||
await new Deno.Command("youtube3", {
|
||||
args: [
|
||||
"videos",
|
||||
"update",
|
||||
|
@ -62,7 +62,7 @@ async function main(): Promise<void> {
|
|||
"-r",
|
||||
`snippet.title=${title}`,
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
|
||||
function formatDescription(frontmatter: Frontmatter): string {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { pathExists, runCommand } from "./utilities.ts";
|
||||
import { pathExists } from "./utilities.ts";
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const { args, options } = await new Command()
|
||||
|
@ -30,7 +30,7 @@ async function main(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
await runCommand("gegl", {
|
||||
await new Deno.Command("gegl", {
|
||||
args: [
|
||||
"-o",
|
||||
file,
|
||||
|
@ -42,14 +42,14 @@ async function main(): Promise<void> {
|
|||
width: options.width,
|
||||
}),
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
|
||||
if (!await pathExists(file)) {
|
||||
console.log("Something went wrong with GEGL.");
|
||||
Deno.exit(1);
|
||||
}
|
||||
|
||||
await runCommand("convert", {
|
||||
await new Deno.Command("convert", {
|
||||
args: [
|
||||
file,
|
||||
"-background",
|
||||
|
@ -60,10 +60,10 @@ async function main(): Promise<void> {
|
|||
`${options.width}x${options.height}`,
|
||||
file,
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
|
||||
if (options.clean) {
|
||||
await runCommand("mat2", { args: ["--inplace", file] });
|
||||
await new Deno.Command("mat2", { args: ["--inplace", file] }).output();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { runAndReturnStdout, runCommand } from "./utilities.ts";
|
||||
import { runAndReturnStdout } from "./utilities.ts";
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const { args } = await new Command()
|
||||
|
@ -24,14 +24,14 @@ async function main(): Promise<void> {
|
|||
}
|
||||
|
||||
async function gitPush(remote: string, args: string[]): Promise<void> {
|
||||
await runCommand("git", {
|
||||
await new Deno.Command("git", {
|
||||
args: [
|
||||
"push",
|
||||
"--follow-tags",
|
||||
remote,
|
||||
...args,
|
||||
],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
|
||||
async function gitRemote(): Promise<string[]> {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Command } from "./dependencies.ts";
|
||||
import { pathExists, runCommand } from "./utilities.ts";
|
||||
import { pathExists } from "./utilities.ts";
|
||||
|
||||
const hiddenApi = "http://127.0.0.1:7813";
|
||||
const remoteApi = "http://127.0.0.1:7814/api1";
|
||||
|
@ -96,9 +96,9 @@ async function getStatus(): Promise<Status> {
|
|||
|
||||
async function notifyCurrentSong(): Promise<void> {
|
||||
const status = await getStatus();
|
||||
await runCommand("notify-send", {
|
||||
await new Deno.Command("notify-send", {
|
||||
args: [status.title, status.artist],
|
||||
});
|
||||
}).output();
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
|
|
|
@ -13,16 +13,6 @@ export function stringifyJsonPretty(input: unknown): string {
|
|||
return JSON.stringify(input, null, 2);
|
||||
}
|
||||
|
||||
export async function runCommand(
|
||||
command: string,
|
||||
options: Deno.CommandOptions = {
|
||||
stderr: "inherit",
|
||||
stdout: "inherit",
|
||||
},
|
||||
): Promise<void> {
|
||||
await new Deno.Command(command, options).output();
|
||||
}
|
||||
|
||||
export async function runAndReturnStdout(
|
||||
command: string,
|
||||
options: Deno.CommandOptions = {},
|
||||
|
|
Loading…
Reference in New Issue