solorice/config/HybridBar/scripts/change-active-workspace
Kristofers Solo 5f54bb78ad Update 2025-02-24
Update 2025-02-03

Update 2025-02-04

Update 2025-02-09

Update 2025-02-14

Update 2025-02-15

Update 2025-02-22

Update 2025-02-24
2025-04-16 13:46:48 +03:00

22 lines
402 B
Bash

#!/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