diff --git a/CHANGELOG.md b/CHANGELOG.md index 13fa3fd..bbf80b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes, per version and per commit. Versions follow `steamify.sh`. Versions before 0.7.0 were numbered afterwards, one per merged pull request. +## 1.1.3 - 2026-09-25 + +- **fix: HDMI-CEC settings shown in Steam** + - CachyOS's gaming mode script sets `STEAM_ENABLE_CEC=0`, which hides + Steam's HDMI-CEC settings (and its CEC volume buttons). HDMI-CEC now adds + a drop-in for `steam-launcher.service` that overrides it with + `STEAM_ENABLE_CEC=1` (`/etc/steamify/steam-cec.env`). + - HDMI-CEC set up by 1.1.0-1.1.2 shows as off and ticked, so a normal run + (Enter) adds this. + ## 1.1.2 - 2026-09-25 - **fix: Steam's HDMI-CEC settings reach cecd on a first run** diff --git a/TECHNICAL.md b/TECHNICAL.md index bb1f2a3..1f52744 100644 --- a/TECHNICAL.md +++ b/TECHNICAL.md @@ -192,6 +192,13 @@ devices found. Also turn on CEC on the TV `steamos-manager` writes cecd's settings from Steam's (wake the TV, put it to sleep), in `~/.config/cecd/config.d/`, and Steam shows its HDMI-CEC settings; the wizard restarts steamos-manager so that happens right away. +CachyOS's gaming mode script (`/usr/lib/steamos/gamescope-session`) sets +`STEAM_ENABLE_CEC=0`, which hides those settings; Steam reads the script's +variables from `$XDG_RUNTIME_DIR/gamescope-environment`. HDMI-CEC adds a +drop-in for `steam-launcher.service` +(`/etc/systemd/user/steam-launcher.service.d/10-steamify-cec.conf`) with a +second `EnvironmentFile=` (`/etc/steamify/steam-cec.env`, +`STEAM_ENABLE_CEC=1`), which overrides it from the next gaming mode start. It's experimental: on SteamOS itself CEC can wake the Steam Machine right after it goes to sleep (Samsung TVs, diff --git a/lib/cec.sh b/lib/cec.sh index 2b7a2bd..770df44 100644 --- a/lib/cec.sh +++ b/lib/cec.sh @@ -11,6 +11,11 @@ CEC_PKGS=(cecd cec-audio-control inputattach-cec-units) # steamos-manager checks once, at its start, whether cecd runs; order it # after cecd so it never misses it at login. CEC_ORDER_DROPIN=/etc/systemd/user/steamos-manager.service.d/10-steamify-after-cecd.conf +# CachyOS's gaming mode script exports STEAM_ENABLE_CEC=0, which hides +# Steam's HDMI-CEC settings; Steam reads it from the gamescope environment +# file. A later EnvironmentFile= overrides it. +CEC_STEAM_ENV=/etc/steamify/steam-cec.env +CEC_STEAM_DROPIN=/etc/systemd/user/steam-launcher.service.d/10-steamify-cec.conf cec_link_steamos_manager() { # On a Steam Machine: steamos-manager writes cecd's config from Steam's @@ -27,7 +32,11 @@ cec_link_steamos_manager() { return 0 } -cec_status() { pacman -Q "${CEC_PKGS[@]}" >/dev/null 2>&1; } +cec_installed() { pacman -Q "${CEC_PKGS[@]}" >/dev/null 2>&1; } +# On = installed and Steam told to show its CEC settings. An install from +# before 1.1.3 lacks the latter; the menu then ticks it (see cec_repair). +cec_status() { cec_installed && [[ -f "$CEC_STEAM_DROPIN" ]]; } +cec_repair() { cec_installed && ! cec_status; } fetch_holo_pkg() { # fetch_holo_pkg : download the newest from @@ -77,11 +86,17 @@ cec_enable() { sudo mkdir -p "$(dirname "$CEC_ORDER_DROPIN")" printf '%s\n' "# Written by Steamify: steamos-manager only sees cecd if it runs at its start." \ '[Unit]' 'After=cecd.service' | sudo tee "$CEC_ORDER_DROPIN" >/dev/null + sudo mkdir -p "$(dirname "$CEC_STEAM_ENV")" "$(dirname "$CEC_STEAM_DROPIN")" + printf '%s\n' "# Written by Steamify: Steam's HDMI-CEC settings in gaming mode." 'STEAM_ENABLE_CEC=1' | + sudo tee "$CEC_STEAM_ENV" >/dev/null + printf '%s\n' "# Written by Steamify: overrides STEAM_ENABLE_CEC=0 from the gaming mode script." \ + '[Service]' "EnvironmentFile=-$CEC_STEAM_ENV" | sudo tee "$CEC_STEAM_DROPIN" >/dev/null systemctl --user daemon-reload cec_link_steamos_manager if compgen -G "/dev/cec*" >/dev/null; then systemctl --user restart cecd.service 2>/dev/null - ok "HDMI-CEC on ($(cd /dev && echo cec*)). Turn on CEC on your TV too (e.g. Sony: BRAVIA Sync, Samsung: Anynet+, LG: SimpLink)." + ok "HDMI-CEC on ($(cd /dev && echo cec*)); Steam shows its settings from the next gaming mode start." + info "Turn on CEC on your TV too (e.g. Sony: BRAVIA Sync, Samsung: Anynet+, LG: SimpLink)." else warn "No CEC device (/dev/cec*) found: your GPU may not support CEC. A USB CEC adapter" warn "(e.g. Pulse-Eight) works too. Check again after a restart with: ls /dev/cec*" @@ -93,8 +108,8 @@ cec_disable() { systemctl --user disable --now cecd.service cec-audio-control.socket cec-audio-control.service 2>/dev/null systemctl --user disable steamos-manager-configure-cecd.service 2>/dev/null sudo pacman -Rns --noconfirm "${CEC_PKGS[@]}" 2>/dev/null - sudo rm -f "$CEC_ORDER_DROPIN" - sudo rmdir "$(dirname "$CEC_ORDER_DROPIN")" 2>/dev/null + sudo rm -f "$CEC_ORDER_DROPIN" "$CEC_STEAM_DROPIN" "$CEC_STEAM_ENV" + sudo rmdir "$(dirname "$CEC_ORDER_DROPIN")" "$(dirname "$CEC_STEAM_DROPIN")" "$(dirname "$CEC_STEAM_ENV")" 2>/dev/null systemctl --user daemon-reload if [[ -n "$(state_get cec installed_linuxconsole)" ]]; then sudo pacman -Rns --noconfirm linuxconsole 2>/dev/null diff --git a/lib/menu.sh b/lib/menu.sh index ebf6898..bf8f3cf 100644 --- a/lib/menu.sh +++ b/lib/menu.sh @@ -67,6 +67,8 @@ detect_components() { if "${c}_status"; then CURRENT[$c]=1; any=true; else CURRENT[$c]=0; fi WANTED[$c]=${CURRENT[$c]} done + # HDMI-CEC set up by an older version: tick it, so a normal run fixes it. + component_available cec && cec_repair && WANTED[cec]=1 # Shows the current and newest BIOS version. bios_available && { bios_lookup_newest; LABEL[bios]="$(bios_label)"; } # First run: preselect the full SteamOS experience (never an action). diff --git a/lib/steam-machine.sh b/lib/steam-machine.sh index 1e2d9b0..d62733b 100644 --- a/lib/steam-machine.sh +++ b/lib/steam-machine.sh @@ -351,7 +351,7 @@ kernel_overview() { fi echo -e " ${running}${line}" done - cec_status && { echo; echo -e " $(cec_overview)"; } + cec_installed && { echo; echo -e " $(cec_overview)"; } if [[ "$leds" == true ]]; then local loaded="$miss" nodes lsmod | grep -q '^leds_valve' && loaded="$mark" diff --git a/steamify.sh b/steamify.sh index 8ad3365..d83520a 100755 --- a/steamify.sh +++ b/steamify.sh @@ -15,7 +15,7 @@ set -uo pipefail # Release version, see CHANGELOG.md. -VERSION=1.1.2 +VERSION=1.1.3 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"