diff --git a/debian/control b/debian/control index d0effb3..7bcb4a5 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Package: xapps-common Architecture: all Multi-Arch: foreign -Depends: ${misc:Depends}, ${python:Depends}, python, python-gi +Depends: ${misc:Depends}, ${python:Depends}, python, python-gi, inxi, xdg-utils, gist Description: Common files for XApp desktop apps This package includes files that are shared between several XApp apps (i18n files and configuration schemas). diff --git a/files/usr/bin/pastebin b/files/usr/bin/pastebin new file mode 100755 index 0000000..3f74cf5 --- /dev/null +++ b/files/usr/bin/pastebin @@ -0,0 +1,26 @@ +#!/usr/bin/python3 + +import sys +import os +import stat +import subprocess + +content = "" + +mode = os.fstat(0).st_mode +if stat.S_ISFIFO(mode): + content = sys.stdin.read() +elif stat.S_ISREG(mode): + content = sys.stdin.read() +else: + args = sys.argv[1:] + if len(args) == 1 and os.path.exists(args[0]): + with open(args[0], 'r') as infile: + content = infile.read() + else: + str_args = ' '.join(args) + content = str_args + +if content != "": + p = subprocess.Popen(["/usr/bin/gist-paste"], stdin=subprocess.PIPE) + p.communicate(content.encode("UTF-8")) diff --git a/files/usr/bin/upload-system-info b/files/usr/bin/upload-system-info new file mode 100755 index 0000000..2aae243 --- /dev/null +++ b/files/usr/bin/upload-system-info @@ -0,0 +1,11 @@ +#!/usr/bin/python3 + +import subprocess + +inxi = subprocess.Popen(['inxi', '-Fxxrzc0'], stdout=subprocess.PIPE) +gist = subprocess.Popen(['gist-paste'], stdin=inxi.stdout, stdout=subprocess.PIPE) +inxi.stdout.close() +output = gist.communicate()[0] +gist.wait() + +subprocess.call(['xdg-open', output])