#!/bin/python import os import pyperclip MyTerm = os.environ["TERMINAL"] def usewmctrl(this, isterm = False): beforeor = 'wmctrl -a ' + this + ' || ' if isterm is True: return beforeor + MyTerm + ' -t ' + this + ' -e ' + this else: return beforeor + this urlsubs = { "www.twitter.com": "www.nitter.cc", "www.reddit.com": "www.libredd.it", "www.youtube.com": "www.invidious.xyz", "www.instagram.com": "www.bibliogram.art", } def rewrite(meme): if meme in urlsubs: return urlsubs.get(meme) try: request.redirect(request.request_url) except: pass MyEmail = usewmctrl(os.environ["BROWSER"]) #print(pyperclip.paste()) print(rewrite("twitter.com")) #os.system(MyEmail)