summary refs log tree commit diff
path: root/.config/river/mklayout.sh
blob: a6151cdafe056ad5370ee81dc74e3e852b4f7381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -eu

case "${1:-}" in
reset)
	riverctl send-layout-cmd rivertile "main-ratio 0.66"
	riverctl send-layout-cmd rivertile "main-count 1"
	riverctl send-layout-cmd rivertile "main-location left"
	;;
dev)
	workspace=$(
		zoxide query -l |
			xargs zenity \
				--title 'river-mklayout' \
				--text 'Select a workspace to enter into' \
				--list \
				--column 1
	)
	# spawn 3 terminals in the workspace
	riverctl spawn "foot -D $workspace"
	riverctl spawn "foot -D $workspace"
	riverctl spawn "foot -D $workspace"
	# terminate the terminal that ran mklayout (if any)
	test -t 0 && riverctl close
	;;
*)
	exit 1
	;;
esac