mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Compare commits
10 Commits
6ff13fc071
...
d346f5d522
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d346f5d522 | ||
|
|
f152ff68ea | ||
|
|
01d7296616 | ||
|
|
b573a37e33 | ||
|
|
68b4939993 | ||
|
|
b3dd14a038 | ||
|
|
7dc638358b | ||
|
|
3e07255fbc | ||
|
|
02fd1961b9 | ||
|
|
40bff09c84 |
@@ -32,7 +32,6 @@ open_editor() {
|
||||
if [[ "$SCREENSHOT_EDITOR" == "satty" ]]; then
|
||||
satty --filename "$filepath" \
|
||||
--output-filename "$filepath" \
|
||||
--early-exit \
|
||||
--actions-on-enter save-to-clipboard \
|
||||
--save-after-copy \
|
||||
--copy-command 'wl-copy'
|
||||
@@ -52,51 +51,54 @@ get_rectangles() {
|
||||
|
||||
# Select based on mode
|
||||
case "$MODE" in
|
||||
region)
|
||||
wayfreeze & PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
windows)
|
||||
wayfreeze & PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
fullscreen)
|
||||
SELECTION=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x),\(.y) \((.width / .scale) | floor)x\((.height / .scale) | floor)"')
|
||||
;;
|
||||
smart|*)
|
||||
RECTS=$(get_rectangles)
|
||||
wayfreeze & PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
region)
|
||||
wayfreeze &
|
||||
PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
windows)
|
||||
wayfreeze &
|
||||
PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(get_rectangles | slurp -r 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
;;
|
||||
fullscreen)
|
||||
SELECTION=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x),\(.y) \((.width / .scale) | floor)x\((.height / .scale) | floor)"')
|
||||
;;
|
||||
smart | *)
|
||||
RECTS=$(get_rectangles)
|
||||
wayfreeze &
|
||||
PID=$!
|
||||
sleep .1
|
||||
SELECTION=$(echo "$RECTS" | slurp 2>/dev/null)
|
||||
kill $PID 2>/dev/null
|
||||
|
||||
# If the selection area is L * W < 20, we'll assume you were trying to select whichever
|
||||
# window or output it was inside of to prevent accidental 2px snapshots
|
||||
if [[ "$SELECTION" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+)$ ]]; then
|
||||
if (( ${BASH_REMATCH[3]} * ${BASH_REMATCH[4]} < 20 )); then
|
||||
click_x="${BASH_REMATCH[1]}"
|
||||
click_y="${BASH_REMATCH[2]}"
|
||||
# If the selection area is L * W < 20, we'll assume you were trying to select whichever
|
||||
# window or output it was inside of to prevent accidental 2px snapshots
|
||||
if [[ "$SELECTION" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+)$ ]]; then
|
||||
if ((${BASH_REMATCH[3]} * ${BASH_REMATCH[4]} < 20)); then
|
||||
click_x="${BASH_REMATCH[1]}"
|
||||
click_y="${BASH_REMATCH[2]}"
|
||||
|
||||
while IFS= read -r rect; do
|
||||
if [[ "$rect" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+) ]]; then
|
||||
rect_x="${BASH_REMATCH[1]}"
|
||||
rect_y="${BASH_REMATCH[2]}"
|
||||
rect_width="${BASH_REMATCH[3]}"
|
||||
rect_height="${BASH_REMATCH[4]}"
|
||||
while IFS= read -r rect; do
|
||||
if [[ "$rect" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+) ]]; then
|
||||
rect_x="${BASH_REMATCH[1]}"
|
||||
rect_y="${BASH_REMATCH[2]}"
|
||||
rect_width="${BASH_REMATCH[3]}"
|
||||
rect_height="${BASH_REMATCH[4]}"
|
||||
|
||||
if (( click_x >= rect_x && click_x < rect_x+rect_width && click_y >= rect_y && click_y < rect_y+rect_height )); then
|
||||
SELECTION="${rect_x},${rect_y} ${rect_width}x${rect_height}"
|
||||
break
|
||||
fi
|
||||
if ((click_x >= rect_x && click_x < rect_x + rect_width && click_y >= rect_y && click_y < rect_y + rect_height)); then
|
||||
SELECTION="${rect_x},${rect_y} ${rect_width}x${rect_height}"
|
||||
break
|
||||
fi
|
||||
done <<< "$RECTS"
|
||||
fi
|
||||
fi
|
||||
done <<<"$RECTS"
|
||||
fi
|
||||
;;
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ -z $SELECTION ]] && exit 0
|
||||
@@ -106,10 +108,10 @@ FILEPATH="$OUTPUT_DIR/$FILENAME"
|
||||
|
||||
if [[ $PROCESSING == "slurp" ]]; then
|
||||
grim -g "$SELECTION" "$FILEPATH" || exit 1
|
||||
wl-copy < "$FILEPATH"
|
||||
wl-copy <"$FILEPATH"
|
||||
|
||||
(
|
||||
ACTION=$(notify-send "Screenshot copied & saved" "Click to edit" -t 10000 -i "$FILEPATH" -A "default=edit")
|
||||
ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit")
|
||||
[[ "$ACTION" == "default" ]] && open_editor "$FILEPATH"
|
||||
) &
|
||||
else
|
||||
|
||||
@@ -19,8 +19,8 @@ fzf_args=(
|
||||
pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}")
|
||||
|
||||
if [[ -n "$pkg_names" ]]; then
|
||||
# Convert newline-separated selections to space-separated for yay
|
||||
echo "$pkg_names" | tr '\n' ' ' | xargs yay -S --noconfirm
|
||||
# Add aur/ prefix to each package name and convert to space-separated for yay
|
||||
echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm
|
||||
sudo updatedb
|
||||
omarchy-show-done
|
||||
fi
|
||||
|
||||
@@ -2,5 +2,3 @@
|
||||
--ozone-platform-hint=wayland
|
||||
--enable-features=TouchpadOverscrollHistoryNavigation
|
||||
--load-extension=~/.local/share/omarchy/default/chromium/extensions/copy-url
|
||||
# Chromium crash workaround for Wayland color management on Hyprland - see https://github.com/hyprwm/Hyprland/issues/11957
|
||||
--disable-features=WaylandWpColorManagerV1
|
||||
|
||||
@@ -2,5 +2,3 @@
|
||||
--ozone-platform-hint=wayland
|
||||
--enable-features=TouchpadOverscrollHistoryNavigation
|
||||
--load-extension=~/.local/share/omarchy/default/chromium/extensions/copy-url
|
||||
# Chromium crash workaround for Wayland color management on Hyprland - see https://github.com/hyprwm/Hyprland/issues/11957
|
||||
--disable-features=WaylandWpColorManagerV1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"theme": "system"
|
||||
"theme": "system",
|
||||
"autoupdate": false
|
||||
}
|
||||
|
||||
@@ -4,15 +4,33 @@ alias decompress="tar -xzf"
|
||||
|
||||
# Write iso file to sd card
|
||||
iso2sd() {
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: iso2sd <input_file> <output_device>"
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: iso2sd <input_file> [output_device]"
|
||||
echo "Example: iso2sd ~/Downloads/ubuntu-25.04-desktop-amd64.iso /dev/sda"
|
||||
echo -e "\nAvailable SD cards:"
|
||||
lsblk -d -o NAME | grep -E '^sd[a-z]' | awk '{print "/dev/"$1}'
|
||||
else
|
||||
sudo dd bs=4M status=progress oflag=sync if="$1" of="$2"
|
||||
sudo eject $2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local iso="$1"
|
||||
local drive="$2"
|
||||
|
||||
if [[ -z $drive ]]; then
|
||||
local available_sds=$(lsblk -dpno NAME | grep -E '/dev/sd')
|
||||
|
||||
if [[ -z $available_sds ]]; then
|
||||
echo "No SD drives found and no drive specified"
|
||||
return 1
|
||||
fi
|
||||
|
||||
drive=$(omarchy-drive-select "$available_sds")
|
||||
|
||||
if [[ -z $drive ]]; then
|
||||
echo "No drive selected"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
sudo dd bs=4M status=progress oflag=sync if="$iso" of="$drive"
|
||||
sudo eject "$drive"
|
||||
}
|
||||
|
||||
# Format an entire drive for a single partition using exFAT
|
||||
@@ -118,8 +136,8 @@ tml() {
|
||||
# Get current pane ID (will become editor pane after splits)
|
||||
editor_pane=$(tmux display-message -p '#{pane_id}')
|
||||
|
||||
# Split window vertically - top 90%, bottom 10%
|
||||
tmux split-window -v -p 10 -c "$current_dir"
|
||||
# Split window vertically - top 85%, bottom 15%
|
||||
tmux split-window -v -p 15 -c "$current_dir"
|
||||
|
||||
# Go back to top pane (editor_pane) and split it horizontally
|
||||
tmux select-pane -t "$editor_pane"
|
||||
|
||||
3
migrations/1769616857.sh
Normal file
3
migrations/1769616857.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
echo "Turn off opencode's own auto-update feature (we rely on pacman)"
|
||||
|
||||
omarchy-refresh-config opencode/opencode.json
|
||||
14
migrations/1771188969.sh
Normal file
14
migrations/1771188969.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
echo "Remove temporary Wayland color manager disabling flag from existing Chromium configs"
|
||||
|
||||
# This reverts the workaround originally added by migration 1760401344.sh
|
||||
# Remove flag and comment from chromium-flags.conf only if found
|
||||
if [[ -f ~/.config/chromium-flags.conf ]]; then
|
||||
sed -i '/--disable-features=WaylandWpColorManagerV1/d' ~/.config/chromium-flags.conf
|
||||
sed -i '/# Chromium crash workaround for Wayland color management on Hyprland/d' ~/.config/chromium-flags.conf
|
||||
fi
|
||||
|
||||
# Remove flag and comment from brave-flags.conf only if found
|
||||
if [[ -f ~/.config/brave-flags.conf ]]; then
|
||||
sed -i '/--disable-features=WaylandWpColorManagerV1/d' ~/.config/brave-flags.conf
|
||||
sed -i '/# Chromium crash workaround for Wayland color management on Hyprland/d' ~/.config/brave-flags.conf
|
||||
fi
|
||||
Reference in New Issue
Block a user