SMAPI icon indicating copy to clipboard operation
SMAPI copied to clipboard

Modify launch script to autohide terminal on the Steam Deck

Open HellishINC opened this issue 2 years ago • 2 comments

I'm not 100% certain that I edited the correct file. It appears to be but it differs slightly (due to modification by the installer?).

Quick rundown of what this does.

cat /etc/os-release reads and prints the file "os-release" in this case to the buffer. (Let's pretend this isn't from my desktop. Copying text from/to the Deck is a PITA.)

NAME="Arch"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux-logo

This is then piped into sed -n '1p'. This takes the current buffer and drops everything but the first line.

NAME="Arch"

This is then further piped into awk '{print substr($1,7,7)}' which starts reading from the 7th character (in this case the A) and reads until the 7th character.

On my desktop this yields an invalid result and SMAPI runs as normal. If it matches the expected "SteamOS" the terminal is hidden.

HellishINC avatar Mar 18 '22 04:03 HellishINC

I'm a bit stumped. The script works when called directly from either a terminal or file manager but when ran through steam it still shows the terminal and even stranger, in desktop mode it tries to launch the windows version of the game.

HellishINC avatar Mar 18 '22 04:03 HellishINC

The main terminal logic for Linux does something like this:

if not USE_CURRENT_SHELL:
    open terminal;

else if SKIP_TERMINAL:
    launch without console output;

else
    launch with console output;

You set SKIP_TERMINAL later in the script, after the check which sets USE_CURRENT_SHELL=true, so that first block still gets run. Checking for SteamOS earlier in the script (e.g. between "Read environment variables" and "Read command-line arguments") should fix that.

Pathoschild avatar Mar 20 '22 02:03 Pathoschild

I'll close this since it's still a draft, and I don't have a Steam Deck to finish & test it myself. Feel free to submit a new pull request if you can address the above comments. Thanks for the PR though!

Pathoschild avatar Oct 09 '22 16:10 Pathoschild

Stop sending me this shit

On Fri, 18 Mar 2022 at 05.25, Helly @.***> wrote:

I'm not 100% certain that I edited the correct file. It appears to be but it differs slightly (due to modification by the installer?).

Quick rundown of what this does.

cat /etc/os-release reads and prints the file "os-release" in this case to the buffer. (Let's pretend this isn't from my desktop. Copying text from/to the Deck is a PITA.)

NAME="Arch" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://bugs.archlinux.org/" LOGO=archlinux-logo

This is then piped into sed -n '1p'. This takes the current buffer and drops everything but the first line.

NAME="Arch"

This is then further piped into awk '{print substr($1,7,7)}' which starts reading from the 7th character (in this case the A) and reads until the 7th character.

On my desktop this yields an invalid result and SMAPI runs as normal. If it matches the expected "SteamOS" the terminal is hidden.

You can view, comment on, or merge this pull request online at:

https://github.com/Pathoschild/SMAPI/pull/834 Commit Summary

File Changes

(1 file https://github.com/Pathoschild/SMAPI/pull/834/files)

Patch Links:

  • https://github.com/Pathoschild/SMAPI/pull/834.patch
  • https://github.com/Pathoschild/SMAPI/pull/834.diff

— Reply to this email directly, view it on GitHub https://github.com/Pathoschild/SMAPI/pull/834, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLXOXFTMQC5TYICTZIKYKDVAQAVJANCNFSM5RAYL4WA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

OliviaKimberly19 avatar Oct 09 '22 16:10 OliviaKimberly19

...you do know you're getting sent those, because YOU subscribed? Just unsubscribe.

Shockah avatar Oct 09 '22 16:10 Shockah

@OliviaKimberly19 There's an unsubscribe link at the bottom of each email you get.

Pathoschild avatar Oct 09 '22 16:10 Pathoschild