summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-19 21:34:45 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-19 21:34:45 +0200
commitb1ef4dd05c424b196135ec767b4ac987112edae6 (patch)
treed102ab2ce150e6ff3f4af1ff48657dea805152ed /bin
parent471773d660e01ad928a9899ecf18081775268645 (diff)
parent5acc9f0cd80141e74b35601e69fc59e5a50b225f (diff)
M.erge branch 'main' of db:dotfiles
Diffstat (limited to 'bin')
-rwxr-xr-xbin/guiscripts/dmhelp26
-rwxr-xr-xbin/guiscripts/locker4
-rwxr-xr-xbin/menuscripts/mhelp32
-rwxr-xr-xbin/menuscripts/mplay2
4 files changed, 36 insertions, 28 deletions
diff --git a/bin/guiscripts/dmhelp b/bin/guiscripts/dmhelp
deleted file mode 100755
index 6199c21..0000000
--- a/bin/guiscripts/dmhelp
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env sh
-program="${1:-$(dmenu_path | dmenu -l 4 -g 5)}"
-opfil="/tmp/dmh_options.txt"
-test -z "${program}" && exit 1
-
-if ${program} --help > "${opfil}"
-then
- option="$(\
- grep -E "^ *-[-a-Z]* " "${opfil}" \
- | tr -s ' ' \
- | sort | uniq \
- | column -l 2 -t \
- | dmenu -x -l 20 -g 1 -p "${program}" \
- | awk '{print $1}' \
- )"
-elif man $program > "${opfil}"
-then
- echo lesgo
-else
- echo "No options found for '${program}'" > /dev/stderr
- exit 1
-fi
-test -z "${option}" && exit 1
-
-rm -f "${opfil}"
-${program} ${option}
diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker
index 90a1ab5..0070a86 100755
--- a/bin/guiscripts/locker
+++ b/bin/guiscripts/locker
@@ -1,6 +1,8 @@
#!/bin/sh
+which swaylock convert grim > /dev/null ||
+ exit 1
umask 077
file=/tmp/bg.png
-grim - > $file
+grim -l 0 - > $file
convert -resize 10% -resize 1000% $file $file
swaylock -i $file
diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp
new file mode 100755
index 0000000..a9027ef
--- /dev/null
+++ b/bin/menuscripts/mhelp
@@ -0,0 +1,32 @@
+#!/usr/bin/env sh
+OPTIONS="/tmp/dmh_options.txt"
+
+if [ "$MENUCMD" = "tofi" ]
+then
+ program="$(tofi-run --prompt-text "program: ")"
+ menucmd="tofi --width 50% --height 30% --matching-algorithm normal --prompt-text $program:"
+elif [ "$MENUCMD" = "dmenu" ]
+then
+ program="$(dmenu_path | dmenu -l 4 -g 5 -p "program:")"
+ menucmd="dmenu -l 20 -g 1 -x -i -p $program:"
+else
+ program="$(dmenu_path | fzf)"
+ menucmd="fzf"
+fi
+
+test -z "${program}" && exit 1
+
+if $program --help > "$OPTIONS"
+then
+ option="$(grep -E "^ *-[-a-Z]* " "$OPTIONS" |
+ tr -s ' ' |
+ sort |
+ uniq |
+ column -l 2 -t |
+ $menucmd |
+ awk '{print $1}')"
+
+test -z "$option" && exit 1
+
+rm -f "$OPTIONS"
+setsid $program $option
diff --git a/bin/menuscripts/mplay b/bin/menuscripts/mplay
index 4c991fa..08fcc46 100755
--- a/bin/menuscripts/mplay
+++ b/bin/menuscripts/mplay
@@ -2,7 +2,7 @@
# menu select long
if [ "$MENUCMD" = "tofi" ]
then
- menucmd="tofi --width 50% --height 30%"
+ menucmd="tofi --width 50% --height 30% --matching-algorithm normal"
elif [ "$MENUCMD" = "dmenu" ]
then
menucmd="dmenu -l 10 -g 1 -x -i"