From b5c2bd2504eb3b092561fca2d125a23eca5f105a Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 16 Jan 2017 19:50:49 +0100 Subject: Added PPA script --- Scripts/JUUPPA.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Scripts/JUUPPA.py diff --git a/Scripts/JUUPPA.py b/Scripts/JUUPPA.py new file mode 100644 index 0000000..cc70ff5 --- /dev/null +++ b/Scripts/JUUPPA.py @@ -0,0 +1,52 @@ +import requests, bs4, re, os, sys + +def getPPA(link): + m = re.search('\/.(.*)\/\+archive\/\w*\/(.*)', link) + if m != None: + return m.group(1) + "/" + m.group(2) + else: + return "Sorry could not find PPA" + +res = requests.get("https://launchpad.net/ubuntu/+ppas?name_filter=" + sys.argv[1]) + + +soup = bs4.BeautifulSoup(res.text, "html.parser") + +element = soup.find("table", {"class" : "listing"}) +if element != None: + elements = element.find("tbody").find_all("tr") + + count = len(elements) + results = [] + + print("Found", len(elements),"results:\n") + for item in reversed(elements): + count -= 1 + name = item.find("td").find("a").string + PPA = getPPA(item.find("td").find("a")["href"]) + sources = item.find_all("td")[-2].string + binaries = item.find_all("td")[-1].string + + results.append((name, PPA, sources, binaries)) + + print("Option number", count) + print("Name :", name) + print("PPA :", PPA) + print("Sources :", sources) + print("Binaries :", binaries) + print("") + + + print("Please select PPA", 0, "to", len(results)) + index = int(input("Number: ")) + + print("Adding PPA", results[index-1][1], "with command 'sudo add-apt-repository ppa:" + results[index-1][1] + "'" + str(index-1)) + os.system("sudo add-apt-repository ppa:" + results[index-1][1]) + + print("Updating packages") + os.system("sudo apt update") + + print("Installing", "grub-customizer") + os.system("sudo apt install " + "grub-customizer") +else: + print("No results where found for", sys.argv[1]) \ No newline at end of file -- cgit v1.2.3 From d1717b178c6a346f7b29e3c9247e971c20e1ec69 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 16 Jan 2017 19:52:32 +0100 Subject: Added more scripts --- Scripts/Scanner.py | 31 +++++++++++++++++++++++++++++++ Scripts/makeGif.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100755 Scripts/Scanner.py create mode 100755 Scripts/makeGif.py diff --git a/Scripts/Scanner.py b/Scripts/Scanner.py new file mode 100755 index 0000000..04538c4 --- /dev/null +++ b/Scripts/Scanner.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import getch +import os + +page = 0 + +name = input("Enter name of pdf: ") + +while(1): + print("Press q for exit, Space for scanning, and d for done") + x = getch.getch() + if(x == 'q'): + exit() + elif(x == ' '): + print("Starting scan of page " + str(page+1)) + os.system("scanimage --device genesys:libusb:001:004 --format=tiff > scan" + str(page) + ".tiff") + page += 1 + print("Scan done") + elif(x == 'd'): + print("Collecting tiff pages") + os.system("tiffcp scan*.tiff magazine.tiff"); + print("Making pdf file") + os.system("convert magazine.tiff '" + name + ".pdf'") + print("Removing tiffs") + os.system("rm *.tiff") + print("Done resetting vars") + page = 0 + name = input("Enter name of pdf: ") + + diff --git a/Scripts/makeGif.py b/Scripts/makeGif.py new file mode 100755 index 0000000..5a5ac98 --- /dev/null +++ b/Scripts/makeGif.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +import sys +import argparse +import os + +parser = argparse.ArgumentParser() +parser.add_argument('-s', '--start', + required=False, + type=int, + default=0, + dest="start", + help="Time to start gif at. [0]" ) +parser.add_argument('-l', '--lenght', + required=True, + type=int, + dest="lenght", + help="Lenght of gif in seconds" ) +parser.add_argument('-i', '--infile', + required=True, + type=str, + dest="infile", + help="Movie to convert" ) +parser.add_argument('-o', '--outfile', + required=False, + type=str, + default="output.gif", + dest="outfile", + help="Output gif name. [output.gif]") +parser.add_argument('-f', '--fps', + required=False, + type=int, + default=10, + dest="fps", + help="Frames per second. [10]") +parser.add_argument('-r', '--resolution', + required=False, + type=int, + default=320, + dest="res", + help="Resolution. [320]") +args = parser.parse_args() + + +os.system("ffmpeg -y -ss " + str(args.start) + " -t " + str(args.lenght) + " -i '" + args.infile + "' -vf fps=" + str(args.fps) + ",scale=" + str(args.res) + ":-1:flags=lanczos,palettegen palette.png") + +string = 'fps=' + str(args.fps) + ',scale=' + str(args.res) + ':-1:flags=lanczos[x];[x][1:v]paletteuse' + +os.system('ffmpeg -ss ' + str(args.start) + ' -t ' + str(args.lenght) + ' -i "' + args.infile + '" -i palette.png -filter_complex "' + string + '" "' + args.outfile + '"') + +os.remove("palette.png") + +print("\n\nDONE - your file " + args.outfile + " is ready. Have a nice day :-D") -- cgit v1.2.3 From d2dc145a765763281efb837d76d5e2fd221f6d39 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 16 Jan 2017 19:53:53 +0100 Subject: Lol --- .../xfconf/xfce-perchannel-xml/xfce4-panel.xml | 311 ++++++++++++++++++--- .zshrc | 6 + 2 files changed, 278 insertions(+), 39 deletions(-) diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml index 3c99b12..4d8ec94 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml @@ -1,79 +1,312 @@ - - - + + - - + - - - - + + + + + + + + - + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - - - - - - - - + + + + + + + + + + + - + + - + + + + + + + + + + + + - + + + + + - - + + + + + - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.zshrc b/.zshrc index 130993e..7168d17 100644 --- a/.zshrc +++ b/.zshrc @@ -103,3 +103,9 @@ fi alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' + + +alias pacman="~/Scripts/pacman" +alias sudo='sudo ' +alias python="python3" + -- cgit v1.2.3