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