From 0f7b4712384ae7edfe2234d56fd085791327b832 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 16 Oct 2023 12:04:29 +0200 Subject: removed mplay --- bin/menuscripts/mplay | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 bin/menuscripts/mplay (limited to 'bin/menuscripts') diff --git a/bin/menuscripts/mplay b/bin/menuscripts/mplay deleted file mode 100755 index e4fca54..0000000 --- a/bin/menuscripts/mplay +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -choice="$(mpc listall | commander -c -l -d -x)" -[ "$choice" ] || exit 1 -mpc insert "$choice" || exit 1 -mpc next 2> /dev/null -mpc play 2> /dev/null -- cgit v1.2.3 From 6d4e211f9b45adf939c6e52fe4811e1385c7e8a2 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 17 Oct 2023 23:19:32 +0200 Subject: renamed mpassgen to mpwgen --- bin/menuscripts/mpassgen | 23 ----------------------- bin/menuscripts/mpwgen | 23 +++++++++++++++++++++++ config/hyprland/hypr/binds.conf | 4 ++-- 3 files changed, 25 insertions(+), 25 deletions(-) delete mode 100755 bin/menuscripts/mpassgen create mode 100755 bin/menuscripts/mpwgen (limited to 'bin/menuscripts') diff --git a/bin/menuscripts/mpassgen b/bin/menuscripts/mpassgen deleted file mode 100755 index 51b9bc4..0000000 --- a/bin/menuscripts/mpassgen +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env sh - -input () { commander -c -i -p "$1"; } - -choice="$(printf "multiline\nsingle\n" | commander -c -d)" -[ "$choice" ] || exit 1 - -password="$(input "name:")" -[ "$password" ] || exit 1 - -if [ "$choice" = "multiline" ] -then - login="$(find "${PASSWORD_STORE_DIR:=$HOME/.password-store}"/e-mails -type f -maxdepth 1 -iname "*.gpg" -printf "%f\n" | - sed 's/\.gpg$//' | commander -c -d -p 'login:')" - [ "$login" ] || exit 1 - url="$(input "url:")" - [ "$url" ] || exit 1 - printf "%s\nlogin: %s\nurl: %s\n" "${password}" "${login}" "${url}" | - pass insert -mf "${password}" - pass generate -ci "${password}" -else - pass generate -cf "${password}" -fi diff --git a/bin/menuscripts/mpwgen b/bin/menuscripts/mpwgen new file mode 100755 index 0000000..51b9bc4 --- /dev/null +++ b/bin/menuscripts/mpwgen @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +input () { commander -c -i -p "$1"; } + +choice="$(printf "multiline\nsingle\n" | commander -c -d)" +[ "$choice" ] || exit 1 + +password="$(input "name:")" +[ "$password" ] || exit 1 + +if [ "$choice" = "multiline" ] +then + login="$(find "${PASSWORD_STORE_DIR:=$HOME/.password-store}"/e-mails -type f -maxdepth 1 -iname "*.gpg" -printf "%f\n" | + sed 's/\.gpg$//' | commander -c -d -p 'login:')" + [ "$login" ] || exit 1 + url="$(input "url:")" + [ "$url" ] || exit 1 + printf "%s\nlogin: %s\nurl: %s\n" "${password}" "${login}" "${url}" | + pass insert -mf "${password}" + pass generate -ci "${password}" +else + pass generate -cf "${password}" +fi diff --git a/config/hyprland/hypr/binds.conf b/config/hyprland/hypr/binds.conf index 406c7ba..75b0d14 100644 --- a/config/hyprland/hypr/binds.conf +++ b/config/hyprland/hypr/binds.conf @@ -103,8 +103,8 @@ bind = $mainMod, E, exec, memoji bind =, E, exec, memoji bind = $mainMod, F, exec, dmfm bind =, F, exec, dmfm -bind = $mainMod, G, exec, mpassgen -bind =, G, exec, mpassgen +bind = $mainMod, G, exec, mpwgen +bind =, G, exec, mpwgen bind = $mainMod, H, exec, mhelp bind =, H, exec, mhelp bind = $mainMod, I, exec, mapimg -- cgit v1.2.3 From 067b07eb24262b34c00fe7be786cbdcfcd6383c6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 19 Oct 2023 11:22:31 +0200 Subject: refactor --- bin/guiscripts/dmfm | 28 +++++++++++++++------------- bin/menuscripts/mhelp | 6 +++--- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'bin/menuscripts') diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm index 969c111..d1dd8b8 100755 --- a/bin/guiscripts/dmfm +++ b/bin/guiscripts/dmfm @@ -1,17 +1,19 @@ #!/bin/sh -file=1 -while [ "$file" ]; do - file=$(ls -1 --group-directories-first | dmenu -i -l 8 -g 1 -p "$(basename $(pwd)):") - if [ -e "$file" ]; then - owd=$(pwd) - if [ -d "$file" ]; then - cd "$file" - else [ -f "$file" ] - if which xdg-open &> /dev/null; then - exec xdg-open "$owd/$file" & - unset file - fi - fi +while true +do + file=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' | + sort -k 1 -k 2 | cut -f 2- | + commander -xcd -p "$PWD>") + + [ "$file" ] || break + [ ! -e "$file" ] && continue + + if [ -d "$file" ] + then + cd "$file" || continue + else + setsid xdg-open "$PWD/$file" & fi + done diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index 339d6bf..cb7977b 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,16 +1,16 @@ #!/usr/bin/env sh -program="$(commander -r -c -d)" +program="$(commander -rcd)" [ "$program" ] || exit 1 option="$("$program" --help | # Parse options - grep "^ *-[-a-zA-Z0-9]* " | + grep -- "^ *-[-a-zA-Z0-9]* " | tr -s ' ' | sort | uniq | column -l 2 -t | - commander -l -x -c -d | + commander -lxcd | awk '{print $1}')" [ "$option" ] || exit 1 -- cgit v1.2.3