mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Compare commits
38 Commits
gaming-imp
...
fix-omarch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63aff7cd71 | ||
|
|
a6aec518a5 | ||
|
|
a7a6ac1d21 | ||
|
|
af564ed07d | ||
|
|
eb74a97a0c | ||
|
|
883cb66f99 | ||
|
|
2c74696735 | ||
|
|
a54044ea30 | ||
|
|
1e859d37cb | ||
|
|
f634bfeeb6 | ||
|
|
ea6b6c6b7f | ||
|
|
499e7383c2 | ||
|
|
9b8819d9b9 | ||
|
|
a8f76783e3 | ||
|
|
796ef67ede | ||
|
|
0eccf22921 | ||
|
|
971422b757 | ||
|
|
076da663f5 | ||
|
|
b92ebff29b | ||
|
|
8e5b59995a | ||
|
|
dc49358a81 | ||
|
|
cd39bbf692 | ||
|
|
fba17b7da4 | ||
|
|
25df782e2f | ||
|
|
d4b0ba5d94 | ||
|
|
a74b426c9f | ||
|
|
e0a50f12a7 | ||
|
|
96b64189a6 | ||
|
|
3376838dfb | ||
|
|
0f3e6f5101 | ||
|
|
4d9f932e6c | ||
|
|
607915a5d1 | ||
|
|
38d536ba9d | ||
|
|
441ee10d70 | ||
|
|
45465d3e7c | ||
|
|
4d50c8bd33 | ||
|
|
ad30ef6339 | ||
|
|
19d1ee2b00 |
@@ -8,31 +8,82 @@ if [[ ! -d "$OUTPUT_DIR" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Selects region or output
|
||||
SCOPE="$1"
|
||||
SCOPE=""
|
||||
AUDIO="false"
|
||||
WEBCAM="false"
|
||||
|
||||
# Selects audio inclusion or not
|
||||
AUDIO=$([[ $2 == "audio" ]] && echo "--audio")
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--with-audio) AUDIO="true" ;;
|
||||
--with-webcam) WEBCAM="true" ;;
|
||||
output|region) SCOPE="$arg" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
cleanup_webcam() {
|
||||
pkill -f "WebcamOverlay" 2>/dev/null
|
||||
}
|
||||
|
||||
start_webcam_overlay() {
|
||||
cleanup_webcam
|
||||
|
||||
# Get monitor scale
|
||||
local scale=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .scale')
|
||||
|
||||
# Target width (base 360px, scaled to monitor)
|
||||
local target_width=$(awk "BEGIN {printf \"%.0f\", 360 * $scale}")
|
||||
|
||||
# Try preferred 16:9 resolutions in order, use first available
|
||||
local preferred_resolutions=("640x360" "1280x720" "1920x1080")
|
||||
local video_size_arg=""
|
||||
local available_formats=$(v4l2-ctl --list-formats-ext -d /dev/video0 2>/dev/null)
|
||||
|
||||
for resolution in "${preferred_resolutions[@]}"; do
|
||||
if echo "$available_formats" | grep -q "$resolution"; then
|
||||
video_size_arg="-video_size $resolution"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
ffplay -f v4l2 $video_size_arg -framerate 30 /dev/video0 \
|
||||
-vf "scale=${target_width}:-1" \
|
||||
-window_title "WebcamOverlay" \
|
||||
-noborder \
|
||||
-fflags nobuffer -flags low_delay \
|
||||
-probesize 32 -analyzeduration 0 \
|
||||
-loglevel quiet &
|
||||
sleep 1
|
||||
}
|
||||
|
||||
start_screenrecording() {
|
||||
filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
||||
local filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4"
|
||||
local audio_args=""
|
||||
|
||||
if lspci | grep -qi 'nvidia'; then
|
||||
wf-recorder $AUDIO -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@" &
|
||||
else
|
||||
wl-screenrec $AUDIO -f "$filename" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" "$@" &
|
||||
fi
|
||||
# Merge audio tracks into one - separate tracks only play one at a time in most players
|
||||
[[ "$AUDIO" == "true" ]] && audio_args="-a default_output|default_input"
|
||||
|
||||
gpu-screen-recorder -w "$@" -f 60 -c mp4 -o "$filename" $audio_args &
|
||||
toggle_screenrecording_indicator
|
||||
}
|
||||
|
||||
stop_screenrecording() {
|
||||
pkill -x wl-screenrec
|
||||
pkill -x wf-recorder
|
||||
pkill -SIGINT -f "gpu-screen-recorder" # SIGINT required to save video properly
|
||||
|
||||
notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000
|
||||
# Wait a maximum of 5 seconds to finish before hard killing
|
||||
local count=0
|
||||
while pgrep -f "gpu-screen-recorder" >/dev/null && [ $count -lt 50 ]; do
|
||||
sleep 0.1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
sleep 0.2 # ensures the process is actually dead before we check
|
||||
if pgrep -f "gpu-screen-recorder" >/dev/null; then
|
||||
pkill -9 -f "gpu-screen-recorder"
|
||||
cleanup_webcam
|
||||
notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000
|
||||
else
|
||||
cleanup_webcam
|
||||
notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000
|
||||
fi
|
||||
toggle_screenrecording_indicator
|
||||
}
|
||||
|
||||
@@ -41,14 +92,51 @@ toggle_screenrecording_indicator() {
|
||||
}
|
||||
|
||||
screenrecording_active() {
|
||||
pgrep -x wl-screenrec >/dev/null || pgrep -x wf-recorder >/dev/null
|
||||
pgrep -f "gpu-screen-recorder" >/dev/null || pgrep -x slurp >/dev/null || pgrep -f "WebcamOverlay" >/dev/null
|
||||
}
|
||||
|
||||
if screenrecording_active; then
|
||||
stop_screenrecording
|
||||
if pgrep -x slurp >/dev/null; then
|
||||
pkill -x slurp 2>/dev/null
|
||||
elif pgrep -f "WebcamOverlay" >/dev/null && ! pgrep -f "gpu-screen-recorder" >/dev/null; then
|
||||
cleanup_webcam
|
||||
else
|
||||
stop_screenrecording
|
||||
fi
|
||||
elif [[ "$SCOPE" == "output" ]]; then
|
||||
start_screenrecording
|
||||
[[ "$WEBCAM" == "true" ]] && start_webcam_overlay
|
||||
|
||||
if ! output=$(slurp -o -f "%o"); then
|
||||
[[ "$WEBCAM" == "true" ]] && cleanup_webcam
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$output" ]]; then
|
||||
notify-send "Error" "Could not detect monitor" -u critical
|
||||
[[ "$WEBCAM" == "true" ]] && cleanup_webcam
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start_screenrecording "$output"
|
||||
else
|
||||
region=$(slurp) || exit 1
|
||||
start_screenrecording -g "$region"
|
||||
[[ "$WEBCAM" == "true" ]] && start_webcam_overlay
|
||||
|
||||
scale=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .scale')
|
||||
|
||||
if ! region=$(slurp -f "%wx%h+%x+%y"); then
|
||||
[[ "$WEBCAM" == "true" ]] && cleanup_webcam
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$region" =~ ^([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+)$ ]]; then
|
||||
w=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[1]} * $scale}")
|
||||
h=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[2]} * $scale}")
|
||||
x=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[3]} * $scale}")
|
||||
y=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[4]} * $scale}")
|
||||
scaled_region="${w}x${h}+${x}+${y}"
|
||||
else
|
||||
scaled_region="$region"
|
||||
fi
|
||||
|
||||
start_screenrecording region -region "$scaled_region"
|
||||
fi
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
browser=$(xdg-settings get default-web-browser)
|
||||
|
||||
case $browser in
|
||||
google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;;
|
||||
google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium-browser*) ;;
|
||||
*) browser="chromium.desktop" ;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo -e "Restarting pirewire audio service...\n"
|
||||
echo -e "Restarting pipewire audio service...\n"
|
||||
systemctl --user restart pipewire.service
|
||||
|
||||
@@ -43,7 +43,7 @@ cat >"$DESKTOP_FILE" <<EOF
|
||||
Version=1.0
|
||||
Name=$APP_NAME
|
||||
Comment=$APP_NAME
|
||||
Exec=$TERMINAL --class $APP_CLASS -e $APP_EXEC
|
||||
Exec=\$TERMINAL --class=$APP_CLASS -e $APP_EXEC
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=$ICON_PATH
|
||||
|
||||
@@ -15,3 +15,9 @@ decoration {
|
||||
# Use round window corners
|
||||
# rounding = 8
|
||||
}
|
||||
|
||||
# https://wiki.hypr.land/Configuring/Dwindle-Layout/
|
||||
dwindle {
|
||||
# Avoid overly wide single-window layouts on wide screens
|
||||
# single_window_aspect_ratio = 1 1
|
||||
}
|
||||
|
||||
@@ -12,3 +12,4 @@ source = ~/.local/share/omarchy/default/hypr/apps/steam.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/apps/system.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/apps/terminals.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/apps/walker.conf
|
||||
source = ~/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Float Steam, fullscreen RetroArch
|
||||
# Float Steam
|
||||
windowrule = float, class:steam
|
||||
windowrule = center, class:steam, title:Steam
|
||||
windowrule = opacity 1 1, class:steam
|
||||
|
||||
6
default/hypr/apps/webcam-overlay.conf
Normal file
6
default/hypr/apps/webcam-overlay.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
# Webcam overlay for screen recording
|
||||
windowrule = float, title:WebcamOverlay
|
||||
windowrule = pin, title:WebcamOverlay
|
||||
windowrule = noinitialfocus, title:WebcamOverlay
|
||||
windowrule = nodim, title:WebcamOverlay
|
||||
windowrule = move 100%-w-40 100%-w-40, title:WebcamOverlay # There's a typo in the hyprland rule so 100%-w on the height param is actually correct here
|
||||
@@ -36,9 +36,9 @@ bindd = CTRL, PRINT, Screenshot of display, exec, omarchy-cmd-screenshot output
|
||||
|
||||
# Screen recordings
|
||||
bindd = ALT, PRINT, Screen record a region, exec, omarchy-cmd-screenrecord region
|
||||
bindd = ALT SHIFT, PRINT, Screen record a region with audio, exec, omarchy-cmd-screenrecord region audio
|
||||
bindd = ALT SHIFT, PRINT, Screen record a region with audio, exec, omarchy-cmd-screenrecord region --with-audio
|
||||
bindd = CTRL ALT, PRINT, Screen record display, exec, omarchy-cmd-screenrecord output
|
||||
bindd = CTRL ALT SHIFT, PRINT, Screen record display with audio, exec, omarchy-cmd-screenrecord output audio
|
||||
bindd = CTRL ALT SHIFT, PRINT, Screen record display with audio, exec, omarchy-cmd-screenrecord output --with-audio
|
||||
|
||||
# Color picker
|
||||
bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
if pgrep -x wl-screenrec >/dev/null || pgrep -x wf-recorder >/dev/null; then
|
||||
if pgrep -f "gpu-screen-recorder" >/dev/null; then
|
||||
echo '{"text": "", "tooltip": "Stop recording", "class": "active"}'
|
||||
else
|
||||
echo '{"text": ""}'
|
||||
|
||||
@@ -24,6 +24,6 @@ run_logged $OMARCHY_INSTALL/config/hardware/usb-autosuspend.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/ignore-power-button.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/nvidia.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/fix-f13-amd-audio-input.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-bcm4360.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-bcm43xx.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-spi-keyboard.sh
|
||||
run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-t2.sh
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# Install wifi drivers for 2013-2015 MacBooks using the BCM4360 chip
|
||||
if lspci -nnv | grep -A2 "14e4:43a0" | grep -q "106b:"; then
|
||||
echo "Apple BCM4360 detected"
|
||||
sudo pacman -S --noconfirm --needed broadcom-wl dkms linux-headers
|
||||
fi
|
||||
11
install/config/hardware/fix-apple-bcm43xx.sh
Normal file
11
install/config/hardware/fix-apple-bcm43xx.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
# Install Wi-Fi drivers for Broadcom chips on MacBooks:
|
||||
# - BCM4360 (2013–2015)
|
||||
# - BCM4331 (2012, early 2013)
|
||||
|
||||
pci_info=$(lspci -nnv)
|
||||
|
||||
if echo "$pci_info" | grep -q "106b:" &&
|
||||
(echo "$pci_info" | grep -q "14e4:43a0" || echo "$pci_info" | grep -q "14e4:4331"); then
|
||||
echo "Apple BCM4360 / BCM4331 detected"
|
||||
sudo pacman -S --noconfirm --needed broadcom-wl dkms linux-headers
|
||||
fi
|
||||
@@ -1,7 +1,12 @@
|
||||
# Detect MacBook models that need SPI keyboard modules
|
||||
if [[ "$(cat /sys/class/dmi/id/product_name 2>/dev/null)" =~ MacBook12,1|MacBookPro13,[123]|MacBookPro14,[123] ]]; then
|
||||
product_name="$(cat /sys/class/dmi/id/product_name 2>/dev/null)"
|
||||
if [[ "$product_name" =~ MacBook[89],1|MacBook1[02],1|MacBookPro13,[123]|MacBookPro14,[123] ]]; then
|
||||
echo "Detected MacBook with SPI keyboard"
|
||||
|
||||
sudo pacman -S --noconfirm --needed macbook12-spi-driver-dkms
|
||||
echo "MODULES=(applespi intel_lpss_pci spi_pxa2xx_platform)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null
|
||||
if [[ "$product_name" == "MacBook8,1" ]]; then
|
||||
echo "MODULES=(applespi spi_pxa2xx_platform spi_pxa2xx_pci)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null
|
||||
else
|
||||
echo "MODULES=(applespi intel_lpss_pci spi_pxa2xx_platform)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -35,6 +35,7 @@ github-cli
|
||||
gnome-calculator
|
||||
gnome-keyring
|
||||
gnome-themes-extra
|
||||
gpu-screen-recorder
|
||||
gum
|
||||
gvfs-mtp
|
||||
gvfs-smb
|
||||
@@ -113,14 +114,12 @@ unzip
|
||||
uwsm
|
||||
walker-bin
|
||||
waybar
|
||||
wf-recorder
|
||||
whois
|
||||
wireless-regdb
|
||||
wiremix
|
||||
wireplumber
|
||||
wl-clip-persist
|
||||
wl-clipboard
|
||||
wl-screenrec
|
||||
woff2-font-awesome
|
||||
xdg-desktop-portal-gtk
|
||||
xdg-desktop-portal-hyprland
|
||||
|
||||
17
migrations/1758436991.sh
Normal file
17
migrations/1758436991.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
echo "Fix Disk Usage and Docker TUIs"
|
||||
|
||||
APP_DIR="$HOME/.local/share/applications"
|
||||
ICON_DIR="$APP_DIR/icons"
|
||||
|
||||
# Don't use omarchy-tui-remove to preserve icons
|
||||
|
||||
if [[ -f "$APP_DIR/Docker.desktop" ]]; then
|
||||
rm "$APP_DIR/Docker.desktop"
|
||||
omarchy-tui-install "Docker" "lazydocker" tile "$ICON_DIR/Docker.png"
|
||||
fi
|
||||
|
||||
if [[ -f "$APP_DIR/Disk Usage.desktop" ]]; then
|
||||
rm "$APP_DIR/Disk Usage.desktop"
|
||||
omarchy-tui-install "Disk Usage" "bash -c 'dust -r; read -n 1 -s'" float "$ICON_DIR/Disk Usage.png"
|
||||
fi
|
||||
|
||||
3
migrations/1760144906.sh
Normal file
3
migrations/1760144906.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
echo "Change omarchy-screenrecord to use gpu-screen-recorder"
|
||||
omarchy-pkg-drop wf-recorder wl-screenrec
|
||||
omarchy-pkg-add gpu-screen-recorder
|
||||
Reference in New Issue
Block a user