summary refs log tree commit diff
path: root/bin/dskm
blob: c5a0abfa3e9386f5ae71e06a2719be81107b0be8 (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
#!/bin/bash
set -eu

# shellcheck disable=2034
description="desk height manager"

export FUZL_PROMPT=dskm
export FUZL_ICON=󱈹
. libfuzl.sh

main() {
	local pos

	pos=$(
		idesk config |
			awk '/positions:/{ok=1; next} ok==1{print gensub(":", "", "g", $1)}' |
			fuzl_menu $FUZL_MENU_FILTER
	)
	test -n "$pos" || return

	fuzl_loading "moving desk to position: $pos"
	idesk "$pos"
	fuzl_loading_cancel
}

main