54 lines
943 B
Plaintext
54 lines
943 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
##/usr/bin/peppermint-system-info
|
||
|
##wrapper script for inxi to do quick "inxi -Fxrz" and copy the output to clipboard
|
||
|
##Borrowed from, and kudos to MX Linux :)
|
||
|
|
||
|
#requires xsel package
|
||
|
|
||
|
##locale stuff
|
||
|
|
||
|
TEXTDOMAINDIR=/usr/share/locale/
|
||
|
export TEXTDOMAIN="peppermint-system-info"
|
||
|
|
||
|
#setup
|
||
|
|
||
|
main(){
|
||
|
|
||
|
#check for existing of inxi
|
||
|
|
||
|
command -v inxi >/dev/null 2>/dev/null || quit_error $"Required inxi app not found"
|
||
|
|
||
|
run_report
|
||
|
|
||
|
quit
|
||
|
|
||
|
}
|
||
|
|
||
|
run_report(){
|
||
|
|
||
|
bash -c '( echo "[code]"; inxi -Fxrz -c0 ; echo "[/code]" 2>/dev/null ) | xsel -ib 2>/dev/null &'
|
||
|
echo
|
||
|
bash -c 'inxi -Fxrz 2>/dev/null'
|
||
|
echo
|
||
|
echo $"This report has been copied to system clipboard
|
||
|
(if requested, you can paste this information directly into the Peppermint Forum)"
|
||
|
|
||
|
}
|
||
|
|
||
|
quit(){
|
||
|
echo
|
||
|
read -n 1 -s -r -p $"Press any key to close"
|
||
|
exit 0
|
||
|
}
|
||
|
|
||
|
quit_error(){
|
||
|
local msg
|
||
|
msg=$1t
|
||
|
echo "$msg"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
main "$@"
|
||
|
|