mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Compare commits
7 Commits
v3.3.3
...
83628ab3bd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83628ab3bd | ||
|
|
febd18ce84 | ||
|
|
5b2c0dafbf | ||
|
|
ed9a4a45ba | ||
|
|
697d09022a | ||
|
|
53b8fc4257 | ||
|
|
65bafa4f3b |
@@ -14,6 +14,7 @@ fi
|
|||||||
DESKTOP_AUDIO="false"
|
DESKTOP_AUDIO="false"
|
||||||
MICROPHONE_AUDIO="false"
|
MICROPHONE_AUDIO="false"
|
||||||
WEBCAM="false"
|
WEBCAM="false"
|
||||||
|
WEBCAM_DEVICE=""
|
||||||
STOP_RECORDING="false"
|
STOP_RECORDING="false"
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
@@ -21,6 +22,7 @@ for arg in "$@"; do
|
|||||||
--with-desktop-audio) DESKTOP_AUDIO="true" ;;
|
--with-desktop-audio) DESKTOP_AUDIO="true" ;;
|
||||||
--with-microphone-audio) MICROPHONE_AUDIO="true" ;;
|
--with-microphone-audio) MICROPHONE_AUDIO="true" ;;
|
||||||
--with-webcam) WEBCAM="true" ;;
|
--with-webcam) WEBCAM="true" ;;
|
||||||
|
--webcam-device=*) WEBCAM_DEVICE="${arg#*=}" ;;
|
||||||
--stop-recording) STOP_RECORDING="true"
|
--stop-recording) STOP_RECORDING="true"
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -32,6 +34,15 @@ cleanup_webcam() {
|
|||||||
start_webcam_overlay() {
|
start_webcam_overlay() {
|
||||||
cleanup_webcam
|
cleanup_webcam
|
||||||
|
|
||||||
|
# Auto-detect first available webcam if none specified
|
||||||
|
if [[ -z "$WEBCAM_DEVICE" ]]; then
|
||||||
|
WEBCAM_DEVICE=$(v4l2-ctl --list-devices 2>/dev/null | grep -m1 "^\s*/dev/video" | tr -d '\t')
|
||||||
|
if [[ -z "$WEBCAM_DEVICE" ]]; then
|
||||||
|
notify-send "No webcam devices found" -u critical -t 3000
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Get monitor scale
|
# Get monitor scale
|
||||||
local scale=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .scale')
|
local scale=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .scale')
|
||||||
|
|
||||||
@@ -41,7 +52,7 @@ start_webcam_overlay() {
|
|||||||
# Try preferred 16:9 resolutions in order, use first available
|
# Try preferred 16:9 resolutions in order, use first available
|
||||||
local preferred_resolutions=("640x360" "1280x720" "1920x1080")
|
local preferred_resolutions=("640x360" "1280x720" "1920x1080")
|
||||||
local video_size_arg=""
|
local video_size_arg=""
|
||||||
local available_formats=$(v4l2-ctl --list-formats-ext -d /dev/video0 2>/dev/null)
|
local available_formats=$(v4l2-ctl --list-formats-ext -d "$WEBCAM_DEVICE" 2>/dev/null)
|
||||||
|
|
||||||
for resolution in "${preferred_resolutions[@]}"; do
|
for resolution in "${preferred_resolutions[@]}"; do
|
||||||
if echo "$available_formats" | grep -q "$resolution"; then
|
if echo "$available_formats" | grep -q "$resolution"; then
|
||||||
@@ -50,7 +61,7 @@ start_webcam_overlay() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
ffplay -f v4l2 $video_size_arg -framerate 30 /dev/video0 \
|
ffplay -f v4l2 $video_size_arg -framerate 30 "$WEBCAM_DEVICE" \
|
||||||
-vf "scale=${target_width}:-1" \
|
-vf "scale=${target_width}:-1" \
|
||||||
-window_title "WebcamOverlay" \
|
-window_title "WebcamOverlay" \
|
||||||
-noborder \
|
-noborder \
|
||||||
|
|||||||
@@ -113,13 +113,43 @@ show_screenshot_menu() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_webcam_list() {
|
||||||
|
v4l2-ctl --list-devices 2>/dev/null | while IFS= read -r line; do
|
||||||
|
if [[ "$line" != $'\t'* && -n "$line" ]]; then
|
||||||
|
local name="$line"
|
||||||
|
IFS= read -r device || break
|
||||||
|
device=$(echo "$device" | tr -d '\t' | head -1)
|
||||||
|
[[ -n "$device" ]] && echo "$device $name"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
show_webcam_select_menu() {
|
||||||
|
local devices=$(get_webcam_list)
|
||||||
|
local count=$(echo "$devices" | grep -c . 2>/dev/null || echo 0)
|
||||||
|
|
||||||
|
if [[ -z "$devices" || "$count" -eq 0 ]]; then
|
||||||
|
notify-send "No webcam devices found" -u critical -t 3000
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$count" -eq 1 ]]; then
|
||||||
|
echo "$devices" | awk '{print $1}'
|
||||||
|
else
|
||||||
|
menu "Select Webcam" "$devices" | awk '{print $1}'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
show_screenrecord_menu() {
|
show_screenrecord_menu() {
|
||||||
omarchy-cmd-screenrecord --stop-recording && exit 0
|
omarchy-cmd-screenrecord --stop-recording && exit 0
|
||||||
|
|
||||||
case $(menu "Screenrecord" " With desktop audio\n With desktop + microphone audio\n With desktop + microphone audio + webcam") in
|
case $(menu "Screenrecord" " With desktop audio\n With desktop + microphone audio\n With desktop + microphone audio + webcam") in
|
||||||
*"With desktop audio") omarchy-cmd-screenrecord --with-desktop-audio ;;
|
*"With desktop audio") omarchy-cmd-screenrecord --with-desktop-audio ;;
|
||||||
*"With desktop + microphone audio") omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;;
|
*"With desktop + microphone audio") omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;;
|
||||||
*"With desktop + microphone audio + webcam") omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam ;;
|
*"With desktop + microphone audio + webcam")
|
||||||
|
local device=$(show_webcam_select_menu) || { back_to show_capture_menu; return; }
|
||||||
|
omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam --webcam-device="$device"
|
||||||
|
;;
|
||||||
*) back_to show_capture_menu ;;
|
*) back_to show_capture_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,22 +13,21 @@ hex_to_rgb() {
|
|||||||
|
|
||||||
# Only generate dynamic templates for themes with a colors.toml definition
|
# Only generate dynamic templates for themes with a colors.toml definition
|
||||||
if [[ -f $COLORS_FILE ]]; then
|
if [[ -f $COLORS_FILE ]]; then
|
||||||
# Parse TOML using yq (treating it as YAML since the flat key=value structure is compatible)
|
|
||||||
# We convert 'key = value' to 'key: value' to make it valid YAML, then use yq/jq to generate the replacement commands.
|
|
||||||
sed_script=$(mktemp)
|
sed_script=$(mktemp)
|
||||||
|
|
||||||
# Generate standard and _strip substitutions
|
|
||||||
sed 's/=/:/' "$COLORS_FILE" | yq -r 'to_entries[] | "s|{{ \(.key) }}|\(.value)|g", "s|{{ \(.key)_strip }}|\(.value | sub("^#";""))|g"' > "$sed_script"
|
|
||||||
|
|
||||||
# Generate _rgb substitutions for hex colors
|
|
||||||
while IFS='=' read -r key value; do
|
while IFS='=' read -r key value; do
|
||||||
key=$(echo "$key" | xargs)
|
key="${key//[\"\' ]/}" # strip quotes and spaces from key
|
||||||
value=$(echo "$value" | xargs | tr -d '"')
|
[[ $key && $key != \#* ]] || continue # skip empty lines and comments
|
||||||
|
value="${value#*[\"\']}"
|
||||||
|
value="${value%%[\"\']*}" # extract value between quotes (ignores inline comments)
|
||||||
|
|
||||||
|
printf 's|{{ %s }}|%s|g\n' "$key" "$value" # {{ key }} -> value
|
||||||
|
printf 's|{{ %s_strip }}|%s|g\n' "$key" "${value#\#}" # {{ key_strip }} -> value without leading #
|
||||||
if [[ $value =~ ^# ]]; then
|
if [[ $value =~ ^# ]]; then
|
||||||
rgb=$(hex_to_rgb "$value")
|
rgb=$(hex_to_rgb "$value")
|
||||||
echo "s|{{ ${key}_rgb }}|${rgb}|g" >> "$sed_script"
|
echo "s|{{ ${key}_rgb }}|${rgb}|g"
|
||||||
fi
|
fi
|
||||||
done < "$COLORS_FILE"
|
done <"$COLORS_FILE" >"$sed_script"
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ if [ -n "$NVIDIA" ]; then
|
|||||||
if echo "$NVIDIA" | grep -qE "RTX [2-9][0-9]|GTX 16"; then
|
if echo "$NVIDIA" | grep -qE "RTX [2-9][0-9]|GTX 16"; then
|
||||||
# Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules
|
# Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules
|
||||||
PACKAGES=(nvidia-open-dkms nvidia-utils lib32-nvidia-utils libva-nvidia-driver)
|
PACKAGES=(nvidia-open-dkms nvidia-utils lib32-nvidia-utils libva-nvidia-driver)
|
||||||
elif echo "$NVIDIA" | grep -qE "GTX 9|GTX 10|Quadro P"; then
|
elif echo "$NVIDIA" | grep -qE "GTX 9|GTX 10|Quadro P|MX1|MX2|MX3"; then
|
||||||
# Pascal (10xx or Quadro Pxxx) and Maxwell (9xx) use legacy branch that can only be installed from AUR
|
# Pascal (10xx, Quadro Pxxx, MX150, MX2xx, and MX3xx) and Maxwell (9xx, MX110, and MX130) use legacy branch that can only be installed from AUR
|
||||||
PACKAGES=(nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils)
|
PACKAGES=(nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils)
|
||||||
fi
|
fi
|
||||||
# Bail if no supported GPU
|
# Bail if no supported GPU
|
||||||
|
|||||||
@@ -144,5 +144,4 @@ xmlstarlet
|
|||||||
xournalpp
|
xournalpp
|
||||||
yaru-icon-theme
|
yaru-icon-theme
|
||||||
yay
|
yay
|
||||||
yq
|
|
||||||
zoxide
|
zoxide
|
||||||
|
|||||||
@@ -19,5 +19,5 @@ if [[ -n ${OMARCHY_ONLINE_INSTALL:-} ]]; then
|
|||||||
|
|
||||||
|
|
||||||
# Refresh all repos
|
# Refresh all repos
|
||||||
sudo pacman -Syu --noconfirm
|
sudo pacman -Syyu --noconfirm
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
echo "Migrate to new theme setup"
|
echo "Migrate to new theme setup"
|
||||||
|
|
||||||
omarchy-pkg-add yq
|
|
||||||
|
|
||||||
# Move user-added backgrounds from Omarchy theme folders to user config
|
# Move user-added backgrounds from Omarchy theme folders to user config
|
||||||
OMARCHY_DIR="$HOME/.local/share/omarchy"
|
OMARCHY_DIR="$HOME/.local/share/omarchy"
|
||||||
USER_BACKGROUNDS_DIR="$HOME/.config/omarchy/backgrounds"
|
USER_BACKGROUNDS_DIR="$HOME/.config/omarchy/backgrounds"
|
||||||
|
|||||||
19
migrations/1768906440.sh
Normal file
19
migrations/1768906440.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
echo "Migrate legacy mobile NVIDIA GPUs to nvidia-580xx driver (if needed)"
|
||||||
|
|
||||||
|
# Only migrate MX1xx, 2xx or 3xx (Pascal/Maxwell)
|
||||||
|
NVIDIA="$(lspci | grep -i 'nvidia')"
|
||||||
|
if echo "$NVIDIA" | grep -qE "MX1|MX2|MX3"; then
|
||||||
|
if ! pacman -Qq | grep -qE '^linux(-[a-z0-9]+)?-headers$'; then
|
||||||
|
echo "Error: no linux headers package installed (required for DKMS drivers). Please install the appropriate headers and re-run this migration."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Piping yes to override existing packages
|
||||||
|
yes | sudo pacman -S nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils
|
||||||
|
|
||||||
|
# Verify packages were installed
|
||||||
|
if ! pacman -Qq nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils &>/dev/null; then
|
||||||
|
echo "Error: NVIDIA 580xx driver packages failed to install"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user