mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
feat(cli): add home workspace option and lower default gap to 10
This commit is contained in:
1 parent
d8f5d10f05
commit
0c664cd298
3 files changed
+11
-6
No files matched your search
@@ -27,7 +27,7 @@ esac
|
|||||||
FRACTION=0.3
|
FRACTION=0.3
|
||||||
# Matches general:gaps_out so the window lines up with tiled neighbours and
|
# Matches general:gaps_out so the window lines up with tiled neighbours and
|
||||||
# its border stays on screen.
|
# its border stays on screen.
|
||||||
GAP=16
|
GAP=10
|
||||||
|
|
||||||
# Lua dispatcher first, classic name as the pre-lua fallback (same shape as
|
# Lua dispatcher first, classic name as the pre-lua fallback (same shape as
|
||||||
# the other omarchy-* scripts here).
|
# the other omarchy-* scripts here).
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ GROUPED=$(jq -r '(.grouped // []) | length' <<<"$ACTIVE")
|
|||||||
# omarchy-pip). h/j/k/l read clockwise from the bottom left: l bottom-left,
|
# omarchy-pip). h/j/k/l read clockwise from the bottom left: l bottom-left,
|
||||||
# d top-left, u top-right, r bottom-right.
|
# d top-left, u top-right, r bottom-right.
|
||||||
if [[ $(jq -r '.floating' <<<"$ACTIVE") == true ]]; then
|
if [[ $(jq -r '.floating' <<<"$ACTIVE") == true ]]; then
|
||||||
GAP=16
|
GAP=10
|
||||||
read -r WIN_W WIN_H MON_ID < <(jq -r '"\(.size[0]) \(.size[1]) \(.monitor)"' <<<"$ACTIVE")
|
read -r WIN_W WIN_H MON_ID < <(jq -r '"\(.size[0]) \(.size[1]) \(.monitor)"' <<<"$ACTIVE")
|
||||||
read -r MON_X MON_Y MON_W MON_H RES_L RES_T RES_R RES_B < <(hyprctl monitors -j | jq -r --argjson id "$MON_ID" \
|
read -r MON_X MON_Y MON_W MON_H RES_L RES_T RES_R RES_B < <(hyprctl monitors -j | jq -r --argjson id "$MON_ID" \
|
||||||
'.[] | select(.id == $id) | "\(.x) \(.y) \(((.width / .scale) | floor)) \(((.height / .scale) | floor)) \(.reserved | join(" "))"')
|
'.[] | select(.id == $id) | "\(.x) \(.y) \(((.width / .scale) | floor)) \(((.height / .scale) | floor)) \(.reserved | join(" "))"')
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# omarchy:summary=Toggle a scratch workspace (scratchpad, claude, fastmail, beeper), starting its resident apps when any is missing.
|
# omarchy:summary=Toggle a scratch workspace (scratchpad, claude, fastmail, beeper, home), starting its resident apps when any is missing.
|
||||||
|
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
# Usage: omarchy-toggle-scratch [scratchpad|claude|fastmail|beeper]
|
# Usage: omarchy-toggle-scratch [scratchpad|claude|fastmail|beeper|home]
|
||||||
#
|
#
|
||||||
# Each profile is a special workspace, the monitor it opens on, and its
|
# Each profile is a special workspace, the monitor it opens on, and its
|
||||||
# resident apps (class pattern -> launch command; the pattern is an anchored
|
# resident apps (class pattern -> launch command; the pattern is an anchored
|
||||||
@@ -39,8 +39,12 @@ beeper)
|
|||||||
NAME="beeper"
|
NAME="beeper"
|
||||||
MEMBERS=("Beeper|gtk-launch beeper")
|
MEMBERS=("Beeper|gtk-launch beeper")
|
||||||
;;
|
;;
|
||||||
|
home)
|
||||||
|
NAME="home"
|
||||||
|
MEMBERS=("brave-home\.google\.com__.*|gtk-launch 'Google Home'")
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "usage: ${0##*/} [scratchpad|claude|fastmail|beeper]" >&2
|
echo "usage: ${0##*/} [scratchpad|claude|fastmail|beeper|home]" >&2
|
||||||
exit 2
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -99,7 +103,8 @@ launched=0
|
|||||||
for member in "${MEMBERS[@]}"; do
|
for member in "${MEMBERS[@]}"; do
|
||||||
pattern=${member%%|*}
|
pattern=${member%%|*}
|
||||||
grep -qE "^(${pattern})$" <<<"$present" && continue
|
grep -qE "^(${pattern})$" <<<"$present" && continue
|
||||||
setsid uwsm-app -- ${member#*|} >/dev/null 2>&1 &
|
# eval so a launch command can quote a desktop id with spaces.
|
||||||
|
eval "setsid uwsm-app -- ${member#*|}" >/dev/null 2>&1 &
|
||||||
launched=1
|
launched=1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user