Add MangoWM configuration and scripts for window management on scrolling layout
This commit is contained in:
21
mango/scripts/layout-cmd.sh
Normal file
21
mango/scripts/layout-cmd.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
tag_json=$(mmsg get all-tags)
|
||||
symbol=$(printf '%s' "$tag_json" | jq -r '
|
||||
.all_tags[0].tags[] | select(.is_active == true) | .layout
|
||||
' | head -1)
|
||||
|
||||
arg1="$1"
|
||||
target_layout="${arg1%%:*}"
|
||||
|
||||
for arg in "${@:1:$#-1}"; do
|
||||
layout="${arg%%:*}"
|
||||
cmd="${arg#*:}"
|
||||
if [ "$symbol" = "$layout" ]; then
|
||||
eval "$cmd"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
eval "${@: -1}"
|
||||
Reference in New Issue
Block a user