nuhsell: prelude to big packages clean up
c98d23a85888433cc0b48e0ad13c7e562fb918d2
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 7e99d70459fa
bugabingas dorkfiles
c98d23a85888433cc0b48e0ad13c7e562fb918d2
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+362 / −909 text lines
+1 / −1 text lines
+17 / −17 text lines
accent = "#e808e8"important_local = "#9b66f0"important_global = "#b086f3"minor = "#686868"focus = "#7d9e9b"unfocus = "#284c4a"ui_normal = "#fefefe"ui_backdrop = "#010101"ui_accent = "#b63ab6"ui_important_global = "#9c6cea"ui_important_local = "#884de6"ui_minor = "#565656"ui_focus = "#738584"ui_unfocus = "#1f3231"error = "#ec1274"warning = "#f89f89"info = "#9c9bf5"accent = "#812281"important_local = "#948fa6"important_global = "#f3f3f5"minor = "#8b8b8b"focus = "#7ba1aa"unfocus = "#406f79"ui_normal = "#dbdbdb"ui_backdrop = "#242424"ui_accent = "#9d299d"ui_important_global = "#ffffff"ui_important_local = "#a7a3b6"ui_minor = "#9d9d9d"ui_focus = "#a4a4a4"ui_unfocus = "#6e6e6e"error = "#ac5a77"warning = "#b4b1ae"info = "#b8b8b8"+18 / −18 text lines
accent = "#750b75"important_local = "#8169c3"important_global = "#553d98"minor = "#787878"focus = "#267b8e"unfocus = "#929292"ui_normal = "#1a1a1a"ui_backdrop = "#ffffff"ui_accent = "#5a265a"ui_important_global = "#897bb1"ui_important_local = "#bab1d1"ui_minor = "#a3a3a3"ui_focus = "#53a5b7"ui_unfocus = "#bdbdbd"error = "#d6638b"warning = "#d9cbbb"info = "#c7d0db"accent = "#491349"important_local = "#4c4365"important_global = "#000000"minor = "#3b3b3b"focus = "#184e5b"unfocus = "#6f6f6f"ui_normal = "#242424"ui_backdrop = "#dbdbdb"ui_accent = "#2d0c2d"ui_important_global = "#000000"ui_important_local = "#3c3550"ui_minor = "#292929"ui_focus = "#212c2e"ui_unfocus = "#5d5d5d"error = "#804056"warning = "#928e8a"info = "#949494"+6 / −2 text lines
local start_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field vim.opt.background = const.os_background local end_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field local time_elapsed = end_time - start_time vim.notify(string.format('Queried OS background in (%d ms).', time_elapsed / 1e6), vim.log.levels.INFO)+1 / −1 text lines
+17 / −17 text lines
+17 / −17 text lines
+2 / −2 text lines
+13 / −13 text lines
pastel ( if $light { "lighten" } else { "darken" } ) $compensator | pastel ( if $light { "darken" } else { "lighten" } ) $compensator |+117 / −0 text lines
def make-code-block-divs [] { ' <pre><code><span class="keyword">package</span> <span class="package">com.orga.my.package</span>;<span class="keyword">import</span> java.util.<span class="type">List</span>;<span class="keyword">import</span> java.util.<span class="type">Map</span>;<span class="keyword">import</span> java.util.<span class="type">Optional</span>;<span class="keyword">import</span> org.springframework.stereotype.<span class="type">Service</span>;<span class="keyword">import</span> jakarta.validation.constraints.<span class="type">NotNull</span>;<span class="comment">// DemoService: A chaotic showcase of every Java keyword and type</span><span class="annotation">@Service</span><span class="keyword">public</span> <span class="keyword">final</span> <span class="keyword">class</span> <span class="class-name">DemoService</span> <span class="keyword">implements</span> <span class="type">DemoInterface</span> { <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="type">String</span> CONSTANT = <span class="string">"CONST"</span>; <span class="keyword">private</span> <span class="keyword">transient</span> <span class="keyword">volatile</span> <span class="type">int</span> counter = 0; <span class="keyword">private</span> <span class="type">Map</span><<span class="type">Long</span>, <span class="type">Double</span>> cache; <span class="comment">// Enum for no reason other than to flex</span> <span class="keyword">public</span> <span class="keyword">enum</span> <span class="class-name">Mode</span> { ON, OFF } <span class="comment">// Record because Java loves new toys</span> <span class="keyword">public</span> <span class="keyword">record</span> <span class="class-name">Data</span>(<span class="type">byte</span> b, <span class="type">short</span> s) {} <span class="keyword">public</span> <span class="keyword">synchronized</span> <span class="type">void</span> demo(<span class="annotation">@NotNull</span> <span class="type">Object</span> obj) <span class="keyword">throws</span> <span class="type">Exception</span> { <span class="keyword">assert</span> obj != <span class="literal">null</span> : <span class="string">"Obj is null, you fool"</span>; <span class="keyword">var</span> value = <span class="keyword">new</span> <span class="type">Data</span>((<span class="type">byte</span>) 1, (<span class="type">short</span>) 2); <span class="keyword">if</span> (obj <span class="keyword">instanceof</span> <span class="type">String</span> str) { <span class="keyword">switch</span> (str) { <span class="keyword">case</span> <span class="string">"test"</span> -> { <span class="keyword">yield</span> <span class="literal">true</span>; } <span class="keyword">default</span> -> { <span class="keyword">yield</span> <span class="literal">false</span>; } } } <span class="keyword">else</span> { <span class="keyword">for</span> (<span class="type">int</span> i = 0; i < 10; i++) { <span class="keyword">continue</span>; } } <span class="keyword">while</span> (counter < 5) { <span class="keyword">try</span> { <span class="keyword">double</span> result = Math.random(); <span class="keyword">if</span> (result > 0.5) <span class="keyword">break</span>; } <span class="keyword">catch</span> (<span class="type">Exception</span> e) { <span class="keyword">throw</span> <span class="keyword">new</span> <span class="type">RuntimeException</span>(<span class="string">"Chaos"</span>, e); } <span class="keyword">finally</span> { counter++; } } <span class="keyword">synchronized</span> (<span class="keyword">this</span>) { cache.put(1L, 42.0); } <span class="keyword">return</span>; } <span class="comment">// Abstract method in an interface for no reason</span> <span class="keyword">interface</span> <span class="class-name">DemoInterface</span> { <span class="keyword">abstract</span> <span class="type">void</span> pointless(); } <span class="comment">// Module stuff because Java wants to be fancy</span> <span class="keyword">module</span> demo.module { <span class="keyword">requires</span> java.base; <span class="keyword">exports</span> com.orga.my.package; <span class="keyword">provides</span> <span class="type">DemoInterface</span> <span class="keyword">with</span> <span class="class-name">DemoService</span>; }} </code></pre> '} let code_block_divs = make-code-block-divs pre { max-width: 800px; margin: 20px auto; padding: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba\(0, 0, 0, 0.5); background: ($palette.content.backdrop); color: ($palette.content.normal); font-family: 'Cousine', 'Consolas', monospace; font-size: 16px; line-height: 1.5; overflow-x: auto; tab-size: 2; } code { display: block; } .code-block { max-width: 800px; margin: 20px auto; padding: 15px; border-radius: 8px; box-shadow: 0 4px 8px rgba\(142, 142, 142, 0.3); border: 1px solid #999999; line-height: 1.5; overflow-x: auto; tab-size: 2; } .keyword { color: ($palette.content.minor); } .string { color: ($palette.content.focus); font-style: italic; } .comment { color: ($palette.content.important_global); font-weight: bold; } .class-name { color: ($palette.content.important_local); } .package { color: ($palette.content.minor); } .type { color: ($palette.content.important_local); } .literal { color: ($palette.content.focus); } .annotation { color: ($palette.content.minor); }+0 / −15 text lines
deleted file mode 100644+0 / −73 text lines
import static java.lang.System.*;
import java.net.*;
import java.net.http.*;
import java.net.http.HttpClient.*;
import java.net.http.HttpResponse.*;
import java.nio.file.*;
import java.util.*;
import java.util.regex.*;
class download {
public static void main(String[] command_line_arguments) {
if (command_line_arguments.length < 1) {
usage();
fail("give me an url to download from!");
}
var client = HttpClient.newBuilder().followRedirects(Redirect.NORMAL).build();
var source_name = command_line_arguments[0];
var source = URI.create(source_name);
var current_working_directory = System.getProperty("user.dir");
Path target;
if (command_line_arguments.length == 2) {
target = Paths.get(current_working_directory, command_line_arguments[1]);
} else {
target = Paths.get(current_working_directory, guess_file_name(source_name));
}
out.printf("Downloading %s into %s.%n", emphasize_local(source.toString()), emphasize_local(target.toString()));
download_ressource(client, source, target);
// TODO: download links in html to other pages
exit();
}
static String guess_file_name(String name) {
return name.replaceAll("\\w+:\\/\\/", "").replaceAll("\\/", "_");
}
static void download_ressource(HttpClient client, URI source, Path target) {
//TODO: handle copmressed ressources
//TODO: show progess
var request = HttpRequest.newBuilder().uri(source).build();
client
.sendAsync(request, BodyHandlers.ofFile(target))
.thenAccept(response -> out.printf("Downloaded %s into %s!%n", emphasize_local(source.toString()), emphasize_global(response.body().toString())))
.join();
}
static void usage() {
out.printf("Downloads a file from an %s.%n", emphasize_local("URL"));
out.printf("%s: java download.java <source url> <destination path>%n", emphasize_global("Usage"));
}
static void exit() {
out.printf("%s!%n", emphasize_local("Done"));
System.exit(0);
}
static String emphasize_global(String message) {
return "\033[4m" + message + "\033[0m";
}
static String emphasize_local(String message) {
return "\033[3m" + message + "\033[0m";
}
static void fail(String message, Object... arguments) {
out.printf(message, arguments);
System.exit(-1);
}
static void fail() {
System.exit(-1);
}
}
deleted file mode 100644+0 / −198 text lines
import static java.lang.System.out;
import java.io.*;
import java.net.*;
import java.net.http.*;
import java.net.http.HttpResponse.*;
import java.nio.file.*;
import java.util.*;
import java.util.concurrent.ConcurrentSkipListSet;
class download_jar {
public static void main(final String[] command_line_arguments) {
help();
var current_working_directory = Paths.get(System.getProperty("user.dir"));
var download_directory = current_working_directory.resolve("downloaded_artifacts");
var maven_repository = "https://repo.maven.apache.org/maven2";
var expected_count_of_arguments = 3;
if (contains(command_line_arguments, "-d")) {
expected_count_of_arguments = expected_count_of_arguments + 2;
try {
var given_download_directory = command_line_arguments[index_of(command_line_arguments, "-d") + 1];
download_directory = current_working_directory.resolve(given_download_directory);
} catch (IndexOutOfBoundsException exception) {
out.println("The -d option requires an argument.");
usage();
fail();
}
}
if (contains(command_line_arguments, "-r")) {
expected_count_of_arguments = expected_count_of_arguments + 2;
try {
var given_maven_repository = command_line_arguments[index_of(command_line_arguments, "-r") + 1];
maven_repository = given_maven_repository;
} catch (IndexOutOfBoundsException exception) {
out.println("The -r option requires an argument.");
usage();
fail();
}
}
if (command_line_arguments.length != expected_count_of_arguments) {
usage();
fail();
}
var maven_coordinates_reversed = new String[3];
for (var index = 2; index >= 0; --index) {
maven_coordinates_reversed[index] = command_line_arguments[expected_count_of_arguments - index - 1];
}
var group_id = maven_coordinates_reversed[2];
var artifact_id = maven_coordinates_reversed[1];
var version = maven_coordinates_reversed[0];
if (Files.exists(download_directory) && Files.isRegularFile(download_directory)) {
fail("The given download directory path %s already points to a file!%n", download_directory.toString());
} else if (!Files.exists(download_directory)) {
out.printf("Creating directory at %s%n.", emphasize_global(download_directory.toString()));
try {
Files.createDirectories(download_directory);
} catch (IOException __) {
fail("Unable to create directory at %s", emphasize_global(download_directory.toString()));
}
}
var expected_artifact_base_url = guess_maven_artifact_url(maven_repository, group_id, artifact_id, version);
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder().uri(URI.create(expected_artifact_base_url)).build();
var target_directory = download_directory;
client.sendAsync(request, BodyHandlers.ofString()).thenApply(HttpResponse::statusCode).thenAccept(status -> {
if (status > 299) {
fail("Could not find maven artifact at %s.%n", expected_artifact_base_url);
} else {
download_ressource(client, target_directory,
build_ressource_url(expected_artifact_base_url, artifact_id, version, ".jar"));
download_ressource(client, target_directory,
build_ressource_url(expected_artifact_base_url, artifact_id, version, "-sources.jar"));
// FIXME BLOCKER! How do we implement the version clash resolution?
// Preferably in a manner that avoids pointless downloads...
var processed_cache = new ConcurrentSkipListSet<String>();
process_pom(client, processed_cache,
build_ressource_url(expected_artifact_base_url, artifact_id, version, ".pom"));
}
}).join();
out.printf("download directory:\t%s%nmaven repository:\t%s%nmaven coordinates:\t%s:%s:%s%n",
emphasize_global(download_directory.toString()), emphasize_global(maven_repository), emphasize_global(group_id),
emphasize_global(artifact_id), emphasize_global(version));
exit();
}
static Collection<String> process_pom(HttpClient client, Set<String> processed, String pom_url) {
if (processed.contains(pom_url))
return Collections.emptyList();
var request = HttpRequest.newBuilder().uri(URI.create(pom_url)).build();
return client.sendAsync(request, BodyHandlers.ofInputStream()).thenApply(input -> {
// TODO add pom to list of processed so that a pom only ever gets read once
processed.add(pom_url);
// TODO traverse path to root of poms and collect managed dependencies
// TODO collect declared dependencies from given pom
return List.<String>of();
}).join();
}
static void download_ressource(HttpClient client, Path target_directory, String ressource_url) {
var request = HttpRequest.newBuilder().uri(URI.create(ressource_url)).build();
var ressource_name = ressource_url.substring(ressource_url.lastIndexOf('/') + 1);
var target_ressource_path = target_directory.resolve(ressource_name);
client.sendAsync(request, BodyHandlers.ofFile(target_ressource_path)).join();
}
static String build_ressource_url(String base, String artifact_id, String version, String suffix) {
var url = new StringBuilder(base);
if (!base.endsWith("/"))
url.append('/');
url.append(artifact_id);
url.append('-');
url.append(version);
url.append(suffix);
return url.toString();
}
static String guess_maven_artifact_url(String base, String group_id, String artifact_id, String version) {
var url = new StringBuilder(base);
if (!base.endsWith("/"))
url.append('/');
url.append(group_id.replaceAll("\\.", "\\/"));
url.append('/');
url.append(artifact_id);
url.append('/');
url.append(version);
url.append('/');
return url.toString();
}
static class Dependency {
String artifactId;
String groupId;
String version;
String scope;
boolean optional;
}
static <T> int index_of(T[] array, T item) {
var length = array.length;
if (length == 0)
return -1;
for (var index = 0; index < length; ++index) {
var element = array[index];
if (Objects.equals(element, item))
return index;
}
return -1;
}
@SafeVarargs
static <T> boolean contains(T[] array, T... items) {
if (array.length == 0)
return false;
if (items.length == 0)
return false;
for (var element : array) {
for (var argument : items) {
if (element.equals(argument))
return true;
}
}
return false;
}
static void help() {
out.printf("Downloads an artifact from a %s repository with its %s.%n", emphasize_local("maven"),
emphasize_local("transitive dependencies"));
}
static void usage() {
out.printf("%s: java download_jar.java <group id> <artifact id> <version>%n", emphasize_global("Usage"));
}
static void exit() {
out.printf("%s!%n", emphasize_local("Done"));
System.exit(0);
}
static String emphasize_global(String message) {
return "\033[4m" + message + "\033[0m";
}
static String emphasize_local(String message) {
return "\033[3m" + message + "\033[0m";
}
static void fail(String message, Object... arguments) {
out.printf(message, arguments);
System.exit(-1);
}
static void fail() {
System.exit(-1);
}
}
new file mode 100644+50 / −0 text lines
aercandroid-toolsani-clibatcarapace-bincliphistcmakecmuscurldifftasticdirenvethtoolfd-findffmpegfirefoxflatpakfzfgamemodegamescopeghgitgnupg2golanghpliphplip-guijava-latest-openjdkjava-latest-openjdk-develjava-latest-openjdk-javadocjava-latest-openjdk-srcjustlua-language-serverluajitlutrismoldmpvneovimpandocpavucontrolpicardripgreprustupshfmtskimsteamtealdeerweztermwl-clipboardzathurazathura-pdf-mupdfzigdeleted file mode 100755+0 / −338 text lines
#!/bin/sh
#
# git-info - shows information about a Git repository a la `svn info'
#
# How to use:
# $ git info
# $ git info ~/src/somewhere/somefile
# $ git info some/relative/file_or_directory
# $ git info ~/repos/something.git
#
# Copyright (c) 2009-2022 Akinori MUSHA
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
COLOR=
main () {
local opt
local OPTS_SPEC="\
$0 [<options>] [<path>]
$0 shows information about a Git repository.
--
h,help show the help
color?when show colored output (always|never|auto)
"
eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt --stuck-long -- "$@" || echo exit $?)"
while [ $# -gt 0 ]; do
opt="$1"
shift
case "$opt" in
--color)
COLOR=always
;;
--color\=*)
COLOR="${opt#*=}"
;;
--)
break
;;
*)
die "Unexpected option: $opt"
;;
esac
done
initialize_colors
case "$#" in
1)
;;
0)
if [ -n "$GIT_DIR" ]; then
set -- "$GIT_DIR"
else
set -- .
fi
;;
*)
die "Too many arguments"
;;
esac
git_info "$1"
}
initialize_colors () {
if [ -z "$COLOR" ]; then
if git config --get-colorbool color.info; then
COLOR=always
else
COLOR=never
fi
fi
case "$COLOR" in
always|never)
COLOR_BRANCH=$COLOR
;;
auto)
if git config --get-colorbool color.branch; then
COLOR_BRANCH=always
else
COLOR_BRANCH=never
fi
;;
*)
die "option \`color' expects \"always\", \"auto\", or \"never\""
;;
esac
if [ "$COLOR" = always ]; then
REMOTE_COLOR="$(get_color color.info.remote color.branch.remote red)"
LOCAL_COLOR="$(get_color color.info.local color.branch.local green)"
PATH_COLOR="$(get_color color.info.path '' 'bold')"
REPOSITORY_COLOR="$(get_color color.info.repository '' 'bold')"
ID_COLOR="$(get_color color.info.id '' 'yellow')"
RESET_COLOR=$(printf "\033[m")
else
REMOTE_COLOR=
LOCAL_COLOR=
PATH_COLOR=
REPOSITORY_COLOR=
ID_COLOR=
RESET_COLOR=
fi
}
get_color () {
local key1="$1" key2="$2" fb="$3"
local color="$(git config --get-color "$key1" '')"
case "$color" in
'[m'|'')
git config --get-color "$key2" "$fb"
;;
*)
printf '%s' "$color"
;;
esac
}
git_info () {
local path="$1" dir relpath root git_dir
if [ -d "$path" ]; then
dir="$(cd -P "$path" && pwd)" || die "$path: Cannot cd to the directory"
case "$path" in
*.git)
git_dir="$dir"
;;
esac
elif [ -f "$path" ]; then
dir="$(dirname "$path")"
dir="$(cd -P "$dir" && pwd)" || die "$dir: Cannot cd to the directory"
relpath="$(basename "$path")"
else
die "$path: No such file or directory"
fi
if [ -n "$git_dir" ]; then
dir=
relpath=
elif case "$dir" in ?*.git) [ -d "$dir/objects" -a -d "$dir/refs" ] ;; *) false ;; esac; then
git_dir="$dir"
relpath=
else
root="$(
cd "$dir" || exit 1
while [ ! -e .git ]; do
[ "$(pwd)" = / ] && exit 1
cd ..
done
pwd
)" || die "Not a git repository."
git_dir="$root/.git"
if [ "$dir" = "$root" ]; then
relpath=.
elif [ -n "$relpath" ]; then
relpath="${dir#"$root/"}/$relpath"
else
relpath="${dir#"$root/"}"
fi
fi
set -- "$git_dir"
if [ -n "$relpath" ]; then
set -- "$@" "$relpath"
fi
do_git_info "$@"
}
do_git_info () {
local git_dir="$1" relpath="$2" root line field color reset
shift
echo "Repository Path: $PATH_COLOR$git_dir$RESET_COLOR"
if [ $# -gt 0 ]; then
root="$(dirname "$git_dir")"
if [ "$relpath" = . ]; then
echo "Path: $PATH_COLOR$root$RESET_COLOR"
else
echo "Path: $PATH_COLOR$root/$relpath$RESET_COLOR"
fi
fi
maketemp
GIT_DIR="$git_dir" git remote -v > "$TEMPFILE"
if [ -s "$TEMPFILE" ]; then
echo "Remote Repositories:"
sed -e "s/^\([^ ]\{1,\}\)\([ ]\{1,\}\)\([^ ]\{1,\}\)/$REMOTE_COLOR\1$RESET_COLOR\2$REPOSITORY_COLOR\3$RESET_COLOR/" \
-e 's/^/ /' \
"$TEMPFILE"
fi
GIT_DIR="$git_dir" git branch -r --color=$COLOR_BRANCH > "$TEMPFILE"
if [ -s "$TEMPFILE" ]; then
echo "Remote Branches:"
sed -e "s/\([ ]\{1,\}->[ ]\{1,\}\)\([^ ]\{1,\}\)/\1$REMOTE_COLOR\2$RESET_COLOR/" \
-e 's/^ */ /' "$TEMPFILE"
fi
GIT_DIR="$git_dir" git branch --color=$COLOR_BRANCH > "$TEMPFILE"
if [ -s "$TEMPFILE" ]; then
echo "Local Branches:"
sed 's/^/ /' "$TEMPFILE"
fi
echo "Repository Configuration:"
GIT_DIR="$git_dir" git config --local --list | sort | {
prev_section=
prev_subsection=
while read line; do
case "$line" in
(*=*)
lhs=$(expr "$line" : '\([^=]\{1,\}\)')
rhs=$(expr "$line" : '[^=]\{1,\}=\(.*\)')
case "$lhs" in
(?*.?*.?*)
section=$(expr "$lhs" : '\([^.]\{1,\}\)')
subsection=$(expr "$lhs" : '[^.]\{1,\}\.\(.\{1,\}\)\.')
key=$(expr "$lhs" : '[^.]\{1,\}\..\{1,\}\.\([^.]\{0,\}\)$')
if [ "$section" != "$prev_section" -o "$subsection" != "$prev_subsection" ]; then
prev_section=$section
prev_subsection=$subsection
case "$section" in
(remote)
subsection=$REMOTE_COLOR$subsection$RESET_COLOR
;;
(branch)
subsection=$LOCAL_COLOR$subsection$RESET_COLOR
esac
printf "\t[%s \"%s\"]\n" "$section" "$subsection"
fi
case "$section" in
(remote)
if [ "$key" = url ]; then
rhs=$REPOSITORY_COLOR$rhs$RESET_COLOR
fi
;;
(branch)
if [ "$key" = remote ]; then
rhs=$REMOTE_COLOR$rhs$RESET_COLOR
fi
esac
printf "\t\t%s = %s\n" "$key" "$rhs"
;;
(?*.?*)
section=$(expr "$lhs" : '\([^.]\{1,\}\)')
key=$(expr "$lhs" : '[^.]\{1,\}\.\([^.]\{1,\}\)$')
if [ "$section" != "$prev_section" -o -n "$prev_subsection" ]; then
prev_section=$section
prev_subsection=
printf "\t[%s]\n" "$section"
fi
printf "\t\t$key = $rhs\n"
;;
(*)
esac
esac
done
}
(cd "$root" && GIT_DIR="$git_dir" git log --max-count=1 "$@") | {
while read -r field line; do
color=
reset=
case "$field" in
commit)
field='Commit ID:'
color="$ID_COLOR"
reset="$RESET_COLOR"
;;
*:)
;;
'')
break
;;
esac
echo "Last Changed $field $color$line$reset"
done
cat > "$TEMPFILE"
}
echo "Last Changed Log:"
sed 's/^ / /' "$TEMPFILE"
finalize
}
die () {
[ "$#" -gt 0 ] && echo "$0: $@" >&2
finalize
exit 1
}
TEMPFILE=
maketemp () {
if [ -z "$TEMPFILE" ]; then
TEMPFILE="$(mktemp /tmp/git-info.XXXXXX)" || die
trap "finalize; exit 130" 1 2 3 15
fi
}
finalize () {
if [ -n "$TEMPFILE" ]; then
rm -f "$TEMPFILE"
fi
}
main "$@"No final newlinedeleted file mode 100755+0 / −17 text lines
#!/usr/bin/env nu
def main [] {
const background_settings = [
['key', 'value'];
['picture-uri', 'none']
['color-shading-type', 'solid']
['primary-color', '#131313']
['secondary-color', '#131313']
]
$background_settings | each { | setting |
run-external gsettings set 'org.gnome.desktop.background' $setting.key $setting.value
}
null
}
deleted file mode 100755+0 / −39 text lines
#!/usr/bin/bash
#
# ANSI color scheme script featuring Space Invaders
#
# Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
# Modified by lolilolicon
#
f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
done
bld=$'\e[1m'
rst=$'\e[0m'
cat << EOF
$f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
$f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
$f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst
$f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst
$bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
$bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
$bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst
$bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst
$f7▌$rst
$f7▌$rst
$f7 ▄█▄ $rst
$f7▄█████████▄$rst
$f7▀▀▀▀▀▀▀▀▀▀▀$rst
EOFNo final newline+1 / −1 text lines
+93 / −94 text lines
[
[name binary version win32_url lnx_url];
[
ziggy
ziggy
0.0.1
https://github.com/kristoff-it/ziggy/releases/download/{ version }/x86_64-windows.zip
https://github.com/kristoff-it/ziggy/releases/download/{ version }/x86_64-linux-musl.tar.xz
]
[
superhtml
superhtml
0.5.3
https://github.com/kristoff-it/superhtml/releases/download/v{ version }/x86_64-windows.zip
https://github.com/kristoff-it/superhtml/releases/download/v{ version }/x86_64-linux-musl.tar.gz
]
[
lemminx
lemminx
0.29.0
https://github.com/redhat-developer/vscode-xml/releases/download/{ version }/lemminx-win32.zip
https://github.com/redhat-developer/vscode-xml/releases/download/{ version }/lemminx-linux.zip
]
[
mergiraf
mergiraf
0.8.1
https://codeberg.org/mergiraf/mergiraf/releases/download/v{ version }/mergiraf_x86_64-pc-windows-gnu.zip
https://codeberg.org/mergiraf/mergiraf/releases/download/v{ version }/mergiraf_x86_64-unknown-linux-musl.tar.gz
]
[
ouch
ouch
0.5.1
https://github.com/ouch-org/ouch/releases/download/{ version }/ouch-x86_64-pc-windows-msvc.zip
https://github.com/ouch-org/ouch/releases/download/{ version }/ouch-x86_64-unknown-linux-musl.tar.gz
],
[
heatseaker
hs
1.7.2
https://github.com/rschmitt/heatseeker/releases/download/v{ version }/heatseeker-v{ version }-x86_64-pc-windows-msvc.zip
https://github.com/rschmitt/heatseeker/releases/download/v{ version }/heatseeker-v{ version }-x86_64-unknown-linux-musl.tar.gz
],
[
ijq
ijq
1.1.2
https://git.sr.ht/~gpanders/ijq/refs/download/v{ version }/ijq-{ version }-windows-amd64.tar.gz
https://git.sr.ht/~gpanders/ijq/refs/download/v{ version }/ijq-{ version }-linux-amd64.tar.gz
],
[
spoon
spoon
0.0.9
https://github.com/Bios-Marcel/spoon/releases/download/v{ version }/spoon.exe
null
],
[
ttyper
ttyper
1.6.0
https://github.com/max-niederman/ttyper/releases/download/v{ version }/ttyper-x86_64-pc-windows-msvc.zip
https://github.com/max-niederman/ttyper/releases/download/v{ version }/ttyper-x86_64-unknown-linux-musl.tar.gz
],
[
tree-sitter
tree-sitter
0.24.4
https://github.com/tree-sitter/tree-sitter/releases/download/v{ version }/tree-sitter-windows-x64.gz
https://github.com/tree-sitter/tree-sitter/releases/download/v{ version }/tree-sitter-linux-x64.gz
],
[
win32yank
win32yank
0.1.1
https://github.com/equalsraf/win32yank/releases/download/v{ version }/win32yank-x64.zip
null
],
[
Contextive.LanguageServer
Contextive.LanguageServer
1.17.0
https://github.com/dev-cycles/contextive/releases/download/v{ version }/Contextive.LanguageServer-win-x64-{ version }.zip
https://github.com/dev-cycles/contextive/releases/download/v{ version }/Contextive.LanguageServer-linux-x64-{ version }.zip
],
[
zls
zls
0.14.0
https://builds.zigtools.org/zls-windows-x86_64-{ version }.zip
https://builds.zigtools.org/zls-linux-x86_64-{ version }.tar.xz
]
]
[ [ name, binary, version, "win32_url", lnx_url ]; [ "Contextive.LanguageServer", "Contextive.LanguageServer", "1.17.0", "https://github.com/dev-cycles/contextive/releases/download/v{ version }/Contextive.LanguageServer-win-x64-{ version }.zip", "https://github.com/dev-cycles/contextive/releases/download/v{ version }/Contextive.LanguageServer-linux-x64-{ version }.zip" ], [ heatseaker, hs, "1.7.2", "https://github.com/rschmitt/heatseeker/releases/download/v{ version }/heatseeker-v{ version }-x86_64-pc-windows-msvc.zip", "https://github.com/rschmitt/heatseeker/releases/download/v{ version }/heatseeker-v{ version }-x86_64-unknown-linux-musl.tar.gz" ], [ lemminx, lemminx, "0.29.0", "https://github.com/redhat-developer/vscode-xml/releases/download/{ version }/lemminx-win32.zip", "https://github.com/redhat-developer/vscode-xml/releases/download/{ version }/lemminx-linux.zip" ], [ mergiraf, mergiraf, "0.8.1", "https://codeberg.org/mergiraf/mergiraf/releases/download/v{ version }/mergiraf_x86_64-pc-windows-gnu.zip", "https://codeberg.org/mergiraf/mergiraf/releases/download/v{ version }/mergiraf_x86_64-unknown-linux-musl.tar.gz" ], [ ouch, ouch, "0.5.1", "https://github.com/ouch-org/ouch/releases/download/{ version }/ouch-x86_64-pc-windows-msvc.zip", "https://github.com/ouch-org/ouch/releases/download/{ version }/ouch-x86_64-unknown-linux-musl.tar.gz" ], [ spoon, spoon, "0.0.9", "https://github.com/Bios-Marcel/spoon/releases/download/v{ version }/spoon.exe", null ], [ superhtml, superhtml, "0.5.3", "https://github.com/kristoff-it/superhtml/releases/download/v{ version }/x86_64-windows.zip", "https://github.com/kristoff-it/superhtml/releases/download/v{ version }/x86_64-linux-musl.tar.gz" ], [ tree-sitter, tree-sitter, "0.24.4", "https://github.com/tree-sitter/tree-sitter/releases/download/v{ version }/tree-sitter-windows-x64.gz", "https://github.com/tree-sitter/tree-sitter/releases/download/v{ version }/tree-sitter-linux-x64.gz" ], [ ttyper, ttyper, "1.6.0", "https://github.com/max-niederman/ttyper/releases/download/v{ version }/ttyper-x86_64-pc-windows-msvc.zip", "https://github.com/max-niederman/ttyper/releases/download/v{ version }/ttyper-x86_64-unknown-linux-musl.tar.gz" ], [ "win32yank", "win32yank", "0.1.1", "https://github.com/equalsraf/win32yank/releases/download/v{ version }/win32yank-x64.zip", null ], [ ziggy, ziggy, "0.0.1", "https://github.com/kristoff-it/ziggy/releases/download/{ version }/x86_64-windows.zip", "https://github.com/kristoff-it/ziggy/releases/download/{ version }/x86_64-linux-musl.tar.xz" ], [ zls, zls, "0.14.0", "https://github.com/zigtools/zls/releases/download/{ version }/zls-x86-windows.zip", "https://github.com/zigtools/zls/releases/download/{ version }/zls-x86-linux.tar.xz" ]]No final newlinedeleted file mode 100755+0 / −32 text lines
#!/bin/bash
rbwsearch() {
SEARCH_ARGS=()
RBW_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
-f|--field)
RBW_ARGS+=("$1" "$2")
shift
shift
;;
-*)
RBW_ARGS+=("$1")
shift
;;
*)
SEARCH_ARGS+=("$1")
shift
;;
esac
done
rbw unlocked || rbw unlock || return
IFS=$'\t' read -r NAME FOLDER < <(rbw list --fields name,folder|sk -q "${SEARCH_ARGS[*]}")
if [ -n "$FOLDER" ]; then
RBW_ARGS+=("--folder" "$FOLDER")
fi
rbw get --clipboard "${RBW_ARGS[@]}" "$NAME"
}
rbwsearch $@
deleted file mode 100755+0 / −4 text lines
+1 / −1 text lines
{palette = {debug = "#ff00ff", error = "#ec1274", warning = "#fbcbbf", info = "#cfcefa", content = {normal = "#ededed", backdrop = "#121212", accent = "#e808e8", minor = "#686868", focus = "#7d9e9b", unfocus = "#284c4a", important_local = "#9b66f0", important_global = "#b086f3"}, ui = {normal = "#fefefe", backdrop = "#010101", accent = "#b63ab6", minor = "#565656", focus = "#738584", unfocus = "#1f3231", important_local = "#884de6", important_global = "#9c6cea"}}}No final newline{palette = {debug = "#ff00ff", error = "#ac5a77", warning = "#b4b1ae", info = "#b8b8b8", content = {normal = "#ededed", backdrop = "#121212", accent = "#812281", minor = "#8b8b8b", focus = "#7ba1aa", unfocus = "#406f79", important_local = "#948fa6", important_global = "#f3f3f5"}, ui = {normal = "#dbdbdb", backdrop = "#242424", accent = "#9d299d", minor = "#9d9d9d", focus = "#a4a4a4", unfocus = "#6e6e6e", important_local = "#a7a3b6", important_global = "#ffffff"}}}No final newline+1 / −1 text lines
{palette = {debug = "#ff00ff", error = "#f2529a", warning = "#f9aa96", info = "#a8a7f7", content = {normal = "#121212", backdrop = "#ededed", accent = "#e808e8", minor = "#5f5f5f", focus = "#248883", unfocus = "#aaaaaa", important_local = "#a382d5", important_global = "#9068cc"}, ui = {normal = "#010101", backdrop = "#fefefe", accent = "#b63ab6", minor = "#717171", focus = "#339d97", unfocus = "#bcbcbc", important_local = "#b8a1d9", important_global = "#a588cf"}}}No final newline{palette = {debug = "#ff00ff", error = "#804056", warning = "#928e8a", info = "#949494", content = {normal = "#121212", backdrop = "#ededed", accent = "#491349", minor = "#3b3b3b", focus = "#184e5b", unfocus = "#6f6f6f", important_local = "#4c4365", important_global = "#000000"}, ui = {normal = "#242424", backdrop = "#dbdbdb", accent = "#2d0c2d", minor = "#292929", focus = "#212c2e", unfocus = "#5d5d5d", important_local = "#3c3550", important_global = "#000000"}}}No final newline+7 / −8 text lines