nord gnome dbus stuff
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
[general]
|
||||
fontname=Monospace 14
|
||||
selchars=-A-Za-z0-9,./?%&#:_
|
||||
scrollback=5000
|
||||
bgcolor=rgb(0,0,0)
|
||||
fgcolor=rgb(211,215,207)
|
||||
palette_color_0=rgb(0,0,0)
|
||||
palette_color_1=rgb(205,0,0)
|
||||
palette_color_2=rgb(78,154,6)
|
||||
palette_color_3=rgb(196,160,0)
|
||||
palette_color_4=rgb(52,101,164)
|
||||
palette_color_5=rgb(117,80,123)
|
||||
palette_color_6=rgb(6,152,154)
|
||||
palette_color_7=rgb(211,215,207)
|
||||
palette_color_8=rgb(85,87,83)
|
||||
palette_color_9=rgb(239,41,41)
|
||||
palette_color_10=rgb(138,226,52)
|
||||
palette_color_11=rgb(252,233,79)
|
||||
palette_color_12=rgb(114,159,207)
|
||||
palette_color_13=rgb(173,127,168)
|
||||
palette_color_14=rgb(52,226,226)
|
||||
palette_color_15=rgb(238,238,236)
|
||||
color_preset=Tango
|
||||
disallowbold=false
|
||||
cursorblinks=false
|
||||
cursorunderline=false
|
||||
audiblebell=true
|
||||
tabpos=top
|
||||
geometry_columns=80
|
||||
geometry_rows=24
|
||||
hidescrollbar=true
|
||||
hidemenubar=true
|
||||
hideclosebutton=false
|
||||
hidepointer=false
|
||||
disablef10=false
|
||||
disablealt=false
|
||||
disableconfirm=false
|
||||
|
||||
boldbright=false
|
||||
visualbell=false
|
||||
|
||||
[shortcut]
|
||||
new_window_accel=<Primary><Shift>n
|
||||
new_tab_accel=<Primary><Shift>t
|
||||
close_tab_accel=<Primary><Shift>w
|
||||
close_window_accel=<Primary><Shift>q
|
||||
copy_accel=<Primary><Shift>c
|
||||
paste_accel=<Primary><Shift>v
|
||||
name_tab_accel=<Primary><Shift>i
|
||||
previous_tab_accel=<Primary>Page_Up
|
||||
next_tab_accel=<Primary>Page_Down
|
||||
move_tab_left_accel=<Primary><Shift>Page_Up
|
||||
move_tab_right_accel=<Primary><Shift>Page_Down
|
||||
zoom_in_accel=<Primary>plus
|
||||
zoom_out_accel=<Primary>minus
|
||||
zoom_reset_accel=<Primary>0
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#1/usr/bin/env python
|
||||
import configparser
|
||||
import os
|
||||
import urllib.parse
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
c = configparser.RawConfigParser()
|
||||
c.read(sys.argv[1])
|
||||
|
||||
def input(query):
|
||||
if shutil.which("zenity"):
|
||||
return subprocess.run(["zenity", "--forms", "--add-entry=" + query], capture_output=True).stdout.decode().strip()
|
||||
#if shutil.which("xdialog"): TODO
|
||||
assert 0
|
||||
|
||||
try:
|
||||
url=c["InternetShortcut"]["URL"]
|
||||
|
||||
if not url.strip():
|
||||
c["InternetShortcut"]["URL"] = input("Set URL")
|
||||
with open(sys.argv[1], "w") as f:
|
||||
c.write(f, space_around_delimiters=False)
|
||||
exit(0)
|
||||
|
||||
if urllib.parse.urlparse(url).scheme not in ["http","https","ftp","ssh","zotero"]:
|
||||
raise Exception("Invalid scheme in URI")
|
||||
|
||||
os.execv(shutil.which("xdg-open"), ["xdg-open", url])
|
||||
assert 0
|
||||
|
||||
except Exception as e:
|
||||
print(f"{e.__class__.__name__}: {e}",file=sys.stderr)
|
||||
|
||||
exit(3)
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
#!/usb/bin/env python3
|
||||
|
||||
#run with:
|
||||
#gnome-terminal --hide-menubar --window-with-profile=manjaro -x python -i $HOME/.local/opt/python-interactive-imports.py
|
||||
|
||||
import numpy as np
|
||||
from numpy import gcd, array, arange, linspace, meshgrid
|
||||
from numpy import cos, pi, sin, exp, log, log10, sqrt
|
||||
#from math import cos, pi, sin, exp, log, log10, sqrt, acos, asin, atan
|
||||
from math import acos, asin, atan, factorial
|
||||
from statistics import *
|
||||
from pprint import pprint
|
||||
from dis import dis
|
||||
import os, sys
|
||||
import functools
|
||||
import typing
|
||||
from functools import reduce
|
||||
from pathlib import Path
|
||||
from objexplore import explore
|
||||
|
||||
p = pprint
|
||||
|
||||
def plot(x, *args, label=[]):
|
||||
import matplotlib.pyplot as plt
|
||||
for i in args:
|
||||
plt.plot(x[:len(i)], i)
|
||||
plt.show()
|
||||
|
||||
|
||||
def hist(x, bins=20):
|
||||
import matplotlib.pyplot as plt
|
||||
plt.hist(x, bins)
|
||||
plt.show()
|
||||
|
||||
def scatter(x, *args):
|
||||
import matplotlib.pyplot as plt
|
||||
for i in args:
|
||||
plt.plot(x[:len(i)], i, ".")
|
||||
plt.show()
|
||||
|
||||
def imshow(image, cmap="gray"):
|
||||
import matplotlib.pyplot as plt
|
||||
plt.imshow(image.astype(np.float32), cmap=cmap)
|
||||
plt.show()
|
||||
|
||||
def image(filepath=None, gray=False):
|
||||
if not filepath:
|
||||
import cv2
|
||||
cam = cv2.VideoCapture(0)
|
||||
s, im = cam.read() # captures image
|
||||
cv2.destroyAllWindows()
|
||||
im = im.astype(np.float64) / 256
|
||||
if not gray:
|
||||
return np.dstack((
|
||||
im[:,:,2],
|
||||
im[:,:,1],
|
||||
im[:,:,0],
|
||||
))
|
||||
else:
|
||||
return ( im[:,:,2] + im[:,:,1] + im[:,:,0]) / 3
|
||||
else:
|
||||
import matplotlib.image as mpimg
|
||||
img=mpimg.imread('image_name.png')
|
||||
|
||||
|
||||
def rad(degrees):
|
||||
return degrees * pi / 180
|
||||
|
||||
def deg(radians):
|
||||
return radians / pi * 180
|
||||
|
||||
def clip(data):
|
||||
"xclip -sel clip"
|
||||
import subprocess
|
||||
p = subprocess.Popen(("xclip", "-sel", "clip"), stdin=subprocess.PIPE)
|
||||
p.communicate(str(data).encode("utf-8"))
|
||||
|
||||
def prod(args):
|
||||
return functools.reduce(lambda x, y: x*y, args)
|
||||
|
||||
def add(*args):
|
||||
return sum(args)
|
||||
|
||||
def mul(*args):
|
||||
return prod(args)
|
||||
|
||||
|
||||
def history(n=None):
|
||||
import readline
|
||||
return "\n".join([
|
||||
readline.get_history_item(i + 1)
|
||||
for i in range(readline.get_current_history_length())
|
||||
][-(n+1) if n is not None else 0:-1])
|
||||
|
||||
|
||||
def integral(data, initial=0, step=None):
|
||||
if step is None:
|
||||
step = (data[-1] - data[0]) / len(data)
|
||||
out = [initial]
|
||||
for i in data:
|
||||
out.append(out[-1] + i*step)
|
||||
return out[1:]
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usb/bin/env python3
|
||||
|
||||
#run with:
|
||||
#gnome-terminal --hide-menubar --window-with-profile=manjaro -x python -i $HOME/.local/opt/sympy-interactive-imports.py
|
||||
|
||||
from sympy import *
|
||||
x, y, z, t = symbols('x y z t')
|
||||
k, m, n = symbols('k m n', integer=True)
|
||||
f, g, h = symbols('f g h', cls=Function)
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
Reference in New Issue
Block a user