Added some basic mangowm configuration.

This commit is contained in:
Johannes Findeisen 2026-11-19 18:36:16 +01:00
commit 8ecd3e9447
16 changed files with 1532 additions and 0 deletions

View file

@ -0,0 +1,14 @@
#!/bin/bash
set -x
dir=${1:-next}
f=/tmp/mango-layout-idx
idx=0
[[ -f $f ]] && idx=$(<$f)
layouts=(tile scroller monocle grid deck center_tile vertical_tile right_tile vertical_scroller vertical_grid vertical_deck dwindle fair vertical_fair)
if [[ "$dir" == "prev" ]]; then
idx=$(( (idx - 1 + ${#layouts[@]}) % ${#layouts[@]} ))
else
idx=$(( (idx + 1) % ${#layouts[@]} ))
fi
mmsg dispatch setlayout,${layouts[$idx]} && echo "$idx" > "$f"

View file

@ -0,0 +1,11 @@
#!/bin/bash
monitors=($(mmsg get all-monitors | jq -r '.monitors[].name'))
total=${#monitors[@]}
[[ $total -le 1 ]] && exit 0
cur=$(mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .name')
idx=0
for i in "${!monitors[@]}"; do
[[ "${monitors[$i]}" == "$cur" ]] && idx=$i && break
done
idx=$(( (idx + 1) % total ))
mmsg dispatch focusmon,"${monitors[$idx]}"

View file

@ -0,0 +1,11 @@
#!/bin/bash
monitors=($(mmsg get all-monitors | jq -r '.monitors[].name'))
total=${#monitors[@]}
[[ $total -le 1 ]] && exit 0
cur=$(mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .name')
idx=0
for i in "${!monitors[@]}"; do
[[ "${monitors[$i]}" == "$cur" ]] && idx=$i && break
done
idx=$(( (idx + 1) % total ))
mmsg dispatch tagmon,"${monitors[$idx]}"

View file

@ -0,0 +1,20 @@
#!/bin/bash
usage() {
echo "Usage: $(basename "$0") {prev|next}"
exit 1
}
[ $# -eq 1 ] || usage
case "$1" in
prev)
mmsg dispatch tagtoleft
;;
next)
mmsg dispatch tagtoright
;;
*)
usage
;;
esac

View file

@ -0,0 +1,2 @@
#!/bin/sh
grim - | wl-copy

View file

@ -0,0 +1,5 @@
#!/bin/sh
grim -g "$(slurp)" - | wl-copy

4
.config/mango/scripts/vol Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
# Adjust volume via pipewire/pulseaudio
delta=${1:-+5}
pactl set-sink-volume @DEFAULT_SINK@ "$delta"%