bialyikar Jun 25, 2024 @ 5:33am
Restart Steam from Terminal or Bash Script
Hello
How to shut down and restart Steam using the Linux terminal? Or better yet, how to restart Steam using a single command (if such a command exists)?
I’m not sure if this is an issue on my end or a bug in Steam, but when I execute:
pkill '^steam$'
or
steam -shutdown
these commands not only close Steam but also log me out of my KDE session.

I’m using Kubuntu 24.04
Plasma 5.27
QT 5.15
Kernel 6.8.0

Something went wrong while displaying this content. Refresh

Error Reference: Community_9721151_
Loading CSS chunk 7561 failed.
(error: https://community.fastly.steamstatic.com/public/css/applications/community/communityawardsapp.css?contenthash=789dd1fbdb6c6b5c773d)
Showing 1-5 of 5 comments
Omega Jun 25, 2024 @ 5:57am 
The problem is that Steam launches a large collection of processes, and all of these will have to be killed to make it perform a clean shutdown.

And running `pkill steam` is just iffy, it causes Steam to behave weird while all these processes are still running before they eventually shut down.

But I do not understand why it is killing your KDE session. It shouldn't do this, unless shutting down Steam crashes it somehow.
Last edited by Omega; Jun 25, 2024 @ 5:58am
_I_ Jun 25, 2024 @ 6:02am 
for windows use a batch script
restartsteam.bat
"..\games\steam\steam.exe" -shutdown echo wait 60sec timeout 60 start ..\games\steam\steam.exe

im sure something similar can work in linux
Last edited by _I_; Jun 25, 2024 @ 12:51pm
Zygfryd Jun 25, 2024 @ 6:23am 
Install Steam via flatpak instead of the system package manager so it's containerized.

Then you can shut it all down with flatpak kill com.valvesoftware.Steam.

Start it with: xdg-open steam://open/games or in BPM: xdg-open steam://open/bigpicture.

Depending on where you intend to put the command you can chain multiple commands into one with a semicolon (command1; command2), or a shell invocation (sh -c "command1; command2") or another way.
Last edited by Zygfryd; Jun 25, 2024 @ 6:26am
[☥] - CJ - Jun 25, 2024 @ 12:39pm 
shutdown is typo'd

but yeah lol
_I_ Jun 25, 2024 @ 12:51pm 
lol oops, fixed
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Jun 25, 2024 @ 5:33am
Posts: 5