add prompt

This commit is contained in:
2024-02-09 20:38:42 +01:00
parent e15d424a38
commit 579487db91
3 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import sys
import re
with open("/proc/self/net/dev", "r") as f:
data = f.read()
match = re.search("^enp[0-9a-z]+:", data, re.MULTILINE)
if match is None:
sys.exit(1)
else:
sys.exit(0)

4
scripts/vpn_prompt.sh Normal file
View File

@ -0,0 +1,4 @@
if ! /snacks/wireguard_scripts/is_root_namespace.py
then
export PS1='%F{red}<vpn>%f %n@%m % %c %#'
fi