From dfbd109c6e7c2dacdc7933fa0cfe9b27b37b6663 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 22 Feb 2024 16:46:38 +0100 Subject: [PATCH] zathura: correctly read in $FILE in keybindings and add movepdf --- .config/zathura/zathurarc | 3 ++- .local/bin/tools/movepdf | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 .local/bin/tools/movepdf diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc index de4c067..80e40f3 100644 --- a/.config/zathura/zathurarc +++ b/.config/zathura/zathurarc @@ -14,4 +14,5 @@ map i recolor map p print map g goto top map exec zathura_backward_search.sh -map exec openfilebrowser $FILE +map exec "openfilebrowser $FILE" +map exec "movepdf $FILE" diff --git a/.local/bin/tools/movepdf b/.local/bin/tools/movepdf new file mode 100755 index 0000000..94bcc02 --- /dev/null +++ b/.local/bin/tools/movepdf @@ -0,0 +1,9 @@ +#!/bin/sh +file="$1" +dest="$(find "$HOME" -maxdepth 5 -type d -not -path "$HOME/.*" | dmenu -i -p 'move to folder:')" +if ! [ -d "$dest" ]; then + mkdir -p "$dest" +fi +echo $dest +echo $file +mv "$file" "$dest"