nixos/home-manager/modules/eww/config/scripts/change-active-workspace
Nickolaj Jepsen d68c699a7a test
2024-08-28 16:08:36 +00:00

21 lines
No EOL
402 B
Bash
Executable file

#! /bin/bash
function clamp {
min=$1
max=$2
val=$3
python -c "print(max($min, min($val, $max)))"
}
direction=$1
current=$2
if test "$direction" = "down"
then
target=$(clamp 1 10 $(($current+1)))
echo "jumping to $target"
hyprctl dispatch workspace $target
elif test "$direction" = "up"
then
target=$(clamp 1 10 $(($current-1)))
echo "jumping to $target"
hyprctl dispatch workspace $target
fi