-
Notifications
You must be signed in to change notification settings - Fork 0
/
.xonshrc
134 lines (105 loc) · 5.17 KB
/
.xonshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# XONSH WEBCONFIG START
# text that appears on new line before command
$PROMPT = '[{env_name}{BOLD_GREEN}{user} {cwd}]{BOLD_BLUE}{prompt_end} '
# {curr_branch: {}}{NO_COLOR} {BOLD_BLUE}{prompt_end}{NO_COLOR} {branch_color}
$XONSH_STYLE_OVERRIDES["completion-menu"] = "bg:#2f2f2f #60b48a"
# general oneliner aliases
aliases["cls"] = "clear"
# aliases["gwe"] = "flatpak run com.leinardi.gwe" #not needed now has aur
aliases["waifu2x"] = "waifu2x-ncnn-vulkan"
aliases["kiwix"] = "env XDG_CONFIG_HOME=/usr/share/color-schemes/Breath.colors kiwix-desktop"
aliases["ds2"] = "sudo -E python /home/yobleck/old_projects/ds2_mouse_fix/mouse.py"
aliases["yt"] = "python /home/yobleck/yt-py-ncurses/youtube_main.py"
aliases["twitch"] = "python /home/yobleck/twitch-py-cli/main.py" #cd /home/yobleck/twitch-py-cli;
aliases["songrater"] = "python /home/yobleck/Music/song_rater/song_rater.py"
aliases["hack_text"] = "python /home/yobleck/old_projects/hack_text.py"
aliases["startup"]= "sudo echo start; bash /home/yobleck/fah/fah_stats.sh &; sudo -E python /home/yobleck/desktop_scroll/scroll.py &"
aliases["flash"] = "cd /home/yobleck/flashpoint/Flashpoint_8.1_Infinity/Launcher/; ./flashpoint-launcher"
aliases["mount_ht"] = "sshfs htpc@10.0.0.36:/home/htpc/storage /home/yobleck/ht/storage"
aliases["unmount_ht"] = "fusermount -u /home/yobleck/ht/storage"
aliases["lock"] = "i3lock --pass-media-keys --timecolor=00ff00 --datecolor=00ff00 --blur 5 --clock --timestr=\"%H:%M\" --datestr=\"%Y-%m-%d\"" #--color 001100cc
aliases["weather"] = "curl wttr.in/Williston+VT" #"curl v2.wttr.in/Williston+VT" only supports metric
aliases["diff"] = "diff --color"
aliases["black"] = "black --diff --color"
aliases["git"] = "xonsh ~/Videos/ascii_rick/git_gud.xsh"
aliases["sublime"] = "subl"
# aliases["FAHClient"] = "cd /home/yobleck/fah; FAHClient"
# fix ls color issue
${"LS_COLORS"}["ow"] = ('BLUE',)
# aliases that require special attention to run. mostly ncurses related stuff
aliases["gtav_radio"] = "cd /home/yobleck/gtav_radio; python gtav_radio.py"
from xonsh.commands_cache import predict_false
__xonsh__.commands_cache.threadable_predictors['python'] = predict_false
aliases["mocs"] = "python /home/yobleck/.moc/sort/sorter.py"
__xonsh__.commands_cache.threadable_predictors['mocs'] = lambda args: False
$NNN_PLUG="p:mocplay;d:dragndrop"; $NNN_TRASH=1; $LC_COLLATE="C"; #NNN_SSHFS
aliases["nnn"] = "nnn -H"; #breaks nnn. shows keycodes on screen
__xonsh__.commands_cache.threadable_predictors['nnn'] = lambda args: False
# these functions dont clear the screen correctly maybe still use bash watch function
def cpuclock():
import sys, time # have to use python time so ctrl C works
while(True):
# this redraws cleaner than clear(cls) "\033[F"=go to beginning of previous line
print("\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F")
echo "temperature:"
print(int($(cat /sys/class/hwmon/hwmon1/temp1_input))/1000) #change temp1 to temp2 (Tctl to Tdie)
# measure Icore and Isoc with curr1-2 measure Vcore and Vsoc with in0-1 both in milliamps
echo "clock speeds:"
cat /proc/cpuinfo | grep '^[c]pu MHz'
time.sleep(2)
def gpuinfo():
import time
print("\033[H\033[2J")
while True:
print("\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F\033[F") #add clearline character \33[2K
nvidia-smi --query-gpu=clocks.current.graphics --format=csv
nvidia-smi --query-gpu=clocks.current.memory --format=csv
nvidia-smi --query-gpu=memory.used --format=csv
nvidia-smi --query-gpu=temperature.gpu --format=csv
nvidia-smi --query-gpu=fan.speed --format=csv
nvidia-smi --query-gpu=power.draw --format=csv
time.sleep(2)
def FAHClient_filter():
if($PWD != "/home/yobleck/fah"):
cd "/home/yobleck/fah"
print("wrong folder")
sleep 1
$[FAHClient]
#else:
#$[FAHClient]
aliases["fahclient"] = FAHClient_filter
def fahthrottle(per):
[$[cpulimit -p @(x) -l @(per)] for x in [$(pgrep FahCore_21).strip("\n"), $(pgrep FahCore_22).strip("\n")] if(x)]
notify-send -u critical "GPU WU Done"
def fahsleep(timer): #format timer as "1.5h"
sleep @(timer); FAHClient --send-pause; kill -2 @$(pgrep FAHControl); kill -2 @$(pgrep FAHClient); shutdown -h 1
def timer():
import time
t1 = time.perf_counter()
while True:
t2 = time.perf_counter() - t1
hour = int(t2/3600)
minute = int((t2-(hour*3600))/60)
sec = int(t2-(hour*3600)-(minute*60))
ms = t2 - int(t2)
print(f" {hour:02d}:{minute:02d}:{sec:02d}{str(ms)[1:4]}" , end="\r") # TODO hide cursor
def alarm(amount):
sleep @(amount)
for _ in range(10):
print("\a")
sleep 1
# add surf, and clip
# import local python modules
import sys
sys.path.insert(0,"")
$PATH.append("/home/yobleck/.nimble/bin")
def test_func():
notify-send "test"
# sys.path.append("/home/yobleck/old_projects/");
# import progress_bar;
# def bar(i):
# print(i);
# progress_bar.timer_bar(i, bar_length=50,);
# bash commands that dont work
# command, alias, time, run
# XONSH WEBCONFIG END