Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .config/environment.d/envvars.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .config/sway/config.d/floating.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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..
5 changes: 5 additions & 0 deletions .config/xdg-desktop-portal-termfilechooser/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[filechooser]
cmd=yazi-wrapper.sh
default_dir=$HOME/Downloads/
open_mode = suggested
save_mode = last
57 changes: 57 additions & 0 deletions .config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .config/xdg-desktop-portal/portals.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[preferred]
default=termfilechooser
org.freedesktop.impl.portal.FileChooser=termfilechooser
Empty file added .config/yazi/NvimTree_1
Empty file.
1 change: 0 additions & 1 deletion .config/yazi/yazi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,4 @@ previewers = [

# Fallback if nothing else matches
{ name = "*", run = "file" },
"",
]
3 changes: 2 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
1 change: 1 addition & 0 deletions .github/cspell/repo_soft.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ Yerczh
zecva
jtjqp
eekqwg
termfilechooser
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion .system-config-backup/aurpkglist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ 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
pacnews-neovim-git
paru
pkgtools
playit-bin
postman-bin
python-commitizen
python-decli
python-questionary
Expand Down
1 change: 1 addition & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
Loading