mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-23 05:09:32 -08:00
22 lines
403 B
Text
22 lines
403 B
Text
|
#! /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
|