fix: Show the HDMI-CEC settings in Steam

CachyOS's gaming mode script sets STEAM_ENABLE_CEC=0. A drop-in for
steam-launcher.service overrides it with a later EnvironmentFile=.
This commit is contained in:
theupriser committed 2026-09-25 13:16:48 +02:00
1 parent 9aef0a986a
commit ce75e895c4
3 files changed
+26 -3

No files matched your search

+5
View File
@@ -12,6 +12,11 @@ one per merged pull request.
steamos-manager; so steamos-manager's `configure-cecd` unit couldn't be steamos-manager; so steamos-manager's `configure-cecd` unit couldn't be
enabled and cecd ran without Steam's settings. Steam Machine support now enabled and cecd ran without Steam's settings. Steam Machine support now
links them once steamos-manager is there. links them once steamos-manager is there.
- **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`).
## 1.1.1 - 2026-09-25 ## 1.1.1 - 2026-09-25
+7
View File
@@ -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 `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 sleep), in `~/.config/cecd/config.d/`, and Steam shows its HDMI-CEC
settings; the wizard restarts steamos-manager so that happens right away. 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 It's experimental: on SteamOS itself CEC can wake the Steam Machine right
after it goes to sleep (Samsung TVs, after it goes to sleep (Samsung TVs,
+14 -3
View File
@@ -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 # steamos-manager checks once, at its start, whether cecd runs; order it
# after cecd so it never misses it at login. # after cecd so it never misses it at login.
CEC_ORDER_DROPIN=/etc/systemd/user/steamos-manager.service.d/10-steamify-after-cecd.conf 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() { cec_link_steamos_manager() {
# On a Steam Machine: steamos-manager writes cecd's config from Steam's # On a Steam Machine: steamos-manager writes cecd's config from Steam's
@@ -77,11 +82,17 @@ cec_enable() {
sudo mkdir -p "$(dirname "$CEC_ORDER_DROPIN")" sudo mkdir -p "$(dirname "$CEC_ORDER_DROPIN")"
printf '%s\n' "# Written by Steamify: steamos-manager only sees cecd if it runs at its start." \ 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 '[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 systemctl --user daemon-reload
cec_link_steamos_manager cec_link_steamos_manager
if compgen -G "/dev/cec*" >/dev/null; then if compgen -G "/dev/cec*" >/dev/null; then
systemctl --user restart cecd.service 2>/dev/null 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 else
warn "No CEC device (/dev/cec*) found: your GPU may not support CEC. A USB CEC adapter" 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*" warn "(e.g. Pulse-Eight) works too. Check again after a restart with: ls /dev/cec*"
@@ -93,8 +104,8 @@ cec_disable() {
systemctl --user disable --now cecd.service cec-audio-control.socket cec-audio-control.service 2>/dev/null 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 systemctl --user disable steamos-manager-configure-cecd.service 2>/dev/null
sudo pacman -Rns --noconfirm "${CEC_PKGS[@]}" 2>/dev/null sudo pacman -Rns --noconfirm "${CEC_PKGS[@]}" 2>/dev/null
sudo rm -f "$CEC_ORDER_DROPIN" sudo rm -f "$CEC_ORDER_DROPIN" "$CEC_STEAM_DROPIN" "$CEC_STEAM_ENV"
sudo rmdir "$(dirname "$CEC_ORDER_DROPIN")" 2>/dev/null sudo rmdir "$(dirname "$CEC_ORDER_DROPIN")" "$(dirname "$CEC_STEAM_DROPIN")" "$(dirname "$CEC_STEAM_ENV")" 2>/dev/null
systemctl --user daemon-reload systemctl --user daemon-reload
if [[ -n "$(state_get cec installed_linuxconsole)" ]]; then if [[ -n "$(state_get cec installed_linuxconsole)" ]]; then
sudo pacman -Rns --noconfirm linuxconsole 2>/dev/null sudo pacman -Rns --noconfirm linuxconsole 2>/dev/null