Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion install/hardware/apple/fix-t2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
if lspci -nn | grep "106b:180[12]" >/dev/null; then
echo "Detected MacBook with T2 chip. Installing support items..."

# apple-bcm-firmware-fetcher reads its firmware off an on-disk macOS volume —
# Wi-Fi firmware for T2 Macs is only legally obtainable from there. A
# single-boot install that wiped macOS has no such volume, so the fetch comes
# up empty; those machines need the firmware supplied from a macOS copy or a
# downloaded recovery image instead.
omarchy-pkg-add \
linux-t2 \
linux-t2-headers \
apple-t2-audio-config \
apple-bcm-firmware \
apple-bcm-firmware-fetcher \
t2fanrd

# Enable T2 fan control
Expand Down
2 changes: 1 addition & 1 deletion install/omarchy-other.packages
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dell-xps13-sidecar-amps
lsp-plugins-lv2

# T2 MacBook support packages
apple-bcm-firmware
apple-bcm-firmware-fetcher
apple-t2-audio-config
linux-t2
linux-t2-headers
Expand Down
2 changes: 1 addition & 1 deletion manual/04-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You can then hit `Super + J` to stack them on top of each other instead of side

Hit `Super + J` again to return them to their side-by-side positions. Then try `Super + Shift + Arrow Right` while on the browser to swap the windows.

Now try `Super + Ctrl + T` to start the Activity monitor. That'll appears as a floating window. You can tile it using `Super + T` (and hit that again to make it floating again). Now press `Super + Shift + F` to open the files manager. You'll have a neat four-way setup:
Now try `Super + Ctrl + T` to start the Activity monitor. That'll appear as a floating window. You can tile it using `Super + T` (and hit that again to make it floating again). Now press `Super + Shift + F` to open the files manager. You'll have a neat four-way setup:

![navigation-fourway-tiling](images/navigation-fourway-tiling.webp)

Expand Down
33 changes: 21 additions & 12 deletions shell/plugins/clipboard/capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,31 @@ STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy"
IMAGE_DIR="$STATE_DIR/clipboard-images"
mkdir -p "$IMAGE_DIR"

types=$(wl-paste --list-types 2>/dev/null || true)
types=$(timeout 2s wl-paste --list-types 2>/dev/null || true)

if [[ ${CLIPBOARD_STATE:-} == "sensitive" ]] || grep -qx 'x-kde-passwordManagerHint' <<<"$types"; then
exit 0
fi

tmp=
trap 'rm -f -- "$tmp"' EXIT

# The clipboard owner streams the copy and can stall without closing its end, so
# every read is bounded, and a copy cut off at the deadline is dropped, not kept.
read_copy() {
timeout 2s "$@" >"$tmp" 2>/dev/null && [[ -s $tmp ]]
}

