1
0
Fork 0

Introduce `cd_open.sh` for openning files

main
urosm 2024-12-23 12:20:41 +01:00
parent 462301bd1f
commit 2aaf2a496e
3 changed files with 24 additions and 45 deletions

View File

@ -1,49 +1,15 @@
[Default Applications]
text/plain=vis.desktop;
text/markdown=vis.desktop;
inode/directory=footclient-directory.desktop;
application/pdf=org.pwmt.zathura.desktop;
inode/directory=footclient-working-directory.desktop;
# x-scheme-handler/*
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
image/avs=mpv.desktop;
image/bie=mpv.desktop;
image/x-ms-bmp=mpv.desktop;
image/cmyk=mpv.desktop;
image/dcx=mpv.desktop;
image/eps=mpv.desktop;
image/fax=mpv.desktop;
image/fits=mpv.desktop;
x-scheme-handler/mailto=thunderbird.desktop;
# image/*
image/gif=mpv.desktop;
image/gray=mpv.desktop;
image/jpeg=mpv.desktop;
image/pjpeg=mpv.desktop;
image/miff=mpv.desktop;
image/mono=mpv.desktop;
image/mtv=mpv.desktop;
image/x-portable-bitmap=mpv.desktop;
image/pcd=mpv.desktop;
image/pcx=mpv.desktop;
image/pdf=mpv.desktop;
image/x-portable-graymap=mpv.desktop;
image/pict=mpv.desktop;
image/png=mpv.desktop;
image/x-portable-anymap=mpv.desktop;
image/x-portable-pixmap=mpv.desktop;
image/ps=mpv.desktop;
image/rad=mpv.desktop;
image/x-rgb=mpv.desktop;
image/rgba=mpv.desktop;
image/rla=mpv.desktop;
image/rle=mpv.desktop;
image/sgi=mpv.desktop;
image/sun-raster=mpv.desktop;
image/targa=mpv.desktop;
image/svg+xml=mpv.desktop;
image/tiff=mpv.desktop;
image/uyvy=mpv.desktop;
image/vid=mpv.desktop;
image/viff=mpv.desktop;
image/x-xbitmap=mpv.desktop;
image/x-xpixmap=mpv.desktop;
image/x-xwindowdump=mpv.desktop;
image/x-icon=mpv.desktop;
image/yuv=mpv.desktop;
image/webp=mpv.desktop;
# application/*
application/pdf=org.pwmt.zathura.desktop;

View File

@ -180,9 +180,7 @@ bindsym $mod+n exec makoctl dismiss
bindsym $mod+shift+n exec makoctl restore
bindsym print exec grim - | wl-copy
bindsym $mod+space exec fuzzel
set $findignore \( -path "$HOME"/.cache -o -path "$HOME"/.mozilla -o -path "$HOME"/.thunderbird -o -name .git \)
bindsym $mod+shift+space exec 'cd "$(find "$PWD" $findignore -prune -o -type d | fuzzel -dp"cd > ")" || exit; find "$PWD" $findignore -prune -o -print | fuzzel -dp"open > " | xargs -rI{} xdg-open "{}"'
bindsym $mod+shift+space exec cd_open.sh
# autorun ######################################################################

View File

@ -0,0 +1,15 @@
#!/bin/sh
sel="$(find -type d | fuzzel -dp'cd > ')"
[ -n "$sel" ] || exit
[ -d "$sel" ] && cd "$sel" || mkdir -p "$sel" && cd "$sel"
sel="$(find -type f | fuzzel -dp'open > ')"
case $(mimetype -b "$sel") in
text/*|\
application/x-shellscript) exec $TERMINAL "$EDITOR" "$sel";;
*) exec xdg-open "$sel" || exec $TERMINAL "$EDITOR" "$sel";;
esac