Merge branch 'dev' into rc
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Toggle microphone mute. Dell XPS and ThinkPad systems get special handling for the hardware LED.
|
||||
# omarchy:summary=Toggle microphone mute. Drives the hardware mic-mute LED on laptops that expose one.
|
||||
|
||||
if omarchy-hw-match "XPS"; then
|
||||
omarchy-audio-input-mute-xps
|
||||
elif omarchy-hw-match "ThinkPad"; then
|
||||
omarchy-audio-input-mute-thinkpad
|
||||
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null
|
||||
|
||||
if pactl get-source-mute @DEFAULT_SOURCE@ | rg -q 'yes'; then
|
||||
led=on
|
||||
osd_message='Microphone muted'
|
||||
osd_icon='microphone-sensitivity-muted-symbolic'
|
||||
else
|
||||
omarchy-swayosd-client --input-volume mute-toggle
|
||||
led=off
|
||||
osd_message='Microphone on'
|
||||
osd_icon='audio-input-microphone-symbolic'
|
||||
fi
|
||||
|
||||
omarchy-brightness-keyboard-mute "$led"
|
||||
|
||||
omarchy-swayosd-client \
|
||||
--custom-message "$osd_message" \
|
||||
--custom-icon "$osd_icon"
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Toggle microphone mute on ThinkPad systems. Uses wpctl for reliable toggling
|
||||
|
||||
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null
|
||||
|
||||
if pactl get-source-mute @DEFAULT_SOURCE@ | grep -q 'yes'; then
|
||||
osd_message='Microphone muted'
|
||||
osd_icon='microphone-sensitivity-muted-symbolic'
|
||||
led_value=1
|
||||
else
|
||||
osd_message='Microphone on'
|
||||
osd_icon='audio-input-microphone-symbolic'
|
||||
led_value=0
|
||||
fi
|
||||
|
||||
brightnessctl --device="platform::micmute" set "$led_value" >/dev/null 2>&1 || true
|
||||
|
||||
omarchy-swayosd-client \
|
||||
--custom-message "$osd_message" \
|
||||
--custom-icon "$osd_icon"
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Toggle microphone mute on Dell XPS systems. Uses wpctl for reliable toggling
|
||||
|
||||
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null
|
||||
|
||||
if pactl get-source-mute @DEFAULT_SOURCE@ | rg -q 'yes'; then
|
||||
alsa_value='off,off'
|
||||
osd_message='Microphone muted'
|
||||
osd_icon='microphone-sensitivity-muted-symbolic'
|
||||
else
|
||||
alsa_value='on,on'
|
||||
osd_message='Microphone on'
|
||||
osd_icon='audio-input-microphone-symbolic'
|
||||
fi
|
||||
|
||||
if [[ -e /sys/class/leds/platform::micmute/brightness ]]; then
|
||||
default_source=$(pactl get-default-source)
|
||||
alsa_card=$(pactl -f json list sources | jq -r --arg source "$default_source" '
|
||||
.[] | select(.name == $source) |
|
||||
.properties["alsa.card"] // .properties["api.alsa.card"] // .properties["api.alsa.pcm.card"] // empty
|
||||
' | head -1)
|
||||
|
||||
if [[ -n $alsa_card ]]; then
|
||||
cards=("$alsa_card")
|
||||
else
|
||||
mapfile -t cards < <(compgen -G '/proc/asound/card*' | rg -o 'card[0-9]+' | sed 's/card//' | sort -u)
|
||||
fi
|
||||
|
||||
for card in "${cards[@]}"; do
|
||||
while IFS= read -r control; do
|
||||
if [[ $control != *"Jack Microphone"* ]]; then
|
||||
amixer -c "$card" cset "$control" "$alsa_value" >/dev/null 2>&1 || true
|
||||
break 2
|
||||
fi
|
||||
done < <(amixer -c "$card" controls 2>/dev/null | rg -o "name='[^']*Microphone Capture Switch'")
|
||||
done
|
||||
fi
|
||||
|
||||
omarchy-swayosd-client \
|
||||
--custom-message "$osd_message" \
|
||||
--custom-icon "$osd_icon"
|
||||
@@ -5,6 +5,11 @@
|
||||
|
||||
step="${1:-+5%}"
|
||||
|
||||
if omarchy-hyprland-monitor-focused-apple; then
|
||||
omarchy-brightness-display-apple "$step"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Start with the first possible output, then refine to the most likely given an order heuristic.
|
||||
device="$(ls -1 /sys/class/backlight 2>/dev/null | head -n1)"
|
||||
for candidate in amdgpu_bl* intel_backlight acpi_video*; do
|
||||
|
||||
@@ -1,13 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Adjust the brightness on Apple Studio Displays and Apple XDR Displays using asdcontrol.
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
if (( $# == 0 )); then
|
||||
echo "Adjust Apple Display Brightness by passing +5000 or -5000 (or any range from 0-60000)"
|
||||
echo "Adjust Apple Display brightness by passing +5%, 5%-, or 100%"
|
||||
else
|
||||
device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)"
|
||||
sudo asdcontrol "$device" -- "$1" >/dev/null
|
||||
step="$1"
|
||||
if [[ $step =~ ^([0-9]+)%-$ ]]; then
|
||||
step="-${BASH_REMATCH[1]}%"
|
||||
fi
|
||||
|
||||
devices=()
|
||||
for path in /dev/usb/hiddev* /dev/hiddev*; do
|
||||
[[ -e $path ]] && devices+=("$path")
|
||||
done
|
||||
|
||||
if (( ${#devices[@]} == 0 )); then
|
||||
echo "No Apple Display HID device found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
device="$(sudo asdcontrol --detect "${devices[@]}" | grep -E '^/dev/(usb/)?hiddev' | cut -d: -f1 | head -n1)"
|
||||
if [[ -z $device ]]; then
|
||||
echo "No Apple Display HID device found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo asdcontrol "$device" -- "$step" >/dev/null
|
||||
value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')"
|
||||
omarchy-swayosd-brightness "$(( value * 100 / 60000 ))"
|
||||
fi
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set the mic-mute indicator LED on laptops that expose a platform::micmute LED node.
|
||||
# omarchy:args=<on|off>
|
||||
|
||||
if [[ -e /sys/class/leds/platform::micmute/brightness ]]; then
|
||||
case "$1" in
|
||||
on) value=1 ;;
|
||||
off) value=0 ;;
|
||||
*) echo "Usage: $(basename "$0") <on|off>" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
brightnessctl --device="platform::micmute" set "$value" >/dev/null 2>&1 || true
|
||||
fi
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Return success if the focused Hyprland monitor is an Apple display.
|
||||
|
||||
hyprctl monitors -j | jq -e '.[] | select(.focused == true) | select(.make == "Apple Computer Inc" and (.model | test("StudioDisplay|ProDisplayXDR")))' >/dev/null
|
||||
@@ -1,11 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Set the power profile to the requested level, falling back to balanced
|
||||
# omarchy:args=<ac|battery>
|
||||
# omarchy:args=[autodetect|ac|battery]
|
||||
|
||||
action="${1-}"
|
||||
|
||||
# Auto-detect when called with no argument: treat any Mains or USB
|
||||
# power-supply device reporting online=1 as "on AC". This handles
|
||||
# USB-C only laptops where the legacy AC device may not fire udev
|
||||
# events, and also avoids false negatives from per-port USB-C devices
|
||||
# that are present-but-empty (online=0) while another port supplies power.
|
||||
if [[ -z $action || $action == "autodetect" ]]; then
|
||||
action=battery
|
||||
for ps in /sys/class/power_supply/*; do
|
||||
[[ -r $ps/online && -r $ps/type ]] || continue
|
||||
type=$(cat "$ps/type")
|
||||
[[ $type == "Mains" || $type == "USB" ]] || continue
|
||||
if [[ $(cat "$ps/online") == "1" ]]; then
|
||||
action=ac
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
mapfile -t profiles < <(powerprofilesctl list | awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }')
|
||||
|
||||
case "$1" in
|
||||
case "$action" in
|
||||
ac)
|
||||
# Prefer performance, fall back to balanced
|
||||
if [[ " ${profiles[*]} " == *" performance "* ]]; then
|
||||
@@ -17,4 +37,4 @@ case "$1" in
|
||||
battery)
|
||||
powerprofilesctl set balanced
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
@@ -5,6 +5,8 @@ bindeld = ,XF86AudioMute, Mute, exec, omarchy-swayosd-client --output-volume mut
|
||||
bindeld = ,XF86AudioMicMute, Mute microphone, exec, omarchy-audio-input-mute
|
||||
bindeld = ,XF86MonBrightnessUp, Brightness up, exec, omarchy-brightness-display +5%
|
||||
bindeld = ,XF86MonBrightnessDown, Brightness down, exec, omarchy-brightness-display 5%-
|
||||
bindeld = SHIFT, XF86MonBrightnessUp, Brightness maximum, exec, omarchy-brightness-display 100%
|
||||
bindeld = SHIFT, XF86MonBrightnessDown, Brightness minimum, exec, omarchy-brightness-display 1%
|
||||
bindeld = ,XF86KbdBrightnessUp, Keyboard brightness up, exec, omarchy-brightness-keyboard up
|
||||
bindeld = ,XF86KbdBrightnessDown, Keyboard brightness down, exec, omarchy-brightness-keyboard down
|
||||
bindld = ,XF86KbdLightOnOff, Keyboard backlight cycle, exec, omarchy-brightness-keyboard cycle
|
||||
|
||||
@@ -31,14 +31,9 @@ bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle
|
||||
bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight
|
||||
bindd = SUPER CTRL, Delete, Toggle laptop display, exec, omarchy-hyprland-monitor-internal toggle
|
||||
bindd = SUPER CTRL ALT, Delete, Toggle laptop display mirroring, exec, omarchy-hyprland-monitor-internal-mirror toggle
|
||||
bindl = , switch:on:Lid Switch, exec, omarchy-hyprland-monitor-internal off
|
||||
bindl = , switch:on:Lid Switch, exec, omarchy-hw-external-monitors && omarchy-hyprland-monitor-internal off
|
||||
bindl = , switch:off:Lid Switch, exec, omarchy-hyprland-monitor-internal on
|
||||
|
||||
# Control Apple Display brightness
|
||||
bindd = CTRL, F1, Apple Display brightness down, exec, omarchy-brightness-display-apple -5000
|
||||
bindd = CTRL, F2, Apple Display brightness up, exec, omarchy-brightness-display-apple +5000
|
||||
bindd = SHIFT CTRL, F2, Apple Display full brightness, exec, omarchy-brightness-display-apple +60000
|
||||
|
||||
# Captures
|
||||
bindd = , PRINT, Screenshot, exec, omarchy-capture-screenshot
|
||||
bindd = ALT, PRINT, Screenrecording, exec, omarchy-menu screenrecord
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
"ui.bufferline.active" = { fg = "foreground", bg = "background", underline = { color = "color5", style = "line" } }
|
||||
|
||||
"ui.text" = "foreground"
|
||||
"ui.text.focus" = { fg = "foreground", modifiers = ["bold"] }
|
||||
"ui.text.focus" = { fg = "foreground", bg = "color0", modifiers = ["bold"] }
|
||||
"ui.text.inactive" = { fg = "color8" }
|
||||
"ui.text.directory" = { fg = "color4" }
|
||||
|
||||
@@ -87,8 +87,7 @@
|
||||
"ui.virtual.jump-label" = { fg = "color1", modifiers = ["bold"] }
|
||||
"ui.virtual.whitespace" = "color8"
|
||||
|
||||
"ui.selection" = { fg = "selection_foreground", bg = "selection_background" }
|
||||
"ui.selection.primary" = { fg = "selection_foreground", bg = "selection_background" }
|
||||
"ui.selection" = { bg = "color0" }
|
||||
|
||||
"ui.cursor" = { fg = "background", bg = "cursor" }
|
||||
"ui.cursor.primary" = { fg = "background", bg = "cursor" }
|
||||
@@ -99,7 +98,7 @@
|
||||
|
||||
"ui.cursorline.primary" = { bg = "color0" }
|
||||
|
||||
"ui.highlight" = { fg = "selection_foreground", bg = "selection_background", modifiers = ["bold"] }
|
||||
"ui.highlight" = { bg = "color0", modifiers = ["bold"] }
|
||||
|
||||
"ui.menu" = { fg = "foreground", bg = "background" }
|
||||
"ui.menu.selected" = { fg = "background", bg = "foreground", modifiers = ["bold"] }
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
if omarchy-battery-present; then
|
||||
cat <<EOF | sudo tee "/etc/udev/rules.d/99-power-profile.rules"
|
||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile-battery --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set battery"
|
||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile-ac --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set ac"
|
||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set"
|
||||
SUBSYSTEM=="power_supply", ATTR{type}=="USB", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-power-profile --property=After=power-profiles-daemon.service $HOME/.local/share/omarchy/bin/omarchy-powerprofiles-set"
|
||||
EOF
|
||||
|
||||
# Ensure the daemon is running and starts on boot. The arch package preset
|
||||
# leaves it disabled, which would silently break profile switching.
|
||||
sudo systemctl enable --now power-profiles-daemon
|
||||
|
||||
sudo udevadm control --reload 2>/dev/null
|
||||
sudo udevadm trigger --subsystem-match=power_supply 2>/dev/null
|
||||
fi
|
||||
|
||||
Executable → Regular
@@ -0,0 +1,3 @@
|
||||
echo "Fix power profile auto-switching on USB-C only machines and ensure power-profiles-daemon is enabled"
|
||||
|
||||
source "$OMARCHY_PATH/install/config/powerprofilesctl-rules.sh"
|
||||
Executable → Regular
@@ -5,7 +5,7 @@ background = "#060B1E"
|
||||
selection_foreground = "#060B1E"
|
||||
selection_background = "#ffcead"
|
||||
|
||||
color0 = "#060B1E"
|
||||
color0 = "#3C486D"
|
||||
color1 = "#ED5B5A"
|
||||
color2 = "#92a593"
|
||||
color3 = "#E9BB4F"
|
||||
|
||||
@@ -5,7 +5,7 @@ background = "#FFFCF0"
|
||||
selection_foreground = "#100F0F"
|
||||
selection_background = "#CECDC3"
|
||||
|
||||
color0 = "#100F0F"
|
||||
color0 = "#DAD8CE"
|
||||
color1 = "#D14D41"
|
||||
color2 = "#879A39"
|
||||
color3 = "#D0A215"
|
||||
|
||||
@@ -5,7 +5,7 @@ background = "#0B0C16"
|
||||
selection_foreground = "#0B0C16"
|
||||
selection_background = "#ddf7ff"
|
||||
|
||||
color0 = "#0B0C16"
|
||||
color0 = "#3E4058"
|
||||
color1 = "#50f872"
|
||||
color2 = "#4fe88f"
|
||||
color3 = "#50f7d4"
|
||||
|
||||
@@ -11,7 +11,7 @@ selection_foreground = "#000000"
|
||||
selection_background = "#ffffff"
|
||||
|
||||
# Normal colors (ANSI 0-7)
|
||||
color0 = "#000000"
|
||||
color0 = "#404040"
|
||||
color1 = "#a4a4a4"
|
||||
color2 = "#b6b6b6"
|
||||
color3 = "#cecece"
|
||||
|
||||
@@ -11,7 +11,7 @@ selection_foreground = "#ffffff"
|
||||
selection_background = "#1a1a1a"
|
||||
|
||||
# Normal colors (ANSI 0-7)
|
||||
color0 = "#ffffff"
|
||||
color0 = "#c0c0c0"
|
||||
color1 = "#2a2a2a"
|
||||
color2 = "#3a3a3a"
|
||||
color3 = "#4a4a4a"
|
||||
|
||||
Reference in New Issue
Block a user