From 7d9be0f7a4a9aabf72e9032a36bc93581a5febe2 Mon Sep 17 00:00:00 2001 From: Nick Boughton Date: Wed, 25 Nov 2020 01:07:22 +0000 Subject: [PATCH] keybinding for floating ranger window --- ranger/scope.sh | 28 ++++++++++++++-------------- sway/config | 2 ++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ranger/scope.sh b/ranger/scope.sh index f403ed8..947b0fd 100755 --- a/ranger/scope.sh +++ b/ranger/scope.sh @@ -128,9 +128,9 @@ handle_image() { local mimetype="${1}" case "${mimetype}" in ## SVG - # image/svg+xml|image/svg) - # convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6 - # exit 1;; + image/svg+xml|image/svg) + convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6 + exit 1;; ## DjVu # image/vnd.djvu) @@ -154,20 +154,20 @@ handle_image() { exit 7;; ## Video - # video/*) - # # Thumbnail - # ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6 - # exit 1;; + # video/*) + # # Thumbnail + # ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6 + # exit 1;; ## PDF # application/pdf) - # pdftoppm -f 1 -l 1 \ - # -scale-to-x "${DEFAULT_SIZE%x*}" \ - # -scale-to-y -1 \ - # -singlefile \ - # -jpeg -tiffcompression jpeg \ - # -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \ - # && exit 6 || exit 1;; + # pdftoppm -f 1 -l 1 \ + # -scale-to-x "${DEFAULT_SIZE%x*}" \ + # -scale-to-y -1 \ + # -singlefile \ + # -jpeg -tiffcompression jpeg \ + # -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \ + # && exit 6 || exit 1;; ## ePub, MOBI, FB2 (using Calibre) diff --git a/sway/config b/sway/config index 0ca159b..3ab35f2 100644 --- a/sway/config +++ b/sway/config @@ -63,6 +63,7 @@ for_window [app_id=zoom] floating enable for_window [app_id=pcmanfm] floating enable for_window [app_id=pavucontrol] floating enable for_window [app_id=ristretto] floating enable +for_window [app_id=ranger] floating enable for_window [app_id=".*"] border pixel ### Key bindings @@ -84,6 +85,7 @@ for_window [app_id=".*"] border pixel # desktop search bindsym $mod+c exec catfish + bindsym $mod+Ctrl+r exec alacritty --class ranger -e ranger # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. # Despite the name, also works for non-floating windows.