emit_image() {
local mime="$1"
local ext tmp hash file
local ext hash file
shift

ext=${mime#image/}
[[ $ext == jpeg ]] && ext=jpg

tmp=$(mktemp --tmpdir="$IMAGE_DIR" clipboard.XXXXXX) || return 0
cat >"$tmp"
if [[ ! -s $tmp ]]; then
rm -f "$tmp"
return 0
fi
read_copy "$@" || return

hash=$(sha256sum "$tmp" | awk '{print $1}')
file="$IMAGE_DIR/$hash.$ext"
Expand All @@ -43,6 +49,9 @@ emit_image() {
}

emit_text() {
tmp=$(mktemp --tmpdir="$STATE_DIR" clipboard.XXXXXX) || return 0
read_copy "$@" || return

perl -MEncode=decode,FB_CROAK,LEAVE_SRC -MJSON::PP=encode_json -0777 -e '
my $raw = <STDIN>;
exit unless length $raw;
Expand Down Expand Up @@ -86,21 +95,21 @@ emit_text() {
}
$text = decode("UTF-8", $raw) unless defined $text;
print "{\"type\":\"text\",\"text\":", encode_json($text), "}\n";
'
' <"$tmp"
}

case "${1:-}" in
text) emit_text; exit 0 ;;
image/*) emit_image "$1"; exit 0 ;;
text) emit_text cat; exit 0 ;;
image/*) emit_image "$1" cat; exit 0 ;;
esac

for mime in image/png image/jpeg image/webp image/gif image/bmp image/tiff; do
if grep -qx "$mime" <<<"$types"; then
timeout 2s wl-paste --type "$mime" 2>/dev/null | emit_image "$mime"
emit_image "$mime" wl-paste --type "$mime"
exit 0
fi
done

if grep -q '^text/' <<<"$types" || grep -qx 'UTF8_STRING' <<<"$types" || grep -qx 'STRING' <<<"$types"; then
wl-paste --type text --no-newline 2>/dev/null | emit_text
emit_text wl-paste --type text --no-newline
fi
18 changes: 11 additions & 7 deletions shell/plugins/panels/elsewhen/CityRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Rectangle {
}
}
]
z: dragged ? 2 : 0
z: dragged ? 2 : lit ? 1 : 0
opacity: dragged ? 0.9 : 1
Behavior on opacity { NumberAnimation { duration: Style.duration(120) } }

Expand Down Expand Up @@ -291,18 +291,22 @@ Rectangle {

// The last city stays; removing it would leave no way back.
PanelActionButton {
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: Style.space(1)
id: removeButton
anchors.horizontalCenter: parent.right
anchors.horizontalCenterOffset: -Style.space(22) * 5 / 24
anchors.verticalCenter: parent.top
size: fontSize + (Style.space(22) - fontSize) * 0.85
radius: size / 2
color: Model.mix(Color.popups.background, row.foreground, _hot ? 0.24 : 0.14)
borderSpec: Border.flat(Model.mix(Color.popups.background, row.foreground, _hot ? 0.65 : 0.35), Style.space(1))
iconText: "\u00d7"
tooltipText: "Remove"
foreground: row.fainter
foreground: row.dim
hoverColor: row.foreground
fontFamily: row.fontFamily
fontSize: Style.font.bodySmall
enabled: row.removable
// Shown on the keyboard's pick too, so Delete's target is plain.
opacity: row.removable && row.lit ? 1 : 0
opacity: row.removable && (rowHover.hovered || removeButton._hot) ? 1 : 0
visible: opacity > 0
Behavior on opacity { NumberAnimation { duration: Style.duration(120) } }
onClicked: row.panel.removeCityAt(row.index)
Expand Down
9 changes: 7 additions & 2 deletions shell/plugins/panels/elsewhen/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ Panel {
Flickable {
id: scroller
anchors.fill: parent
anchors.rightMargin: -Style.space(12)
clip: true
interactive: false
contentWidth: width
Expand Down Expand Up @@ -821,7 +822,7 @@ Panel {

Column {
id: content
width: scroller.width
width: scroller.width - Style.space(12)
spacing: Style.spacing.panelGap

HeroTitle {
Expand Down Expand Up @@ -857,11 +858,15 @@ Panel {
// Clipped, so knocked rows fall out of the panel.
Item {
anchors.fill: parent
// Let circular actions straddle the rows' top-right corners.
anchors.topMargin: -Style.space(12)
anchors.rightMargin: -Style.space(12)
clip: true

Column {
id: listWrap
width: parent.width
y: Style.space(12)
width: stage.width
spacing: Style.spacing.panelGap

Column {
Expand Down
52 changes: 52 additions & 0 deletions test/shell.d/clipboard-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,14 @@ SH
cat >"$TMPDIR/bin/wl-paste" <<'SH'
#!/bin/bash
if [[ $1 == "--list-types" ]]; then
[[ ${WL_PASTE_STALL:-} == "list-types" ]] && sleep 10
printf '%b' "${WL_PASTE_TYPES:-text/plain\n}"
elif [[ $1 == "--type" && $2 == "text" ]]; then
[[ ${WL_PASTE_STALL:-} == "text" ]] && sleep 10
if [[ ${WL_PASTE_STALL:-} == "text-midway" ]]; then
printf 'first half '
sleep 10
fi
printf '%s' "${WL_PASTE_TEXT:-terminal copy}"
fi
SH
Expand Down Expand Up @@ -292,6 +298,52 @@ capture_output=$(printf 'closing app copy' | WL_PASTE_TEXT="stale read" XDG_RUNT
[[ $capture_output == '{"type":"text","text":"closing app copy"}' ]] || fail "clipboard capture records watched text from stdin"
pass "clipboard capture records watched text from stdin"

if capture_output=$(printf 'watched copy after stalled types' | WL_PASTE_STALL="list-types" XDG_RUNTIME_DIR="$TMPDIR" XDG_STATE_HOME="$TMPDIR/state" PATH="$TMPDIR/bin:$PATH" timeout --preserve-status 4s "$ROOT/shell/plugins/clipboard/capture.sh" text); then
capture_status=0
else
capture_status=$?
fi
[[ $capture_status -eq 0 ]] || fail "clipboard watched text survives a stalled type query" "capture exited with status $capture_status"
[[ $capture_output == '{"type":"text","text":"watched copy after stalled types"}' ]] || fail "clipboard watched text remains intact after a stalled type query"
pass "clipboard watched text survives a stalled type query"
pass "clipboard watched text remains intact after a stalled type query"

if capture_output=$(WL_PASTE_STALL="text" XDG_RUNTIME_DIR="$TMPDIR" XDG_STATE_HOME="$TMPDIR/state" PATH="$TMPDIR/bin:$PATH" timeout --preserve-status 4s "$ROOT/shell/plugins/clipboard/capture.sh"); then
capture_status=0
else
capture_status=$?
fi
[[ $capture_status -eq 124 ]] || fail "clipboard snapshot text read uses its internal timeout" "capture exited with status $capture_status"
[[ -z $capture_output ]] || fail "clipboard snapshot timeout emits no partial entry" "actual: $capture_output"
pass "clipboard snapshot text read uses its internal timeout"
pass "clipboard snapshot timeout emits no partial entry"

if capture_output=$(WL_PASTE_STALL="text-midway" XDG_RUNTIME_DIR="$TMPDIR" XDG_STATE_HOME="$TMPDIR/state" PATH="$TMPDIR/bin:$PATH" timeout --preserve-status 4s "$ROOT/shell/plugins/clipboard/capture.sh"); then
capture_status=0
else
capture_status=$?
fi
[[ $capture_status -eq 124 ]] || fail "clipboard snapshot text read stalled midway uses its internal timeout" "capture exited with status $capture_status"
[[ -z $capture_output ]] || fail "clipboard snapshot stalled midway emits no partial entry" "actual: $capture_output"
pass "clipboard snapshot text read stalled midway uses its internal timeout"
pass "clipboard snapshot stalled midway emits no partial entry"

for watched_mime in text image/png; do
if capture_output=$({ printf 'copy whose owner never closes'; sleep 5; } | XDG_RUNTIME_DIR="$TMPDIR" XDG_STATE_HOME="$TMPDIR/state" PATH="$TMPDIR/bin:$PATH" timeout --preserve-status 4s "$ROOT/shell/plugins/clipboard/capture.sh" "$watched_mime"); then
capture_status=0
else
capture_status=$?
fi
[[ $capture_status -eq 0 ]] || fail "clipboard watched $watched_mime read is bounded when the owner stalls" "capture exited with status $capture_status"
[[ -z $capture_output ]] || fail "clipboard watched $watched_mime cut off by a stalled owner emits no entry" "actual: $capture_output"
pass "clipboard watched $watched_mime read is bounded when the owner stalls"
pass "clipboard watched $watched_mime cut off by a stalled owner emits no entry"
done

leftover=$(find "$TMPDIR/state/omarchy" -name 'clipboard.*' -print)
[[ -z $leftover ]] || fail "clipboard capture removes copies it dropped" "left: $leftover"
pass "clipboard capture removes copies it dropped"

capture_output=$(printf '%s' 'UTF-16 clipboard - fixed' | iconv -f UTF-8 -t UTF-16LE | XDG_RUNTIME_DIR="$TMPDIR" XDG_STATE_HOME="$TMPDIR/state" PATH="$TMPDIR/bin:$PATH" "$ROOT/shell/plugins/clipboard/capture.sh" text)
[[ $capture_output == '{"type":"text","text":"UTF-16 clipboard - fixed"}' ]] || fail "clipboard capture decodes UTF-16LE text"
pass "clipboard capture decodes UTF-16LE text"
Expand Down
4 changes: 4 additions & 0 deletions test/shell.d/t2-hardware-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ grep -Fq 'KERNEL_CMDLINE[default]+=" intel_iommu=on iommu=pt pm_async=off mem_sl
fail "T2 setup leaves optional Touch Bar customization uninstalled"
! grep -qx 'tiny-dfr' "$other_packages" ||
fail "the ISO no longer caches tiny-dfr"
grep -Fq 'apple-bcm-firmware-fetcher' "$fix_t2" ||
fail "T2 setup installs the firmware fetcher"
grep -Fq 'apple-bcm-firmware-fetcher' "$other_packages" ||
fail "the default package list installs the firmware fetcher"
pass "fresh T2 setup uses t2bce-compatible suspend, fan, and Touch Bar defaults"

test_tmp=$(mktemp -d)
Expand Down