diff --git a/.config/environment.d/envvars.conf b/.config/environment.d/envvars.conf index b06b949..7d9c384 100644 --- a/.config/environment.d/envvars.conf +++ b/.config/environment.d/envvars.conf @@ -22,6 +22,7 @@ _JAVA_AWT_WM_NONREPARENTING=1 # Make Qt apps use GTK3 file dialogs and icons. # Requires 'qt5ct' or 'qgnomeplatform-qt5' + style plugins. QT_QPA_PLATFORMTHEME="gtk3" +GTK_USE_PORTAL=1 # -------------------------- # WebKit / Browser Settings diff --git a/.config/sway/config.d/floating.conf b/.config/sway/config.d/floating.conf index 9829323..feaa979 100644 --- a/.config/sway/config.d/floating.conf +++ b/.config/sway/config.d/floating.conf @@ -3,6 +3,7 @@ floating_maximum_size 1280 x 720 for_window [app_id="floating_waybar"] floating enable, resize set 1280 720, position center for_window [app_id="pulsemixer"] floating enable, resize set 1280 720, position center for_window [title="Picture-in-Picture"] floating enable, resize set 500 300, position center +for_window [title="termfilechooser" app_id="kitty"] floating enable, resize set 1280 720, position center for_window [title="Выява ў выяве"] floating enable, resize set 500 300, position center for_window [app_id="imv"] floating enable, resize set 1280 720, position center for_window [app_id="easyeffects"] floating enable, resize set 1280 720, position center diff --git a/.config/xdg-desktop-portal-termfilechooser/.github/README.md b/.config/xdg-desktop-portal-termfilechooser/.github/README.md new file mode 100644 index 0000000..54a7539 --- /dev/null +++ b/.config/xdg-desktop-portal-termfilechooser/.github/README.md @@ -0,0 +1,5 @@ +# termfilechooser + +[xdg-desktop-portal-termfilechooser](https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser) +is a cool portal that lets you open a file in a terminal emulator, in my case [kitty](https://sw.kovidgoyal.net/kitty/) +with yazi.. diff --git a/.config/xdg-desktop-portal-termfilechooser/config b/.config/xdg-desktop-portal-termfilechooser/config new file mode 100644 index 0000000..98c33e5 --- /dev/null +++ b/.config/xdg-desktop-portal-termfilechooser/config @@ -0,0 +1,5 @@ +[filechooser] +cmd=yazi-wrapper.sh +default_dir=$HOME/Downloads/ +open_mode = suggested +save_mode = last diff --git a/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh b/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh new file mode 100644 index 0000000..01ce9c4 --- /dev/null +++ b/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env sh +# This wrapper script is invoked by xdg-desktop-portal-termfilechooser. +# +# For more information about input/output arguments read `xdg-desktop-portal-termfilechooser(5)` + +set -e + +if [ "$6" -ge 4 ]; then + set -x +fi + +multiple="$1" +directory="$2" +save="$3" +path="$4" +out="$5" + +cmd="yazi" +termcmd="${TERMCMD:-kitty --title 'termfilechooser'}" + +if [ "$save" = "1" ]; then + # save a file + set -- --chooser-file="$out" "$path" +elif [ "$directory" = "1" ]; then + # upload files from a directory + set -- --chooser-file="$out" --cwd-file="$out"".1" "$path" +elif [ "$multiple" = "1" ]; then + # upload multiple files + set -- --chooser-file="$out" "$path" +else + # upload only 1 file + set -- --chooser-file="$out" "$path" +fi + +command="$termcmd $cmd" +for arg in "$@"; do + # escape double quotes + escaped=$(printf "%s" "$arg" | sed 's/"/\\"/g') + # escape special + case "$termcmd" in + *"ghostty"*) + command="$command \"\\\"$escaped\\\"\"";; + *) + command="$command \"$escaped\"";; + esac +done + +sh -c "$command" + +if [ "$directory" = "1" ]; then + if [ ! -s "$out" ] && [ -s "$out"".1" ]; then + cat "$out"".1" > "$out" + rm "$out"".1" + else + rm "$out"".1" + fi +fi diff --git a/.config/xdg-desktop-portal/portals.conf b/.config/xdg-desktop-portal/portals.conf new file mode 100644 index 0000000..20ca35c --- /dev/null +++ b/.config/xdg-desktop-portal/portals.conf @@ -0,0 +1,3 @@ +[preferred] +default=termfilechooser +org.freedesktop.impl.portal.FileChooser=termfilechooser diff --git a/.config/yazi/NvimTree_1 b/.config/yazi/NvimTree_1 new file mode 100644 index 0000000..e69de29 diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml index 672c97c..6c62c73 100644 --- a/.config/yazi/yazi.toml +++ b/.config/yazi/yazi.toml @@ -98,5 +98,4 @@ previewers = [ # Fallback if nothing else matches { name = "*", run = "file" }, - "", ] diff --git a/.github/README.md b/.github/README.md index daa04ec..b48d5e7 100644 --- a/.github/README.md +++ b/.github/README.md @@ -94,13 +94,14 @@ All the info about my setup. | **Shell** | [zsh](https://github.com/zsh-users/zsh/) [:gear:](../.zshrc) | | **Shell configuration** | [ohmyzsh](https://github.com/ohmyzsh/ohmyzsh/) | | **Terminal emulator** | [kitty](https://sw.kovidgoyal.net/kitty/) [:gear:](../.config/kitty/) | -| **Text editor** | [neovim](https://neovim.io/) [:gear:](https://github.com/CelticBoozer/nvim-config/) | +| **Text editor** | [neovim](https://neovim.io/) [:gear:](https://github.com/CelticBoozer/nvim-config/) | | **System information** | [fastfetch](https://github.com/LinusDierheimer/fastfetch/) [:gear:](../.config/fastfetch/) [neofetch](https://github.com/dylanaraps/neofetch/) [:hourglass:](../.config/neofetch/) | | **ls replacement** | [eza](https://github.com/eza-community/eza/) | | **cat Replacement** | [bat](https://github.com/sharkdp/bat/) [:gear:](../.config/bat/) | | **find replacement** | [fd](https://github.com/sharkdp/fd/) | | **cp/mv replacement** | [advcpmv](https://github.com/jarun/advcpmv) | | **File manager** | [yazi](https://github.com/sxyazi/yazi/) [:gear:](../.config/yazi/) | +| **File chooser** | [termfilechooser](https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser/) [:gear:](../.config/xdg-desktop-portal-termfilechooser/) | | **Fuzzy file finder** | [fzf](https://github.com/junegunn/fzf/) [:gear:](../.fzfrc) | | **Fuzzy word finder** | [ripgrep](https://github.com/BurntSushi/ripgrep/) [:gear:](../.ripgreprc) | | **Cheat sheet tool** | [navi](https://github.com/denisidoro/navi) | diff --git a/.github/cspell/repo_soft.txt b/.github/cspell/repo_soft.txt index 4c823b4..988501e 100644 --- a/.github/cspell/repo_soft.txt +++ b/.github/cspell/repo_soft.txt @@ -67,3 +67,4 @@ Yerczh zecva jtjqp eekqwg +termfilechooser diff --git a/.gitignore b/.gitignore index 718807a..5700b72 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ !.config/vesktop/themes/ !.config/waybar/ !.config/wob/ +!.config/xdg-desktop-portal/ +!.config/xdg-desktop-portal-termfilechooser/ !.config/yamlfmt/ !.config/yamllint/ !.config/yazi/ diff --git a/.system-config-backup/aurpkglist.txt b/.system-config-backup/aurpkglist.txt index 634e83c..dd45775 100644 --- a/.system-config-backup/aurpkglist.txt +++ b/.system-config-backup/aurpkglist.txt @@ -5,6 +5,7 @@ google-chrome google-java-format gruvbox-material-gtk-theme-git gruvbox-material-icon-theme-git +insomnia-bin intellij-idea-ultimate-edition lazyjournal luajit-tiktoken-bin @@ -12,7 +13,6 @@ pacnews-neovim-git paru pkgtools playit-bin -postman-bin python-commitizen python-decli python-questionary diff --git a/.zshrc b/.zshrc index 49e4bb5..8238ebb 100644 --- a/.zshrc +++ b/.zshrc @@ -38,3 +38,4 @@ alias find="fd -I -c always" export PATH=$PATH:/home/celtic/.millennium/ext/bin ___MY_VMOPTIONS_SHELL_FILE="${HOME}/.jetbrains.vmoptions.sh"; if [ -f "${___MY_VMOPTIONS_SHELL_FILE}" ]; then . "${___MY_VMOPTIONS_SHELL_FILE}"; fi +export TERMCMD='kitty -e "terminal filechooser"'