1
Fork 0

Compare commits

..

2 Commits

Author SHA1 Message Date
Bauke 61445591e4
Consolidate dependencies into its own file. 2023-02-26 12:34:26 +01:00
Bauke 16c37b028e
Add HandBrake preset and adjust aliases. 2023-02-26 12:21:34 +01:00
13 changed files with 140 additions and 24 deletions

View File

@ -2,7 +2,8 @@
alias c.="codium ."
alias cat="bat"
alias dust="dust -bs"
alias handbrake="HandBrakeCLI"
alias handbrake="HandBrakeCLI --preset-import-file $BAUKE_DIR/data/handbrake-presets.json"
alias handbrake720p30fps="handbrake -Z '720p 30FPS'"
alias icat="kitty +kitten icat"
alias ls="exa"
alias mgs="mgitstatus"

View File

@ -0,0 +1,123 @@
{
"PresetList": [
{
"AlignAVStart": true,
"AudioCopyMask": [
"copy:aac"
],
"AudioEncoderFallback": "av_aac",
"AudioLanguageList": [],
"AudioList": [
{
"AudioBitrate": 160,
"AudioCompressionLevel": -1.0,
"AudioDitherMethod": "auto",
"AudioEncoder": "av_aac",
"AudioMixdown": "stereo",
"AudioNormalizeMixLevel": false,
"AudioSamplerate": "auto",
"AudioTrackDRCSlider": 0.0,
"AudioTrackGainSlider": 0.0,
"AudioTrackQuality": -1.0,
"AudioTrackQualityEnable": false
}
],
"AudioSecondaryEncoderMode": true,
"AudioTrackSelectionBehavior": "first",
"ChapterMarkers": true,
"ChildrenArray": [],
"Default": false,
"FileFormat": "av_mp4",
"Folder": false,
"FolderOpen": false,
"InlineParameterSets": false,
"MetadataPassthrough": true,
"Mp4HttpOptimize": false,
"Mp4iPodCompatible": false,
"PictureAllowUpscaling": false,
"PictureAutoCrop": true,
"PictureBottomCrop": 0,
"PictureChromaSmoothCustom": "",
"PictureChromaSmoothPreset": "off",
"PictureChromaSmoothTune": "none",
"PictureColorspaceCustom": "",
"PictureColorspacePreset": "off",
"PictureCombDetectCustom": "",
"PictureCombDetectPreset": "off",
"PictureDARWidth": 0,
"PictureDeblockCustom": "strength=strong:thresh=20:blocksize=8",
"PictureDeblockPreset": "off",
"PictureDeblockTune": "medium",
"PictureDeinterlaceCustom": "",
"PictureDeinterlaceFilter": "off",
"PictureDeinterlacePreset": "default",
"PictureDenoiseCustom": "",
"PictureDenoiseFilter": "off",
"PictureDenoisePreset": "light",
"PictureDenoiseTune": "none",
"PictureDetelecine": "off",
"PictureDetelecineCustom": "",
"PictureForceHeight": 0,
"PictureForceWidth": 0,
"PictureHeight": 720,
"PictureItuPAR": false,
"PictureKeepRatio": true,
"PictureLeftCrop": 0,
"PictureLooseCrop": false,
"PictureModulus": 2,
"PicturePAR": "auto",
"PicturePARHeight": 720,
"PicturePARWidth": 853,
"PicturePadBottom": 0,
"PicturePadColor": "black",
"PicturePadLeft": 0,
"PicturePadMode": "none",
"PicturePadRight": 0,
"PicturePadTop": 0,
"PictureRightCrop": 0,
"PictureRotate": "angle=0:hflip=0",
"PictureSharpenCustom": "",
"PictureSharpenFilter": "off",
"PictureSharpenPreset": "medium",
"PictureSharpenTune": "none",
"PictureTopCrop": 0,
"PictureUseMaximumSize": true,
"PictureWidth": 1280,
"PresetDescription": "Small H.264 video (up to 720p30) and AAC stereo audio, in an MP4 container.",
"PresetDisabled": false,
"PresetName": "720p 30FPS",
"SubtitleAddCC": false,
"SubtitleAddForeignAudioSearch": true,
"SubtitleAddForeignAudioSubtitle": false,
"SubtitleBurnBDSub": true,
"SubtitleBurnBehavior": "foreign",
"SubtitleBurnDVDSub": true,
"SubtitleLanguageList": [],
"SubtitleTrackSelectionBehavior": "none",
"Type": 0,
"UsesPictureFilters": true,
"VideoAvgBitrate": 2000,
"VideoColorMatrixCodeOverride": 0,
"VideoEncoder": "x264",
"VideoFramerate": "30",
"VideoFramerateMode": "pfr",
"VideoGrayScale": false,
"VideoLevel": "3.1",
"VideoOptionExtra": "",
"VideoPreset": "veryfast",
"VideoProfile": "main",
"VideoQSVDecode": false,
"VideoQualitySlider": 23.0,
"VideoQualityType": 2,
"VideoScaler": "swscale",
"VideoTune": "",
"VideoTurboTwoPass": true,
"VideoTwoPass": true,
"x264Option": "",
"x264UseAdvancedOptions": false
}
],
"VersionMajor": 47,
"VersionMicro": 0,
"VersionMinor": 0
}

View File

@ -1,5 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "../dependencies.ts";
import { runCommand } from "./run.ts";
async function main(): Promise<void> {

View File

@ -1,5 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import * as prompt from "https://deno.land/x/cliffy@v0.25.7/prompt/mod.ts";
import { Command, prompt } from "../dependencies.ts";
export const runCommand = new Command()
.name("run")

View File

@ -1,5 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "./dependencies.ts";
import { runAndReturnStdout } from "./utilities.ts";
async function main(): Promise<void> {

View File

@ -1,4 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "./dependencies.ts";
import { runAndReturnStdout } from "./utilities.ts";
async function main(): Promise<void> {

View File

@ -1,4 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "./dependencies.ts";
const imagePath = new URL("../data/wallpaper.jpg", import.meta.url).pathname;

View File

@ -1,6 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import * as prompt from "https://deno.land/x/cliffy@v0.25.7/prompt/mod.ts";
import { Command, prompt } from "./dependencies.ts";
import { stringifyJsonPretty } from "./utilities.ts";
const CaveComplexity = [1, 2, 3] as const;

View File

@ -1,4 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "./dependencies.ts";
import { tomlFrontmatter } from "./utilities.ts";
type Frontmatter = {

View File

@ -1,5 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { existsSync } from "https://deno.land/std@0.167.0/node/fs.ts";
import { Command, nodeFs } from "./dependencies.ts";
async function main(): Promise<void> {
const { args, options } = await new Command()
@ -21,7 +20,7 @@ async function main(): Promise<void> {
const [file, text] = args;
if (existsSync(file)) {
if (nodeFs.existsSync(file)) {
if (options.overwrite) {
await Deno.remove(file);
} else {
@ -45,7 +44,7 @@ async function main(): Promise<void> {
],
}).status();
if (!existsSync(file)) {
if (!nodeFs.existsSync(file)) {
console.log("Something went wrong with GEGL.");
Deno.exit(1);
}

View File

@ -1,5 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "./dependencies.ts";
import { runAndReturnStdout } from "./utilities.ts";
async function main(): Promise<void> {

View File

@ -1,4 +1,4 @@
import { Command } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts";
import { Command } from "./dependencies.ts";
const hiddenApi = "http://127.0.0.1:7813";
const remoteApi = "http://127.0.0.1:7814/api1";

View File

@ -1,5 +1,4 @@
import { parse } from "https://deno.land/std@0.167.0/encoding/toml.ts";
import { TextDecoder } from "https://deno.land/std@0.167.0/node/util.ts";
import { nodeUtil, toml } from "./dependencies.ts";
export function stringifyJsonPretty(input: unknown): string {
return JSON.stringify(input, null, 2);
@ -9,7 +8,7 @@ export async function runAndReturnStdout(
options: Deno.RunOptions,
): Promise<string> {
const process = Deno.run({ stdout: "piped", ...options });
return new TextDecoder().decode(await process.output());
return new nodeUtil.TextDecoder().decode(await process.output());
}
export function tomlFrontmatter<T>(
@ -34,5 +33,5 @@ export function tomlFrontmatter<T>(
end += endMarker.length;
const extra = data.slice(end);
return [parse(frontmatter) as T, extra.trimStart()];
return [toml.parse(frontmatter) as T, extra.trimStart()];
}