From 27da5ca3e1d640e7b4a84eba277de1b3fa9dd99d Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 19 Apr 2023 21:35:09 +0200 Subject: moved dmpdf to menuscripts --- bin/guiscripts/dmpdf | 25 ------------------------- bin/menuscripts/mpdf | 25 +++++++++++++++++++++++++ config/hyprland/hypr/binds.conf | 4 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) delete mode 100755 bin/guiscripts/dmpdf create mode 100755 bin/menuscripts/mpdf diff --git a/bin/guiscripts/dmpdf b/bin/guiscripts/dmpdf deleted file mode 100755 index d26c841..0000000 --- a/bin/guiscripts/dmpdf +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -if [ "$MENUCMD" = "tofi" ] -then - menucmd="tofi --width 30% --height 30% --matching-algorithm normal --prompt-text pdf:" -elif [ "$MENUCMD" = "dmenu" ] -then - menucmd="dmenu -l 10 -g 1 -x -i -p pdf:" -else - menucmd="fzf" -fi - -tmp="/tmp/dmpdf" -find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > "$tmp" -choice="$(\ - sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' "$tmp" | - awk '{printf "%s %s\n", NR ":", $0}' | - $menucmd | - grep -oE "^[0-9]+:" | - cut -f1 -d:)" -if [ -z "$choice" ]; then - exit -fi -file="$(sed -n "${choice}p" "$tmp")" -zathura "$file" & diff --git a/bin/menuscripts/mpdf b/bin/menuscripts/mpdf new file mode 100755 index 0000000..d26c841 --- /dev/null +++ b/bin/menuscripts/mpdf @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ "$MENUCMD" = "tofi" ] +then + menucmd="tofi --width 30% --height 30% --matching-algorithm normal --prompt-text pdf:" +elif [ "$MENUCMD" = "dmenu" ] +then + menucmd="dmenu -l 10 -g 1 -x -i -p pdf:" +else + menucmd="fzf" +fi + +tmp="/tmp/dmpdf" +find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > "$tmp" +choice="$(\ + sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' "$tmp" | + awk '{printf "%s %s\n", NR ":", $0}' | + $menucmd | + grep -oE "^[0-9]+:" | + cut -f1 -d:)" +if [ -z "$choice" ]; then + exit +fi +file="$(sed -n "${choice}p" "$tmp")" +zathura "$file" & diff --git a/config/hyprland/hypr/binds.conf b/config/hyprland/hypr/binds.conf index cc3ebf9..c93e77d 100644 --- a/config/hyprland/hypr/binds.conf +++ b/config/hyprland/hypr/binds.conf @@ -82,7 +82,7 @@ bind =, H, exec, mhelp bind =, I, exec, mapimg bind =, L, exec, dmlang bind =, M, exec, mpass -bind =, P, exec, dmpdf +bind =, P, exec, mpdf bind =, O, exec, mpower bind =, U, exec, mcurs bind =, V, exec, mvid @@ -96,7 +96,7 @@ bind = $mainMod, H, exec, mhelp bind = $mainMod, I, exec, mapimg bind = $mainMod, L, exec, dmlang bind = $mainMod, M, exec, mpass -bind = $mainMod, P, exec, dmpdf +bind = $mainMod, P, exec, mpdf bind = $mainMod, O, exec, mpower bind = $mainMod, U, exec, mcurs bind = $mainMod, V, exec, mvid -- cgit v1.2.3