Skip to content

Instantly share code, notes, and snippets.

@NoXPhasma
Last active October 31, 2022 13:31
Show Gist options
  • Save NoXPhasma/0bcf78292b7ce3f22ade7e0c01d7e410 to your computer and use it in GitHub Desktop.
Save NoXPhasma/0bcf78292b7ce3f22ade7e0c01d7e410 to your computer and use it in GitHub Desktop.
Copy sytem information for ProtonDB
#! /bin/bash
# To copy the output to your clipboard, you'll need to install
# `xclip` if you are on xserver and `wl-clipboard` if you are on wayland.
function sysinfo(){
echo -e "System Info:\n\n\nProcessor Information:\n CPU: $(grep 'model name'\
< /proc/cpuinfo | head -1 | cut -d':' -f2)\n \n\nOperating System Ve\
rsion:\n OS: $(lsb_release -d | cut -d':' -f2) $(lsb_release -r | cut \
-d':' -f2 | tr -d '\t')\n Kernel Name: Linux\n Kernel Version: $(uname -\
r)\n \n\nVideo Card:\n GPU: $(lspci | grep VGA | cut -d'[' -f2 | cut -d']' \
-f1)\n Driver Version: $(glxinfo | grep 'OpenGL version string' | cut -d':'\
-f2 | cut -d')' -f2)\n \n \n \n \n\n\n\nMemory:\n RAM: $(($(grep MemTotal\
/proc/meminfo | tr -s ' ' | cut -d' ' -f2) / 1024)) Mb\n"
}
case "$1" in
xclip)
sysinfo | xclip -sel clip
notify-send 'System info copied to your clipboard!'
;;
wl-clipboard)
sysinfo | wl-clipboard
notify-send 'System info copied to your clipboard!'
;;
*)
sysinfo
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment