add bins and alternatives
This commit is contained in:
parent
a935bb9893
commit
9f3594e0d3
21 changed files with 210 additions and 10 deletions
17
data/home/.local/bin/box-drawing-char.sh
Executable file
17
data/home/.local/bin/box-drawing-char.sh
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo 0x6a j ┘
|
||||||
|
echo 0x6b k ┐
|
||||||
|
echo 0x6c l ┌
|
||||||
|
echo 0x6d m └
|
||||||
|
echo 0x6e n ┼
|
||||||
|
echo 0x71 q ─
|
||||||
|
echo 0x74 t ├
|
||||||
|
echo 0x75 u ┤
|
||||||
|
echo 0x76 v ┴
|
||||||
|
echo 0x77 w ┬
|
||||||
|
echo 0x78 x │
|
||||||
|
echo ┌─┬┐
|
||||||
|
echo │ ││
|
||||||
|
echo ├─┼┤
|
||||||
|
echo └─┴┘
|
6
data/home/.local/bin/choose.ts
Executable file
6
data/home/.local/bin/choose.ts
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/env -S deno run
|
||||||
|
|
||||||
|
const args = Deno.args;
|
||||||
|
const { floor, random } = Math;
|
||||||
|
const index = floor(random() * args.length);
|
||||||
|
console.log(args[index]);
|
3
data/home/.local/bin/daemonize-thunar.sh
Executable file
3
data/home/.local/bin/daemonize-thunar.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
thunar --daemon
|
3
data/home/.local/bin/defer.sh
Executable file
3
data/home/.local/bin/defer.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
3
data/home/.local/bin/deno_quiet.sh
Executable file
3
data/home/.local/bin/deno_quiet.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sh -c 'echo "console.clear()"; cat' | deno
|
22
data/home/.local/bin/enable_wol.sh
Executable file
22
data/home/.local/bin/enable_wol.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "done" > "/tmp/done.txt"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
sleep 15s
|
||||||
|
|
||||||
|
function enable_wol_for() {
|
||||||
|
echo "[enable_wol] enabling wol on '$1'"
|
||||||
|
sudo ethtool -s $1 wol g
|
||||||
|
echo "[enable_wol] success"
|
||||||
|
sudo ethtool $1 | grep Wake-on
|
||||||
|
}
|
||||||
|
|
||||||
|
for _ in $(seq 10)
|
||||||
|
do
|
||||||
|
ip link | grep enp | while read line; do
|
||||||
|
name=$(echo "$line" | cut -d ":" -f 2)
|
||||||
|
enable_wol_for "$name"
|
||||||
|
done
|
||||||
|
sleep 10s
|
||||||
|
done
|
3
data/home/.local/bin/fix_cinnamon.sh
Executable file
3
data/home/.local/bin/fix_cinnamon.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
pkill -HUP -f "cinnamon --replace"
|
3
data/home/.local/bin/glava.sh
Executable file
3
data/home/.local/bin/glava.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
glava -d
|
3
data/home/.local/bin/kill-nemo-desktop.sh
Executable file
3
data/home/.local/bin/kill-nemo-desktop.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
killall nemo-desktop
|
30
data/home/.local/bin/mk_vm.sh
Executable file
30
data/home/.local/bin/mk_vm.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
path=$1;
|
||||||
|
DISK_GB=4;
|
||||||
|
CPU_COUNT=8;
|
||||||
|
MEM_MB=2048;
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
name="vm_$(date +%s)"
|
||||||
|
path="/tmp/$name"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[mk_vm.sh] creating '$path'";
|
||||||
|
|
||||||
|
mkdir -p "$path";
|
||||||
|
cd "$path";
|
||||||
|
|
||||||
|
if ! [ -f ./arch.iso ]; then
|
||||||
|
wget "http://archlinux.mirrors.ovh.net/archlinux/iso/latest/archlinux-x86_64.iso" -O "./arch.iso";
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -f ./root.img ]; then
|
||||||
|
qemu-img create root.img "$DISK_GB"G;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ARGS_GRAPHICS="-display egl-headless"
|
||||||
|
# ARGS_GRAPHICS="-nographic"
|
||||||
|
|
||||||
|
ARGS="-drive file=root.img,format=raw -cdrom arch.iso -boot d -smp $CPU_COUNT -m $MEM_MB $ARGS_GRAPHICS"
|
||||||
|
screen -S vm qemu-system-x86_64 $ARGS;
|
5
data/home/.local/bin/poupette.sh
Executable file
5
data/home/.local/bin/poupette.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
wget --quiet "https://poupette.barnulf.net/poupette.webp" -O "/tmp/poupette.webp"
|
||||||
|
convert "/tmp/poupette.webp" -resize 600x-1 "/tmp/poupette.jpg"
|
||||||
|
kitty +kitten icat "/tmp/poupette.jpg"
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
while read line
|
|
||||||
do echo "$@$line"
|
|
||||||
done
|
|
33
data/home/.local/bin/prefix.ts
Executable file
33
data/home/.local/bin/prefix.ts
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/env -S deno run
|
||||||
|
|
||||||
|
import { crayon } from "https://deno.land/x/crayon@3.3.3/mod.ts";
|
||||||
|
|
||||||
|
async function read_line() {
|
||||||
|
const buf = new Uint8Array(1024);
|
||||||
|
const n = await Deno.stdin.read(buf);
|
||||||
|
if (n === null) return null;
|
||||||
|
const line = new TextDecoder().decode(buf.subarray(0, n));
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
function pick<T>(arr: T[]) {
|
||||||
|
const index = Math.floor(arr.length * Math.random());
|
||||||
|
return arr[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
const [prefix] = Deno.args;
|
||||||
|
const colors = [
|
||||||
|
crayon.red,
|
||||||
|
crayon.green,
|
||||||
|
crayon.blue,
|
||||||
|
crayon.yellow,
|
||||||
|
crayon.magenta,
|
||||||
|
];
|
||||||
|
const color = pick(colors);
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
let line = await read_line();
|
||||||
|
if (line == null) break;
|
||||||
|
line = line.substring(0, line.length - 1);
|
||||||
|
console.log(`${color(`[${prefix}]`)} ${line}`);
|
||||||
|
}
|
17
data/home/.local/bin/randomize_filename.ts
Executable file
17
data/home/.local/bin/randomize_filename.ts
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/env -S deno run -A
|
||||||
|
|
||||||
|
import { basename, dirname } from "https://deno.land/std@0.187.0/path/mod.ts";
|
||||||
|
|
||||||
|
const files = Deno.args;
|
||||||
|
|
||||||
|
function rand_int(ceil = 1000) {
|
||||||
|
return Math.floor(Math.random() * ceil);
|
||||||
|
}
|
||||||
|
|
||||||
|
const keyed = files.map((name) => ({ key: rand_int(files.length), name }));
|
||||||
|
keyed.sort(({ key: a }, { key: b }) => (a - b));
|
||||||
|
await Promise.all(keyed.map(({ name }, index) => {
|
||||||
|
const dir = dirname(name);
|
||||||
|
const base = basename(name);
|
||||||
|
return Deno.rename(`${dir}/${base}`, `${dir}/${index}_${base}`);
|
||||||
|
}));
|
7
data/home/.local/bin/reparer_discord.ts
Executable file
7
data/home/.local/bin/reparer_discord.ts
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env -S deno run -A --unstable
|
||||||
|
|
||||||
|
const path = Deno.env.get("HOME") + "/.config/discord/settings.json"
|
||||||
|
|
||||||
|
const config = JSON.parse(Deno.readTextFileSync(path));
|
||||||
|
config["SKIP_HOST_UPDATE"] = true;
|
||||||
|
Deno.writeTextFileSync(path, JSON.stringify(config, null, 4));
|
5
data/home/.local/bin/screenshot.sh
Executable file
5
data/home/.local/bin/screenshot.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
name="screenshot-$(date +%s).png"
|
||||||
|
gnome-screenshot -a -f /tmp/$name
|
||||||
|
xclip -selection clipboard -t image/png -i /tmp/$name
|
37
data/home/.local/bin/sdparams.ts
Executable file
37
data/home/.local/bin/sdparams.ts
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/env -S deno run -A
|
||||||
|
import { crayon } from "https://deno.land/x/crayon@3.3.3/mod.ts";
|
||||||
|
const [filename] = Deno.args;
|
||||||
|
|
||||||
|
const args = [filename];
|
||||||
|
const { stdout } = await new Deno
|
||||||
|
.Command("strings", { args, stdout: "piped" })
|
||||||
|
.output();
|
||||||
|
const strings = new TextDecoder().decode(stdout);
|
||||||
|
|
||||||
|
let passed = false;
|
||||||
|
let rest = strings.split("\n").filter((l) => {
|
||||||
|
if (l === "IDATx") passed = true;
|
||||||
|
return !passed;
|
||||||
|
}).join("\n");
|
||||||
|
|
||||||
|
function split_once(text: string, sep: string) {
|
||||||
|
const [first, ...rest] = text.split(sep);
|
||||||
|
return [first, rest.join(sep)];
|
||||||
|
}
|
||||||
|
|
||||||
|
let _, prompt, negative, settings;
|
||||||
|
[_, rest] = split_once(rest, "parameters\n");
|
||||||
|
[prompt, rest] = split_once(rest, "\nNegative prompt: ");
|
||||||
|
[negative, rest] = split_once(rest, "\nSteps: ");
|
||||||
|
[settings, _] = split_once(rest, "\nIDATx");
|
||||||
|
settings = "Steps: " + settings;
|
||||||
|
|
||||||
|
const pairs = settings.split(", ").map((p) => split_once(p, ": "));
|
||||||
|
|
||||||
|
for (const [key, value] of pairs) {
|
||||||
|
console.log(`${crayon.yellow.bold((key + ":").padEnd(12))} ${value}`);
|
||||||
|
}
|
||||||
|
console.log(`${crayon.yellow.bold("prompt:")}
|
||||||
|
${prompt}
|
||||||
|
${crayon.yellow.bold("negative:")}
|
||||||
|
${negative}`);
|
3
data/home/.local/bin/start-rustdesk.sh
Executable file
3
data/home/.local/bin/start-rustdesk.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rustdesk
|
2
data/home/.local/bin/start_corectrl.sh
Executable file
2
data/home/.local/bin/start_corectrl.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
corectrl --minimize-systray
|
3
data/home/.local/bin/wait_pid.sh
Executable file
3
data/home/.local/bin/wait_pid.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
tail --pid="${1}" -f /dev/null
|
|
@ -83,13 +83,13 @@ alias "...."="../../.."
|
||||||
alias "....."="../../../.."
|
alias "....."="../../../.."
|
||||||
|
|
||||||
# edit default commands
|
# edit default commands
|
||||||
alias ls=lsd
|
[ -f /usr/bin/lsd ] && alias ls=lsd
|
||||||
alias bat="/usr/bin/bat --theme=ansi"
|
alias bat="/usr/bin/bat --theme=ansi"
|
||||||
alias cat="bat --paging=never --style=snip"
|
[ -f /usr/bin/bat ] && alias cat="bat --paging=never --style=snip"
|
||||||
alias cut=tuc
|
[ -f /usr/bin/tuc ] && alias cut=tuc
|
||||||
alias make="/usr/bin/make -j32"
|
alias make="/usr/bin/make -j$(nproc)"
|
||||||
alias mek=make
|
alias mek=make
|
||||||
alias code="codium"
|
[ -f /usr/bin/codium ] && alias code="codium"
|
||||||
alias untar="tar -xvf"
|
alias untar="tar -xvf"
|
||||||
alias paru="unset CARGO_TARGET_DIR; paru"
|
alias paru="unset CARGO_TARGET_DIR; paru"
|
||||||
alias pandoc="pandoc --pdf-engine=tectonic"
|
alias pandoc="pandoc --pdf-engine=tectonic"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue