added wsl support for bwg
This commit is contained in:
parent
640bda7ecc
commit
f5faaaa51b
1 changed files with 16 additions and 2 deletions
14
.xonshrc
14
.xonshrc
|
@ -10,7 +10,21 @@ class CommandNotFoundException(Exception):
|
|||
def __init__(self, command):
|
||||
super().__init__(f"Command '{command}' not found.")
|
||||
|
||||
# Windows Subsystem for Linux stuff
|
||||
|
||||
def in_wsl() -> bool:
|
||||
version = p'/proc/version'.read_text()
|
||||
if "microsoft" in version:
|
||||
return True
|
||||
return False
|
||||
|
||||
if in_wsl():
|
||||
$GPG_TTY=$(tty)
|
||||
|
||||
def to_clipboard(text: str):
|
||||
if in_wsl():
|
||||
$(echo -n @(text) | clip.exe)
|
||||
else:
|
||||
requires("xclip")
|
||||
$(echo -n @(text) | xclip -sel clipboard)
|
||||
|
||||
|
|
Loading…
Reference in a new issue