adding some softs

This commit is contained in:
Matt Nish-Lapidus 2025-06-05 16:15:57 -04:00
parent 71cdb129d5
commit 771802b28d
8 changed files with 51 additions and 133 deletions

View file

@ -100,13 +100,13 @@
rawtherapee
inkscape
# (kicad.override {
# addons = with pkgs.kicadAddons; [ kikit kikit-library ];
# })
(kicad.override {
addons = with pkgs.kicadAddons; [ kikit kikit-library ];
})
# turbocase
# openscad-unstable
# openscad-lsp
turbocase
openscad-unstable
openscad-lsp
picard
plugdata

View file

@ -3,4 +3,3 @@
[filechooser]
cmd=$HOME/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
default_dir=$HOME
env=TERMCMD=$HOME/.local/bin/wezlauncher

View file

@ -1,108 +1,29 @@
#!/usr/bin/env bash
#!/bin/sh
set -x
# This wrapper script is invoked by xdg-desktop-portal-termfilechooser.
#
# Inputs:
# 1. "1" if multiple files can be chosen, "0" otherwise.
# 2. "1" if a directory should be chosen, "0" otherwise.
# 3. "0" if opening files was requested, "1" if writing to a file was
# requested. For example, when uploading files in Firefox, this will be "0".
# When saving a web page in Firefox, this will be "1".
# 4. If writing to a file, this is recommended path provided by the caller. For
# example, when saving a web page in Firefox, this will be the recommended
# path Firefox provided, such as "~/Downloads/webpage_title.html".
# Note that if the path already exists, we keep appending "_" to it until we
# get a path that does not exist.
# 5. The output path, to which results should be written.
#
# Output:
# The script should print the selected paths to the output path (argument #5),
# one path per line.
# If nothing is printed, then the operation is assumed to have been canceled.
set -ex
multiple="$1"
directory="$2"
save="$3"
path="$4"
out="$5"
cmd="/etc/profiles/per-user/emenel/bin/yazi"
# "wezterm start --always-new-process" if you use wezterm
if [ "$save" = "1" ]; then
TITLE="Save File:"
elif [ "$directory" = "1" ]; then
TITLE="Select Directory:"
else
TITLE="Select File:"
fi
quote_string() {
local input="$1"
echo "'${input//\'/\'\\\'\'}'"
}
termcmd="${TERMCMD:-/etc/profiles/per-user/emenel/bin/wezterm}"
cleanup() {
if [ -f "$tmpfile" ]; then
/etc/profiles/per-user/emenel/bin/rm "$tmpfile" || :
fi
if [ "$save" = "1" ] && [ ! -s "$out" ]; then
/etc/profiles/per-user/emenel/bin/rm "$path" || :
fi
}
trap cleanup EXIT HUP INT QUIT ABRT TERM
cmd="yazi"
termcmd="${TERMCMD:-$HOME/.local/bin/wezlauncher}"
if [ "$save" = "1" ]; then
tmpfile=$(/etc/profiles/per-user/emenel/bin/mktemp)
# Save/download file
/etc/profiles/per-user/emenel/bin/printf '%s' 'xdg-desktop-portal-termfilechooser saving files tutorial
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! === WARNING! === !!!
!!! The contents of *whatever* file you open last in !!!
!!! yazi will be *overwritten*! !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Instructions:
1) Move this file wherever you want.
2) Rename the file if needed.
3) Confirm your selection by opening the file, for
example by pressing <Enter>.
Notes:
1) This file is provided for your convenience. You can
only choose this placeholder file otherwise the save operation aborted.
2) If you quit yazi without opening a file, this file
will be removed and the save operation aborted.
' >"$path"
set -- --chooser-file="$(quote_string "$tmpfile")" "$(quote_string "$path")"
set -- --chooser-file="$out" "$path"
elif [ "$directory" = "1" ]; then
# upload files from a directory
# Use this if you want to select folder by 'quit' function in yazi.
set -- --cwd-file="$(quote_string "$out")" "$(quote_string "$path")"
# NOTE: Use this if you want to select folder by enter a.k.a yazi keybind for 'open' funtion ('run = "open") .
# set -- --chooser-file="$out" "$path"
set -- --chooser-file="$out" --cwd-file="$out" "$path"
elif [ "$multiple" = "1" ]; then
# upload multiple files
set -- --chooser-file="$(quote_string "$out")" "$(quote_string "$path")"
set -- --chooser-file="$out" "$path"
else
# upload only 1 file
set -- --chooser-file="$(quote_string "$out")" "$(quote_string "$path")"
set -- --chooser-file="$out" "$path"
fi
eval "$termcmd -- $cmd $@"
command="$termcmd $cmd"
for arg in "$@"; do
escaped=$(printf "%s" "$arg" | sed 's/"/\\"/g')
command="$command \"$escaped\""
done
# case save file
if [ "$save" = "1" ] && [ -s "$tmpfile" ]; then
selected_file=$(/etc/profiles/per-user/emenel/bin/head -n 1 "$tmpfile")
# Check if selected file is placeholder file
if [ -f "$selected_file" ] && /etc/profiles/per-user/emenel/bin/grep -qi "^xdg-desktop-portal-termfilechooser saving files tutorial" "$selected_file"; then
/etc/profiles/per-user/emenel/bin/echo "$selected_file" >"$out"
path="$selected_file"
fi
fi
sh -c "$command"

View file

@ -178,6 +178,6 @@
xdg.configFile."yazi/theme.toml".source = ./yazi/theme.toml;
xdg.configFile."yazi/flavors".source = ./yazi/flavors;
xdg.configFile."xdg-desktop-portal-termfilechooser/config".source = ./file-chooser/config;
xdg.configFile."xdg-desktop-portal-termfilechooser/yazi-wrapper.sh".source = ./file-chooser/yazi-wrapper.sh;
# xdg.configFile."xdg-desktop-portal-termfilechooser/config".source = ./file-chooser/config;
# xdg.configFile."xdg-desktop-portal-termfilechooser/yazi-wrapper.sh".source = ./file-chooser/yazi-wrapper.sh;
}

View file

@ -90,9 +90,9 @@ ${shared-alias}
(deflayer base
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y @tap-undo i o @tap-paste-p [ ] \
tab q w e r t y u i o p [ ] \
@supesc @a @s @d f g h j k l ; ' ret
@sp-lsft z x @tap-copy @tap-paste b n m , . / @sp-rsft
@sp-lsft z x c v b n m , . / @sp-rsft
@supesc @controls lalt lctrl @spcnav @spcnav rctrl ralt @controls @hyper @supesc
bspc mlft mrgt del)
@ -163,9 +163,9 @@ ${shared-alias}
(deflayer base
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y @tap-undo i o @tap-paste-p [ ] \
tab q w e r t y u i o p [ ] \
@supesc @a @s @d f g h j k l ; ' ret
@sp-lsft z x @tap-copy @tap-paste b n m , . / @sp-rsft
@sp-lsft z x c v b n m , . / @sp-rsft
@supesc lalt @ctrl-ret @spcnav @ctrl-ret ralt)
(deflayermap (navigation)