This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/os/linux/kanshi/desktop-H-workspaces.sh

20 lines
616 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# kanshi will potentially run this more than once
LOCKFILE="/tmp/lytedev-kanshi-workspace-arranging.lock"
2021-05-13 10:42:19 -05:00
[[ -f $LOCKFILE ]] && { echo "Already locked: $LOCKFILE" >&2; exit 1; }
2021-05-13 10:42:19 -05:00
touch "$LOCKFILE"
sleep 0.1
2021-05-13 10:42:19 -05:00
move_workspace() { swaymsg workspace "$1"; swaymsg move workspace to "'$2'"; }
setup_output() { out="$1"; shift; while (($#)); do move_workspace "$1" "$out"; shift; done; }
2021-05-13 10:42:19 -05:00
set -x
2021-09-24 13:06:43 -05:00
setup_output 'Dell Inc. DELL U2720Q CWTM623' 9
setup_output 'Dell Inc. DELL U2720Q D3TM623' 8
setup_output 'Samsung Electric Company CF791 HTRJ500315' 2 3 4 5 6 7 1
2021-05-13 10:42:19 -05:00
rm "$LOCKFILE"