AutoYADM commit: 2025-01-22 13:45:06
This commit is contained in:
parent
e0a4daea1f
commit
5e452a1408
1 changed files with 151 additions and 128 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
WL_PRESENT_DMENU="tofi"
|
||||
usage() {
|
||||
echo "usage: wl-present [options] <command> [argument]"
|
||||
echo
|
||||
|
@ -80,7 +80,11 @@ pipectl-shim() {
|
|||
opt="$1"
|
||||
shift
|
||||
case "$opt" in
|
||||
-n|--name) arg="$1"; shift; PIPENAME="pipectl.$(id -u).$arg.pipe";;
|
||||
-n | --name)
|
||||
arg="$1"
|
||||
shift
|
||||
PIPENAME="pipectl.$(id -u).$arg.pipe"
|
||||
;;
|
||||
-i | --in) MODE=in ;;
|
||||
-o | --out) MODE=out ;;
|
||||
-f | --force) FORCE=1 ;;
|
||||
|
@ -102,7 +106,13 @@ pipectl-shim() {
|
|||
return 1
|
||||
else
|
||||
[[ "$FORCE" -eq 1 ]] && rm -f "$PIPE"
|
||||
mkfifo "$PIPE"; (tail -f "$PIPE" & echo > "$PIPE"; wait); rm -f "$PIPE"
|
||||
mkfifo "$PIPE"
|
||||
(
|
||||
tail -f "$PIPE" &
|
||||
echo >"$PIPE"
|
||||
wait
|
||||
)
|
||||
rm -f "$PIPE"
|
||||
fi ;;
|
||||
esac
|
||||
}
|
||||
|
@ -170,7 +180,13 @@ ask-output-or-region() {
|
|||
}
|
||||
|
||||
ask-scaling() {
|
||||
(echo fit; echo cover; echo exact; echo linear; echo nearest) | $DMENU -p "wl-present scaling"
|
||||
(
|
||||
echo fit
|
||||
echo cover
|
||||
echo exact
|
||||
echo linear
|
||||
echo nearest
|
||||
) | $DMENU -p "wl-present scaling"
|
||||
[[ $? -ne 0 ]] && exit 1
|
||||
}
|
||||
|
||||
|
@ -206,7 +222,11 @@ while [[ $# -gt 0 && "${1:0:1}" == "-" ]]; do
|
|||
opt="$1"
|
||||
shift
|
||||
case "$opt" in
|
||||
-n|--name) arg="$1"; shift; PRESENT_PIPE_NAME="$arg";;
|
||||
-n | --name)
|
||||
arg="$1"
|
||||
shift
|
||||
PRESENT_PIPE_NAME="$arg"
|
||||
;;
|
||||
-h | --help) usage ;;
|
||||
--) break ;;
|
||||
esac
|
||||
|
@ -218,7 +238,10 @@ fi
|
|||
|
||||
case "$1" in
|
||||
help) usage ;;
|
||||
mirror) shift; mirror "$@";;
|
||||
mirror)
|
||||
shift
|
||||
mirror "$@"
|
||||
;;
|
||||
set-output) set-output "${2:-$(ask-output)}" ;;
|
||||
set-region) set-region "${2:-$(ask-region)}" ;;
|
||||
unset-region | no-region) mirror-cmd --no-region ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue