solorice/config/xplr/hack.lua
Kristofers Solo a42ded1119 Use dotter
2024-08-28 09:02:07 +03:00

60 lines
1.8 KiB
Lua

---@diagnostic disable
local xplr = xplr -- The globally exposed configuration to be overridden.
---@diagnostic enable
-- -- Preview images using imv.
-- xplr.config.modes.builtin.default.key_bindings.on_key.P = {
-- help = "preview",
-- messages = {
-- {
-- BashExecSilently0 = [===[
-- FIFO_PATH="/tmp/xplr.fifo"
--
-- if [ -e "$FIFO_PATH" ]; then
-- "$XPLR" -m StopFifo
-- rm -f -- "$FIFO_PATH"
-- else
-- mkfifo "$FIFO_PATH"
-- "$HOME/.local/bin/imv-open" "$FIFO_PATH" "$XPLR_FOCUS_PATH" &
-- "$XPLR" -m 'StartFifo: %q' "$FIFO_PATH"
-- fi
-- ]===],
-- },
-- },
-- }
--
-- -- Batch rename the selected or visible files and directories in `$PWD`.
-- xplr.config.modes.builtin.default.key_bindings.on_key.R = {
-- help = "batch rename",
-- messages = {
-- {
-- BashExec = [===[
-- SELECTION=$(cat "${XPLR_PIPE_SELECTION_OUT:?}")
-- NODES=${SELECTION:-$(cat "${XPLR_PIPE_DIRECTORY_NODES_OUT:?}")}
-- if [ "$NODES" ]; then
-- echo -e "$NODES" | renamer
-- "$XPLR" -m ExplorePwdAsync
-- fi
-- ]===],
-- },
-- },
-- }
--
-- -- Serve `$PWD` using a static web server via LAN.
-- xplr.config.modes.builtin.default.key_bindings.on_key.S = {
-- help = "serve $PWD",
-- messages = {
-- {
-- BashExec0 = [===[
-- IP=$(ip addr | rg -w inet | cut -d/ -f1 | rg -Eo '[0-9]{1,3}\.[0-9]{ 1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sk --prompt 'Select IP > ')
-- echo "IP: ${IP:?}"
-- read -p "Port (default 5000): " PORT
-- echo
-- sfz --all --cors --no-ignore --bind ${IP:?} --port ${PORT:-5000} . &
-- sleep 1 && read -p '[press enter to exit]'
-- kill -9 %1
-- ]===],
-- },
-- },
-- }