#steam #parser #file-format #api

steam_shortcuts_util

Utilities for parsing & writing Steams shortcut.vdf file format

9 stable releases

1.1.8 May 20, 2022
1.1.7 Apr 18, 2022
1.1.5 Oct 23, 2021
1.1.4 Sep 28, 2021
1.0.0 Aug 29, 2021

#1223 in Parser implementations

Download history 35/week @ 2024-03-12 19/week @ 2024-03-19 10/week @ 2024-03-26 36/week @ 2024-04-02 6/week @ 2024-04-09 15/week @ 2024-04-16 14/week @ 2024-04-23 8/week @ 2024-04-30 9/week @ 2024-05-07 20/week @ 2024-05-14 14/week @ 2024-05-21 19/week @ 2024-05-28 20/week @ 2024-06-04 17/week @ 2024-06-11 15/week @ 2024-06-18 21/week @ 2024-06-25

75 downloads per month
Used in nvidia-gamestream-presets…

MIT/Apache

35KB
702 lines

Steam Shortcuts utility

Steam Shortcuts is a utility crate that helps you to manage your Steam shortcuts. It is a simple Rust crate that provides a simple interface to manage your Steam shortcuts.

Getting started

First include the crate in your project:

[dependencies]
steam_shortcuts_util = "1.0.0"

Then you can use it:

 use steam_shortcuts_util::parse_shortcuts;
 use steam_shortcuts_util::shortcuts_to_bytes;

 fn example() -> Result<(), Box<dyn std::error::Error>> {
     // This path should be to your steam shortcuts file
     // Usually located at $SteamDirectory/userdata/$SteamUserId/config/shortcuts.vdf
     let content = std::fs::read("src/testdata/shortcuts.vdf")?;
     let shortcuts = parse_shortcuts(content.as_slice())?;
     assert_eq!(shortcuts[0].app_name, "Celeste");
     assert_eq!(3, shortcuts[0].tags.len());

     let shortcut_bytes_vec = shortcuts_to_bytes(&shortcuts);
     assert_eq!(shortcut_bytes_vec, content);
     Ok(())
 }

Be aware that if you overwrite the shortcuts.vdf file, you will have to restart Steam for the changes to take effect.

Dependencies

~1.5MB
~26K SLoC