update doots
This commit is contained in:
parent
e9f966929e
commit
76ac48fa92
4 changed files with 53 additions and 29 deletions
4
.vimrc
4
.vimrc
|
@ -39,7 +39,7 @@ set splitright
|
|||
"nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
"formatting
|
||||
set tabstop=4
|
||||
set tabstop=2
|
||||
set softtabstop=0 noexpandtab
|
||||
set shiftwidth=4
|
||||
|
||||
|
@ -55,7 +55,7 @@ set number
|
|||
nnoremap <C-t> :NERDTreeToggle<CR>
|
||||
|
||||
"Language server junk
|
||||
let g:lsc_server_commands = {'py': 'pyls'}
|
||||
let g:lsc_server_commands = {'py': 'pyls', 'xsh': 'pyls'}
|
||||
|
||||
let g:lsc_auto_map = v:true
|
||||
|
||||
|
|
22
.xonshrc
22
.xonshrc
|
@ -5,12 +5,17 @@ xontrib load apt_tabcomplete argcomplete autovox jedi z
|
|||
|
||||
# path stuff
|
||||
|
||||
$PATH.insert(0, '')
|
||||
$PATH.extend([
|
||||
def load_path():
|
||||
import sys
|
||||
$PATH.extend([
|
||||
'~/addins',
|
||||
'~/.local/bin',
|
||||
'~/bin',
|
||||
])
|
||||
'~/go/bin'
|
||||
])
|
||||
sys.path.insert(0, '')
|
||||
|
||||
load_path()
|
||||
|
||||
import addins # my extra stuffs :p
|
||||
|
||||
|
@ -37,16 +42,20 @@ def _debug():
|
|||
print("Debug mode enabled.")
|
||||
|
||||
# bitwarden shit
|
||||
def _bwc(object : str, id : str):
|
||||
def _bwc(object : str, bw_id: str):
|
||||
if p'~/.bw_session'.exists():
|
||||
if $XONSH_SHOW_TRACEBACK:
|
||||
print("loaded .bw_session")
|
||||
source ~/.bw_session
|
||||
else:
|
||||
raise FileNotFoundError("~/.bw_session")
|
||||
output = $(bw get @(object) @(id))
|
||||
output = $(bw get @(object) @(bw_id))
|
||||
$(echo @(output) | xclip -sel clipboard)
|
||||
return output
|
||||
if "password" in object and !(bw get totp @(object[1]) a> /dev/null):
|
||||
input("totp found, press any key to copy totp ")
|
||||
output = $(bw get totp @(object[1]))
|
||||
$(echo @(output) | xclip -sel clipboard)
|
||||
# return output
|
||||
|
||||
# aliases
|
||||
aliases.update({
|
||||
|
@ -57,6 +66,7 @@ aliases.update({
|
|||
'debug': _debug,
|
||||
'ls': 'ls -alhs --color=auto',
|
||||
':q': 'exit',
|
||||
'owo': 'echo uwu',
|
||||
})
|
||||
|
||||
# man page colors :O
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .version import *
|
||||
from .package import *
|
||||
from .version import Version
|
||||
from .package import Package
|
||||
|
||||
__all__ = ['Version', 'Package']
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
import platform
|
||||
from pathlib import Path
|
||||
|
||||
__all__ = ['Version']
|
||||
|
||||
class Platform:
|
||||
def __init__(self):
|
||||
self.architecture = platform.architecture()
|
||||
self.machine = platform.machine()
|
||||
self.node = platform.node()
|
||||
self.platform = platform.platform()
|
||||
self.processor = platform.processor()
|
||||
self.release = platform.release()
|
||||
self.system = platform.system()
|
||||
self.version = platform.version()
|
||||
|
||||
class Version:
|
||||
def __init__(self):
|
||||
data = self._load_dict()
|
||||
|
@ -9,6 +21,8 @@ class Version:
|
|||
setattr(self, key.lower(), value)
|
||||
if hasattr(self, "id_like"): # special handling for ID_LIKE
|
||||
self.id_like = self.id_like.split()
|
||||
if not hasattr(self, "platform"):
|
||||
self.platform = Platform()
|
||||
|
||||
def _load_dict(self):
|
||||
data = {}
|
||||
|
|
Loading…
Reference in a new issue