From 0bba7d316b8bd7525bf755dbe3c20ad0e98cfcba Mon Sep 17 00:00:00 2001 From: Aarron Lee Date: Thu, 22 Aug 2024 16:55:59 -0400 Subject: [PATCH] feat(ujust): add post-gamescope-logs ujust (#1533) Co-authored-by: Aarron Lee --- .../usr/share/ublue-os/just/80-bazzite.just | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/80-bazzite.just b/system_files/desktop/shared/usr/share/ublue-os/just/80-bazzite.just index a266c95059..680cbb40aa 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/just/80-bazzite.just +++ b/system_files/desktop/shared/usr/share/ublue-os/just/80-bazzite.just @@ -342,3 +342,55 @@ bazzite-cli: benchmark: echo 'Running a 1 minute benchmark ...' cd /tmp && stress-ng --matrix 0 -t 1m --times + +post-gamescope-logs: + #!/usr/bin/bash + OUTPUT_FILE="/tmp/gathered_info.txt" + + # Clear the output file or create it if it doesn't exist + > "$OUTPUT_FILE" + + # Gather information from various sources + { + echo "GPU info" + lshw -C display + + # Add a blank line for readability + echo + + filepaths=( + "/sys/devices/virtual/dmi/id/bios_date" + "/sys/devices/virtual/dmi/id/board_name" + "/sys/devices/virtual/dmi/id/board_vendor" + "/sys/devices/virtual/dmi/id/product_name" + "$HOME/.gamescope-cmd.log" + "$HOME/.gamescope-stdout.log" + ) + + # Iterate over each file path in the array + for filepath in "${filepaths[@]}"; do + # Print the file path + echo "File: $filepath" + + # Check if the file exists before trying to read it + if [[ -f "$filepath" ]]; then + # Print the file content + cat "$filepath" + else + echo "File not found: $filepath" + fi + + # Add a blank line for readability + echo + done + + echo "----- Contents of $HOME/.config/environment.d/ -----" + mkdir -p $HOME/.config/environment.d + cat "$HOME/.config/environment.d/"* 2>/dev/null || echo "No files found in $HOME/.config/environment.d/" + + } >> "$OUTPUT_FILE" + + fpaste $OUTPUT_FILE + + # cleanup output file + rm -rf $OUTPUT_FILE \ No newline at end of file