nichts/nyx/homes/notashelf/services/wayland/ags/bin/open_window

24 lines
468 B
Text
Raw Normal View History

2024-04-09 23:11:33 +02:00
#!/usr/bin/env bash
# vim: syntax=bash
open_window() {
local position="$1"
local size="$2"
local command="$3"
# Validate input
if [[ -z "$position" || -z "$size" || -z "$command" ]]; then
echo "Error: Position, size, and command are required." 1>&2
exit 1
fi
hyprctl dispatch exec "[float; move ${position//,/ }; size ${size//x/ }] $command"
}
if [[ $# -ne 3 ]]; then
echo "Usage: $0 <position> <size> <command>"
exit 1
fi
open_window "$1" "$2" "$3"