Stop offering Steam games as applications
Steam writes a desktop entry for every game somebody asks for a shortcut
to, and it starts the same program the client's own entry does:
Exec=steam steam://rungameid/3527290
The scan only ever looked at the first token, found steam there, and filed
the game under the same kind as the client. So PEAK sat in the applications
list reading "on (Steam)", counted towards the applications covered, and
offered a space bar to switch it off again - as though it were something
this program had anything to offer. It is not: a game is whatever engine it
was built with, and none of them reads a Chromium argument.
An entry carrying a steam:// address of its own is not a program, it is one
more way of starting Steam. The client's own entry never has one - it takes
an address from the outside, through %U - and that is what tells the two
apart. Those entries go to the Steam module now instead of into the list.
They keep -noverifyfiles, for the same reason the rest of the Steam handling
has it: starting a game with the client closed is a Steam start like any
other, and without the switch it finds the patched web helper script, puts
its own copy back, and the interface loses autoscroll for the rest of the
session.
This commit is contained in:
1 parent
f42d80598f
commit
bd84c6645a
4 files changed
+53
No files matched your search
@@ -125,6 +125,12 @@ as soon as it is set to run at login: that one bypasses the menu entry entirely,
|
||||
and without the switch a Steam started at login finds the patched script,
|
||||
restores it, gets patched again, and never gets past its update dialog.
|
||||
|
||||
The shortcuts Steam writes for single games get the switch as well. A game is
|
||||
not an application this program has anything to offer — none of them is a
|
||||
Chromium process and none appears in the applications list — but starting one
|
||||
with Steam closed is a Steam start like any other, and leaving the switch out
|
||||
there costs the interface its autoscroll for the rest of the session.
|
||||
|
||||
**The trade-off is real**: with verification off, Steam no longer repairs a
|
||||
damaged installation by itself. That is why Steam is a switch of its own rather
|
||||
than part of the general handling — turn it off in the settings and Steam is
|
||||
|
||||
@@ -107,6 +107,12 @@ an update dialog. The trade-off is that Steam no longer repairs a damaged
|
||||
installation on its own; that is why Steam is a switch of its own in the
|
||||
settings.
|
||||
|
||||
The shortcuts Steam writes for single games carry the switch too. A game is not
|
||||
an application this program has anything to offer and none of them is listed
|
||||
under *Applications*, but starting one with Steam closed is a Steam start like
|
||||
any other, and without the switch it costs the interface its autoscroll for the
|
||||
rest of the session.
|
||||
|
||||
Starting Steam some other way - from a terminal, from a script - leaves the
|
||||
switch out, and Steam puts its own copy of the script back for that session.
|
||||
The patch returns at the next apply with Steam closed. It is deliberately not
|
||||
|
||||
@@ -107,6 +107,17 @@ mca_apply() {
|
||||
mca_steam_apply
|
||||
fi
|
||||
|
||||
# The shortcuts Steam writes for single games. They are not applications
|
||||
# and are not offered as ones, but starting a game with Steam closed is a
|
||||
# Steam start like any other: without the switch the client finds the
|
||||
# patched helper script, puts its own back, and the interface loses
|
||||
# autoscroll for the rest of the session.
|
||||
if [[ $CFG_STEAM == yes ]]; then
|
||||
for i in "${!MCA_STEAM_LINKS[@]}"; do
|
||||
mca_steam_desktop_apply "${MCA_STEAM_LINKS[i]}" "${MCA_STEAM_LINK_FILES[i]}"
|
||||
done
|
||||
fi
|
||||
|
||||
# Steam's autostart entry carries Steam's own switch and follows the Steam
|
||||
# setting, not this one - leaving it out while Steam is patched is what puts
|
||||
# the client in an update loop - so both are checked inside.
|
||||
|
||||
@@ -180,6 +180,21 @@ mca_exec_flatpak_id() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# mca_exec_is_steam_link <exec line> <program>
|
||||
# Whether an entry starts something inside Steam rather than starting Steam
|
||||
# itself: it carries a steam:// address of its own. Steam writes one of those
|
||||
# for every game somebody asks for a shortcut to, and the client's own entry
|
||||
# never has one - it takes an address from the outside, through %U.
|
||||
mca_exec_is_steam_link() {
|
||||
local line="$1" prog="$2"
|
||||
|
||||
[[ $line == *steam://* ]] || return 1
|
||||
case "${prog##*/}" in
|
||||
steam|steam-runtime) return 0 ;;
|
||||
esac
|
||||
[[ $prog == flatpak:com.valvesoftware.Steam ]]
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Is this Chromium?
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -401,6 +416,14 @@ MCA_NAMES=() # display name
|
||||
MCA_PROGS=() # resolved program, or a flatpak app id
|
||||
MCA_KINDS=() # app | browser | flatpak | steam | unknown | no
|
||||
|
||||
# The shortcuts Steam writes for single games. Not applications of their own - a
|
||||
# game is whatever engine it was built with, and none of those reads a Chromium
|
||||
# argument - so they are kept apart from the list rather than listed as
|
||||
# something that got switched on. They do start Steam, which is why they are
|
||||
# kept at all: the Steam module gives them Steam's own switch.
|
||||
MCA_STEAM_LINKS=() # desktop file id
|
||||
MCA_STEAM_LINK_FILES=() # the entry that is in effect for it
|
||||
|
||||
# A scan reads every desktop entry on the system, so the menu does it once and
|
||||
# then redraws from what it found. Applying rescans on its own, so nothing else
|
||||
# has to remember to invalidate this.
|
||||
@@ -417,6 +440,7 @@ mca_scan() {
|
||||
local -a c_ids=() c_files=() c_names=() c_progs=() c_browser=() c_stat=()
|
||||
|
||||
MCA_IDS=(); MCA_FILES=(); MCA_NAMES=(); MCA_PROGS=(); MCA_KINDS=()
|
||||
MCA_STEAM_LINKS=(); MCA_STEAM_LINK_FILES=()
|
||||
|
||||
# Pass one: read the entries and work out what each of them starts. No
|
||||
# detection yet - that needs a stat per program, and those are collected so
|
||||
@@ -454,6 +478,12 @@ mca_scan() {
|
||||
prog="flatpak:$MCA_PROG"
|
||||
fi
|
||||
|
||||
if mca_exec_is_steam_link "$exec_line" "$prog"; then
|
||||
MCA_STEAM_LINKS+=("$id")
|
||||
MCA_STEAM_LINK_FILES+=("$file")
|
||||
continue
|
||||
fi
|
||||
|
||||
c_ids+=("$id"); c_files+=("$file"); c_names+=("$name")
|
||||
c_progs+=("$prog")
|
||||
if mca_desktop_is_browser; then c_browser+=(1); else c_browser+=(0); fi
|
||||
|
||||
Reference in new issue
Block a user