diff --git a/flake.lock b/flake.lock index 5618340..be8d5f1 100644 --- a/flake.lock +++ b/flake.lock @@ -29,11 +29,11 @@ ] }, "locked": { - "lastModified": 1748832438, - "narHash": "sha256-/CtyLVfNaFP7PrOPrTEuGOJBIhcBKVQ91KiEbtXJi0A=", + "lastModified": 1749147380, + "narHash": "sha256-UvCI5f1qD9l1fCQkoG/kJI0yNjDQIiJaN7gkve8fmII=", "owner": "nix-community", "repo": "disko", - "rev": "58d6e5a83fff9982d57e0a0a994d4e5c0af441e4", + "rev": "d74db625a5cf3f46cf8fa545d6ef10bd3463ea07", "type": "github" }, "original": { @@ -89,11 +89,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1749086887, - "narHash": "sha256-ACs4F2QdKuwGF81P2gOjL0ZkYD4rvBhiR4dSqeJnDHs=", + "lastModified": 1749143968, + "narHash": "sha256-PScENt6CycBQ/RKwDuHNcyc+dd8fnN06jffoI56uv3s=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "13fae16b4ff8b0d1ea11c0a173975d5a47089446", + "rev": "ff324514304d770d533cfbf9aea1b68d68b46e48", "type": "github" }, "original": { @@ -409,11 +409,11 @@ ] }, "locked": { - "lastModified": 1749062139, - "narHash": "sha256-gGGLujmeWU+ZjFzfMvFMI0hp9xONsSbm88187wJr82Q=", + "lastModified": 1749131129, + "narHash": "sha256-tJ+93i7N4QttM75bE8T09LlSU3Mv6Dfi9WaVBvlWilo=", "owner": "nix-community", "repo": "home-manager", - "rev": "86b95fc1ed2b9b04a451a08ccf13d78fb421859c", + "rev": "13a45ede6c17b5e923dfc18a40a3f646436f4809", "type": "github" }, "original": { @@ -852,11 +852,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1749055061, - "narHash": "sha256-4v/hKWTe35MZKgd/VusNlQjja9rIYDbp5rjfmeIT29c=", + "lastModified": 1749144707, + "narHash": "sha256-JcSmySCB3pOtzeWMaEksZgaiNedEDIC6qyBezkK+92Q=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "e051966486be79c5843af95defd70813ae5c97a6", + "rev": "32d49ef427be377c82d32ce74ff3082c2c992199", "type": "github" }, "original": { @@ -885,11 +885,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1749019222, - "narHash": "sha256-Zz2QkGVkK75iAaOBTT5+ILCg/l2HhrxzPJMd7Jr/O28=", + "lastModified": 1749112952, + "narHash": "sha256-ajI1cXa2AgdZSELvlVaQZd0XMi4eM8H3Ys0Ek8a/roI=", "owner": "YaLTeR", "repo": "niri", - "rev": "9858599ac12ab9592c08e062b2301e7c24429c81", + "rev": "242ebf294514cc22f4f9d83c0566c8ffe1cb8d8a", "type": "github" }, "original": { @@ -1074,11 +1074,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1749024892, - "narHash": "sha256-OGcDEz60TXQC+gVz5sdtgGJdKVYr6rwdzQKuZAJQpCA=", + "lastModified": 1749086602, + "narHash": "sha256-DJcgJMekoxVesl9kKjfLPix2Nbr42i7cpEHJiTnBUwU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f1b52b04f2cb6e5ead50bd28d76528a2f0380ef", + "rev": "4792576cb003c994bd7cc1edada3129def20b27d", "type": "github" }, "original": { @@ -1742,11 +1742,11 @@ "rust-overlay": "rust-overlay_3" }, "locked": { - "lastModified": 1748966898, - "narHash": "sha256-vpZNvQ9YM8jmGOcfxl3RDZEQ130FeyIGdabwLzaf9lg=", + "lastModified": 1749135826, + "narHash": "sha256-3VhH5g7oriczeTD/+zT056eLUDF1MGiZf2Hxdw7eQ5A=", "owner": "sxyazi", "repo": "yazi", - "rev": "20446544ef13f530792179804356ef2d28f403da", + "rev": "b637c32ef755813c1b1f6f611132c1feb4bb459f", "type": "github" }, "original": { @@ -1763,11 +1763,11 @@ ] }, "locked": { - "lastModified": 1749006984, - "narHash": "sha256-AZdwPbpIPnEXom33VSfmTxeHUzcrEwW3p2xcXsyXDcU=", + "lastModified": 1749093358, + "narHash": "sha256-Clx1BzHsSSzIXbnCW9KM3m5gW3SFgemcW9/4XH4epeM=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "7afa2abe15d7b1d843f9fc8919ac6efa7ad13b84", + "rev": "d4cf0ac2e860be17036a376ae99b233a115826bc", "type": "github" }, "original": { diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index 086651a..b39c62a 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -269,7 +269,7 @@ xdgOpenUsePortal = false; #true; config = { common.default = [ "niri" ]; - common."org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ]; # xdg-? + # common."org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ]; # xdg-? }; extraPortals = [ pkgs.xdg-desktop-portal-gnome diff --git a/hosts/eddie/packages.nix b/hosts/eddie/packages.nix index 7c6627a..50ad740 100644 --- a/hosts/eddie/packages.nix +++ b/hosts/eddie/packages.nix @@ -30,8 +30,6 @@ vulkan-tools openrazer-daemon openrgb-with-all-plugins - xdg-desktop-portal-termfilechooser - adwaita-icon-theme adwaita-fonts gnome-themes-extra diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index 40eb7bf..622825e 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -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 diff --git a/modules/home/file-chooser/config b/modules/home/file-chooser/config index 0b61aa1..adf68a5 100644 --- a/modules/home/file-chooser/config +++ b/modules/home/file-chooser/config @@ -3,4 +3,3 @@ [filechooser] cmd=$HOME/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh default_dir=$HOME -env=TERMCMD=$HOME/.local/bin/wezlauncher diff --git a/modules/home/file-chooser/yazi-wrapper.sh b/modules/home/file-chooser/yazi-wrapper.sh index 9ab04c0..ec7f9a1 100755 --- a/modules/home/file-chooser/yazi-wrapper.sh +++ b/modules/home/file-chooser/yazi-wrapper.sh @@ -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 . - -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" diff --git a/modules/home/yazi.nix b/modules/home/yazi.nix index 48f3653..3267e5e 100644 --- a/modules/home/yazi.nix +++ b/modules/home/yazi.nix @@ -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; } diff --git a/modules/system/kanata.nix b/modules/system/kanata.nix index 1ee61e9..af9fff1 100644 --- a/modules/system/kanata.nix +++ b/modules/system/kanata.nix @@ -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)