Ever wanted to know how noice creates the cmdline or wanted your own one?
No one? Guess it's just me 🥲.
Anyway, this post is a simple tutorial for creating a basic cmdline in neovim.
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({Key? key}) : super(key: key); |
| import kotlinx.cinterop.* | |
| import org.ssh.* | |
| fun main(): Unit = memScoped { | |
| val session = ssh_new() ?: return | |
| val port = alloc<IntVar>() | |
| port.value = 22 | |
| val verbosity = alloc<UIntVar>() | |
| verbosity.value = SSH_LOG_PROTOCOL |
This parses the i3 workspace tree from the i3 IPC to execute focus commands on the outermost tabbed container that has 1+ siblings.
If such a container is not found in the hierarchy up from the focused window to the root container then this will call a regular focus command. In theory this script can take any valid arguments that the i3 command focus takes (e.g. prev and next, etc.), however it has only been tested with leftandright.
The idea is this will move focus between the highest level containers without requiring several focus parent commands if working with highly nested containers.
The following video demo is running with the following keybinds, i.e. the "normal" keybind to change focus instead runs this script with super+alt+(left/right) being a fallback to normal focus (left/right.
| ---------------------- | |
| -- #example ytdl_preload.conf | |
| -- # make sure lines do not have trailing whitespace | |
| -- # ytdl_opt has no sanity check and should be formatted exactly how it would appear in yt-dlp CLI, they are split into a key/value pair on whitespace | |
| -- # at least on Windows, do not escape '\' in temp, just us a single one for each divider | |
| -- #temp=R:\ytdltest | |
| -- #ytdl_opt1=-r 50k | |
| -- #ytdl_opt2=-N 5 | |
| -- #ytdl_opt#=etc |
| #!/bin/sh | |
| # | |
| # Launches files based on their mimetypes | |
| # Usage: launch [FILE...] | |
| # Dependencies: file | |
| case $(file --mime-type "$@" -bL) in | |
| # Check for the mimetype of your file (This is POSIX regex) | |
| video/* | audio/* | image/gif) | |
| # Launch using your favorite application |
| #!/bin/sh | |
| package_name=$1 | |
| ./gradlew assembleDebug | |
| adb -d install -r app/build/outputs/apk/app-debug.apk | |
| adb shell monkey -p "$package_name" -c android.intent.category.LAUNCHER 1 | |
| ./logcat.sh "$package_name" |
| #!/usr/bin/env python3 | |
| # | |
| # A script to download chat from a Twitch VOD and print it to a terminal. | |
| # Chat will be downloaded all the way until it ends. | |
| # | |
| # Usage: TWITCH_CLIENT_ID=0123456789abcdef0123456789abcde twitch-vod-chat.py [video_id] [start] | |
| # | |
| # This script could break at any time, because Twitch's chat API is | |
| # undocumented and likes to change at any time; in fact, this script was |
| --[[ ************************************************************* | |
| * Context menu for mpv using Tcl/Tk. Mostly proof of concept. | |
| * Avi Halachmi (:avih) https://github.com/avih | |
| * | |
| * Features: | |
| * - Simple construction: ["<some text>", "<mpv-command>"] is a complete menu item. | |
| * - Possibly dynamic menu items and commands, disabled items, separators. | |
| * - Possibly keeping the menu open after clicking an item (via re-launch). | |
| * - Hacky pseudo sub menus. Really, this is an ugly hack. | |
| * - Reasonably well behaved/integrated considering it's an external application. |