Add common virtualenv segment

This commit is contained in:
Kim Silkebækken 2013-01-22 14:19:04 +01:00
parent 35de8a192b
commit 504e212f14
4 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,5 @@
{ {
"name": "Default color scheme for terminal prompts", "name": "Default color scheme for shell prompts",
"colors": { "colors": {
"black": 16, "black": 16,
"white": 231, "white": 231,
@ -10,6 +10,7 @@
"brightgreen": 148, "brightgreen": 148,
"darkestcyan": 23, "darkestcyan": 23,
"darkcyan": 74,
"mediumcyan": 117, "mediumcyan": 117,
"brightcyan": 159, "brightcyan": 159,
@ -55,6 +56,7 @@
"groups": { "groups": {
"user": { "fg": "white", "bg": "darkblue", "attr": ["bold"] }, "user": { "fg": "white", "bg": "darkblue", "attr": ["bold"] },
"superuser": { "fg": "white", "bg": "brightred", "attr": ["bold"] }, "superuser": { "fg": "white", "bg": "brightred", "attr": ["bold"] },
"virtualenv": { "fg": "white", "bg": "darkcyan" },
"branch": { "fg": "gray9", "bg": "gray2" }, "branch": { "fg": "gray9", "bg": "gray2" },
"cwd": { "fg": "gray9", "bg": "gray4" }, "cwd": { "fg": "gray9", "bg": "gray4" },
"cwd:current_folder": { "fg": "gray10", "bg": "gray4", "attr": ["bold"] }, "cwd:current_folder": { "fg": "gray10", "bg": "gray4", "attr": ["bold"] },

View File

@ -9,6 +9,9 @@
{ {
"name": "user" "name": "user"
}, },
{
"name": "virtualenv"
},
{ {
"name": "cwd", "name": "cwd",
"args": { "args": {

View File

@ -9,6 +9,9 @@
{ {
"name": "user" "name": "user"
}, },
{
"name": "virtualenv"
},
{ {
"name": "branch", "name": "branch",
"before": " " "before": " "

View File

@ -211,3 +211,7 @@ def network_load(interface='eth0', measure_interval=1, suffix='B/s', binary_pref
rx_diff=humanize_bytes((b2[0] - b1[0]) / measure_interval, suffix, binary_prefix), rx_diff=humanize_bytes((b2[0] - b1[0]) / measure_interval, suffix, binary_prefix),
tx_diff=humanize_bytes((b2[1] - b1[1]) / measure_interval, suffix, binary_prefix), tx_diff=humanize_bytes((b2[1] - b1[1]) / measure_interval, suffix, binary_prefix),
) )
def virtualenv():
return os.path.basename(os.environ.get('VIRTUAL_ENV', '')) or None